mcp-http-adapter
The MCP HTTP adapter is a tool that allows you to expose a stdio MCP server over HTTP, which is typically only runnable locally. By creating a configuration file that specifies the command, arguments, and environment variables, you can accept requests from MCP clients. This enables broader access to the MCP server for a wider audience.
GitHub Stars
1
User Rating
Not Rated
Favorites
0
Views
23
Forks
0
Issues
0
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
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Author
Julian de Ruiter
56
Followers
57
Repositories
6
Gists
0
Total Contributions
🤩 Easy-to-use global IM bot platform designed for the LLM era / 简单易用的大模型即时通信机器人开发平台 ⚡️ Bots for QQ / QQ频道 / Discord / WeChat(微信)/ Telegram / 飞书 / 钉钉 / Slack 🧩 Integrated with ChatGPT(GPT)、DeepSeek、Dify、n8n、Claude、Google Gemini、xAI、PPIO、Ollama、阿里云百炼、SiliconFlow、Qwen、Moonshot(Kimi K2)、SillyTraven、MCP、WeClone etc. LLM & Agent & RAG