How do I connect to GitHub MCP Server from a Node.js client when running the server in Docker? · github/github-mcp-server · Discussion #554 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the GitHub MCP Server together with a Node.js application that uses the MCP client from @modelcontextprotocol/sdk. My setup is as follows:
The MCP server is running in a Docker container, started like this: docker run -it --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=... -e GITHUB_TOOLSETS=all -p 3002:3000 ghcr.io/github/github-mcp-server
I want to connect to this server from Node.js, as in the example below (from my server.js):
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const MCP_SERVER_URL = 'http://localhost:3002/mcp';
let mcpClient;
let mcpTransport;
async function getMcpClient() {
if (mcpClient) return mcpClient;
mcpTransport = new StreamableHTTPClientTransport(new URL(MCP_SERVER_URL));
mcpClient = new Client({
name: 'mock-egde-ai-client',
version: '1.0.0'
});
await mcpClient.connect(mcpTransport);
return mcpClient;
}
Problem
When I start the Docker container, I only see the message GitHub MCP Server running on stdio in the logs, and none of the MCP tools are available from the client.
It seems like the MCP server is only listening on stdio, not HTTP, so the client cannot connect.
Questions
How do I start the GitHub MCP Server in Docker so that it listens on HTTP (e.g., on port 3000), so I can connect using StreamableHTTPClientTransport from Node.js?
Are there any specific flags or environment variables I need to use to enable HTTP mode in Docker?
Is there an example of the correct Docker command and client setup for this scenario?
Any help or examples would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.
Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.
🎥 Watch TMZ Live
TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I want to use the GitHub MCP Server together with a Node.js application that uses the MCP client from @modelcontextprotocol/sdk. My setup is as follows:
The MCP server is running in a Docker container, started like this:
docker run -it --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=... -e GITHUB_TOOLSETS=all -p 3002:3000 ghcr.io/github/github-mcp-server
I want to connect to this server from Node.js, as in the example below (from my server.js):
Problem
When I start the Docker container, I only see the message GitHub MCP Server running on stdio in the logs, and none of the MCP tools are available from the client.
It seems like the MCP server is only listening on stdio, not HTTP, so the client cannot connect.
Questions
How do I start the GitHub MCP Server in Docker so that it listens on HTTP (e.g., on port 3000), so I can connect using StreamableHTTPClientTransport from Node.js?
Are there any specific flags or environment variables I need to use to enable HTTP mode in Docker?
Is there an example of the correct Docker command and client setup for this scenario?
Any help or examples would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions