mcp-http-adapter

このMCP HTTPアダプタは、ローカルでのみ実行可能なstdio MCPサーバーをHTTP経由で公開するためのツールです。設定ファイルを作成し、コマンドや引数、環境変数を指定することで、MCPクライアントからのリクエストを受け付けることができます。これにより、より広範なユーザーにMCPサーバーを提供することが可能になります。

GitHubスター

1

ユーザー評価

未評価

お気に入り

0

閲覧数

20

フォーク

0

イシュー

0

README
MCP HTTP adapter

Adapter that allows you to expose a stdio MCP server over streamable HTTP. Useful for exposing servers that can otherwise only be run locally with a broader audience.

graph LR
  server(MCP server)
	adapter[This adapter]
	client(MCP client)

	client -->|HTTP| adapter
  adapter -->|stdio| server
Usage
Creating the config file

Before running the adapter, you first need to create a configuration file (e.g. config.json) describing the command that should be run to start the stdio MCP server that we're going to proxy.

This config file requires the following fields:

  • command: The command to run.
  • args: List of arguments to pass to the command.
  • env: List of environment variables to include in the environment.

For example, for the Github MCP server this config would look like:

{
  "command": "github-mcp-server",
  "args": ["stdio"],
  "env": ["GITHUB_PERSONAL_ACCESS_TOKEN"]
}
Running using uv

Once you have the config file, you can run the adapter using:

CONFIG_PATH=config.json uv run fastmcp run main.py --transport streamable-http

Note that you'll also need to pass any variables listed in env here as well.

Running using Docker

Alternatively, you can also run the server using Docker. Note that in this case you'll need to make sure that the required MCP server binaries are also included in the image, together with your config file.

For an example involving the Github MCP server, see the docker/github folder. You can also run this example locally using:

docker run --rm -it -p 8000:8000 --env-file .env jrderuiter/mcp-stdio-adapter-github

where the .env file should contain the environment variable GITHUB_PERSONAL_ACCESS_TOKEN with a GitHub PAT token.

Contributing
  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request
Author

Julian de Ruiter