How do I connect to GitHub MCP Server from a Node.js client when running the server in Docker? #554
BjarneBeruldsen
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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