项目介绍
这是另一个能够在同一个 Docker 容器中部署多个 MCP server 的项目,支持部署到 Huggingface space。
项目地址:GitHub - BHznJNs/mcp-all-in-one: An easy way to deploy multiple MCP servers in one Docker container.
这个项目基于:GitHub - kfirtoledo/multi-mcp
部署到 Huggingface Space
点击这里创建 space,选择 Docker,然后在 Files 便签页添加下述文件(这里只是方便复制,请以 GitHub 上的文件为准):
Dockerfile:
# Build github mcp server
FROM golang:latest AS builder
WORKDIR /app
RUN CGO_ENABLED=0 go install github.com/github/github-mcp-server/cmd/github-mcp-server@latest
RUN ls -l /go/bin/
FROM alpine
# copy github mcp server binary
COPY --from=builder /go/bin/github-mcp-server /usr/local/bin/github-mcp-server
WORKDIR /app
# initiate python environment
RUN apk add --no-cache python3 py3-pip git py3-uv
# initiate nodejs environment
RUN apk add --no-cache nodejs npm
# initiate multi-mcp
RUN git clone https://github.com/kfirtoledo/multi-mcp.git .
RUN uv venv
RUN uv pip install -r requirements.txt
# copy the config file
COPY mcp.json /app/mcp.json
RUN mkdir /app/.uv-cache && chmod -R 777 /app/.uv-cache
ENV UV_CACHE_DIR=/app/.uv-cache
RUN mkdir /app/.npm-cache && chmod -R 777 /app/.npm-cache
ENV npm_config_cache=/app/.npm-cache
CMD ["uv", "run", "main.py", "--host", "0.0.0.0", "--port", "8080", "--config", "mcp.json", "--transport", "sse"]
mcp.json:
{
"mcpServers": {
"github": {
"command": "/usr/local/bin/github-mcp-server",
"args": ["stdio", "--toolsets", "all"]
},
"tavily": {
"command": "npx",
"args": ["-y", "[email protected]"]
}
}
}
在设置中添加 secrets:
| 变量名 | 示例值 | 描述 |
|---|---|---|
| TAVILY_API_KEY | tavily-9876543210fedcba | tavily 密钥 |
| GITHUB_PERSONAL_ACCESS_TOKEN | ghp_9876543210fedcba | gitHub 密钥 |
点击 Embed this Space 获取链接,如 https://xxx-xxx.hf.space/
在 MCP 客户端选择远程服务器(Remote servers),填入上面获取的链接,后面加上 sse(如 https://xxx-xxx.hf.space/sse)即可使用。
要使用其它的 MCP server 的话可以参考这里添加配置。
一些比较实用的、适合部署在远程服务器上的 MCP server
- GitHub - Rai220/think-mcp: MCP Server for reasoning 据说能提升模型性能
- GitHub - pyroprompts/any-chat-completions-mcp: MCP Server for using any LLM as a Tool 让 AI 与其它模型对话
- pydantic-ai/mcp-run-python at main · pydantic/pydantic-ai · GitHub 运行 python 代码
- GitHub - githejie/mcp-server-calculator: A Model Context Protocol server for calculating. 计算数学表达式
- GitHub - PV-Bhat/vibe-check-mcp-server: The definitive Vibe Coder's sanity check MCP server: Prevent cascading errors in AI workflows by implementing strategic pattern interrupts. Uses tool call "Vibe Check" with LearnLM 1.5 Pro (Gemini API), fine-tuned for pedagogy and metacognition to enhance complex workflow strategy, and prevents tunnel vision errors. 貌似能防止 ai 陷入处理错误的死循环
- GitHub - zhsama/duckduckgo-mcp-server 调用 duckduckgo
- GitHub - mem0ai/mem0-mcp 记忆功能
- GitHub - upstash/context7: Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors 防止 AI 基于过时的项目文档进行编码