Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I connect to GitHub MCP Server from a Node.js client when running the server in Docker?#554

BjarneBeruldsen started this conversation inGeneral
Discussion options

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):

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!

You must be logged in to vote

Replies: 1 comment

Comment options

Hello 👋 ,

currently only the remote version supports http.
The local version will not work.

Regards, Tony

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@BjarneBeruldsen@tonytrg

[8]ページ先頭

©2009-2025 Movatter.jp