Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Editor/MCPConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MCPConnectionManager
{
private static readonly string ComponentName = "MCPConnectionManager";
private ClientWebSocket webSocket;
private Uri serverUri = new Uri("ws://localhost:8080"); // Changed to allow changing
private Uri serverUri = new Uri("ws://localhost:5010"); // Changed to allow changing
private readonly CancellationTokenSource cts = new CancellationTokenSource();
private bool isConnected = false;
private float reconnectTimer = 0f;
Expand Down
8 changes: 4 additions & 4 deletions Editor/UI/MCPDebugWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void CreateGUI()
// Set default port if empty
if (serverPortField != null && string.IsNullOrWhiteSpace(serverPortField.value))
{
serverPortField.value = "8080";
serverPortField.value = "5010";
}

// Setup UI events
Expand All @@ -113,7 +113,7 @@ private void CreateFallbackUI(VisualElement root)

// Removed serverUrlField - only using port field as requested

serverPortField = new TextField("Port (Default: 8080)") { value = "8080" };
serverPortField = new TextField("Port (Default: 5010)") { value = "5010" };
root.Add(serverPortField);

var connectButton = new Button(OnConnectClicked) { text = "Connect" };
Expand Down Expand Up @@ -240,10 +240,10 @@ private void OnConnectClicked()
// Get the server port from the text field
string portText = serverPortField.value;

// If port is empty, default to 8080
// If port is empty, default to 5010
if (string.IsNullOrWhiteSpace(portText))
{
portText = "8080";
portText = "5010";
serverPortField.value = portText;
}

Expand Down
2 changes: 1 addition & 1 deletion Editor/UI/MCPDebugWindow.uxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ui:VisualElement style="flex-direction: row; align-items: center; margin-bottom: 10px;">
<ui:Label text="Port:" class="server-url-label" />
<ui:TextField name="server-port-field" value="8080" placeholder="Default: 8080" class="server-url-field" />
<ui:TextField name="server-port-field" value="5010" placeholder="Default: 5010" class="server-url-field" />
</ui:VisualElement>

<ui:VisualElement style="flex-direction: row; align-items: center;">
Expand Down
8 changes: 8 additions & 0 deletions mcpServer/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
npm-debug.log
.git
.github
.vscode
*.md
build/
.env
4 changes: 4 additions & 0 deletions mcpServer/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Unity MCP Server Configuration

# WebSocket port for Unity Editor connection
MCP_WEBSOCKET_PORT=5010
26 changes: 26 additions & 0 deletions mcpServer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:18-alpine

# Create app directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy source code and TypeScript config
COPY tsconfig.json ./
COPY src/ ./src/

# Build the application
RUN npm run build

# Default environment variable
ENV MCP_WEBSOCKET_PORT=5010

# Expose the port dynamically using the environment variable
EXPOSE ${MCP_WEBSOCKET_PORT}

# Command to run the MCP server
CMD ["sh", "-c", "node build/index.js"]
7 changes: 7 additions & 0 deletions mcpServer/Dockerfile.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading