How do I connect to GitHub MCP Server from a Node.js client when running the server in Docker? #554
Replies: 3 comments
-
|
Hello 👋 , currently only the remote version supports http. Regards, Tony |
Beta Was this translation helpful? Give feedback.
-
|
@BjarneBeruldsen we will be releasing an open source version of the remote server soon, and then you might be able to do this. |
Beta Was this translation helpful? Give feedback.
-
|
You can connect from Node.js using the official MCP SDK ( Rough flow:
The key thing is that MCP over stdio is just JSON-RPC over STDIN/STDOUT, so most language SDKs work the same way. The Python SDK docs are the most complete, but the TypeScript SDK has the same primitives. |
Beta Was this translation helpful? Give feedback.
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-serverI 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