mcp-sinstaller)该项目提供了一个MCP服务器安装程序,可以从GitHub仓库自动安装并容器化其他MCP服务器。它使用模型上下文协议(MCP)采样特性来分析仓库并创建适当的Docker镜像。
https://github.com/user-attachments/assets/6ad17a8b-c88f-4cba-abea-3a1f5288ed3c
在您的VS Code设置中添加以下内容:
"chat.mcp.serverSampling": {
"Global in Code - Insiders: sampling": {
"allowedDuringChat": true
}
}
首先,克隆仓库:
git clone https://github.com/semcp/mcp-sinstaller.git
然后,在您的VS Code设置中添加以下内容:
"mcp-sinstaller": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"/path/to/mcp-sinstaller",
"python",
"/path/to/mcp-sinstaller/mcp_installer.py",
]
},
安装程序使用结构化的命名方案:owner-repo-servername,以避免从同一仓库安装多个服务器时发生冲突。
示例:
https://github.com/modelcontextprotocol/servers/tree/main/src/fetch → modelcontextprotocol-servers-fetchhttps://github.com/modelcontextprotocol/servers/tree/main/src/filesystem → modelcontextprotocol-servers-filesystemhttps://github.com/github/github-mcp-server → github-github-mcp-server这允许您从如modelcontextprotocol/servers这样的仓库安装多个MCP服务器而不发生命名冲突。
提示:"install https://github.com/github/github-mcp-server"
GitHub Copilot:
我将从您指定的仓库安装GitHub MCP服务器。
采样(MCP服务器):
输入:
{
"url": "https://github.com/github/github-mcp-server"
}
输出:
成功构建了MCP服务器'github-mcp-server'的Docker镜像!
仓库:https://github.com/github/github-mcp-server
位置:/Users/mossaka/.mcp-installer/servers/github-mcp-server
DOCKER镜像:
- 使用现有的Dockerfile
- 镜像:mcp-installer-github-mcp-server
- 大小及创建时间:REPOSITORY:TAG SIZE CREATED AT
mcp-installer-github-mcp-server:latest 59.5MB 2025-06-09 14:52:46 -0700 PDT
- 端口:{}
- 环境变量:['GITHUB_PERSONAL_ACCESS_TOKEN', 'GITHUB_TOOLSETS', 'GITHUB_DYNAMIC_TOOLSETS', 'GITHUB_READ_ONLY', 'GITHUB_HOST']
- 必要的秘密:['GITHUB_PERSONAL_ACCESS_TOKEN']
- 元数据:/Users/mossaka/.mcp-installer/servers/github-mcp-server/metadata.json
运行容器(STDIO传输):
1. 设置必要的环境变量(如果有):
export GITHUB_PERSONAL_ACCESS_TOKEN=your_actual_github_personal_access_token_here
2. 交互式运行容器:
docker run -i --rm --name mcp-github-mcp-server-container -e GITHUB_PERSONAL_ACCESS_TOKEN=GitHub个人访问令牌(必需) -e GITHUB_TOOLSETS=逗号分隔的工具集列表(可选) -e GITHUB_DYNAMIC_TOOLSETS=设置为1以启用动态工具发现(可选) -e GITHUB_READ_ONLY=设置为1以启用只读模式(可选) -e GITHUB_HOST=自定义GitHub企业API端点(可选) -e GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_PERSONAL_ACCESS_TOKEN} mcp-installer-github-mcp-server
注意:此服务器使用STDIO传输(标准输入/输出通信)。
- 容器交互式运行(-i标志)
- 当其退出时会自动删除(--rm标志)
- 不需要端口映射,因为它使用标准输入/输出
3. 停止容器:
在运行它的终端中按Ctrl+C
4. 使用MCP客户端进行后台操作:
使用您的MCP客户端通过子进程/STDIO连接
很好!GitHub MCP服务器已成功安装。安装完成,并构建了一个Docker镜像。
以下是已安装的内容:
服务器名称:github-mcp-server
仓库:https://github.com/github/github-mcp-server
Docker镜像:mcp-installer-github-mcp-server:latest (59.5MB)
传输类型:STDIO(通过标准输入/输出通信)
必要配置:该服务器需要一个GITHUB_PERSONAL_ACCESS_TOKEN环境变量来与GitHub的API进行身份验证。
可选环境变量:
GITHUB_TOOLSETS:逗号分隔的工具集列表
GITHUB_DYNAMIC_TOOLSETS:设置为1以启用动态工具发现
GITHUB_READ_ONLY:设置为1以启用只读模式
GITHUB_HOST:自定义GitHub企业API端点
服务器现在可以使用了。要运行它,您需要设置您的GitHub个人访问令牌,然后使用STDIO传输运行Docker容器以与MCP客户端通信。
之后,您可以运行docker来在代理的MCP设置中运行容器。
"github": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN=<PAT>",
"mcp-installer-github-mcp-server",
]
}
提示:"install https://github.com/modelcontextprotocol/servers/tree/typescript-servers-0.6.2/src/fetch"
我将从您提供的特定路径安装fetch MCP服务器。
采样(MCP服务器)
输入:
{
"url": "https://github.com/modelcontextprotocol/servers/tree/typescript-servers-0.6.2/src/fetch"
}
输出:
成功构建了MCP服务器'modelcontextprotocol-servers-fetch'的Docker镜像!
仓库:https://github.com/modelcontextprotocol/servers/tree/typescript-servers-0.6.2/src/fetch
位置:/Users/mossaka/.mcp-sinstaller/servers/modelcontextprotocol-servers-fetch
DOCKER镜像:
- 生成新的Dockerfile
- 镜像:mcp-sinstaller-modelcontextprotocol-servers-fetch
- 大小及创建时间:REPOSITORY:TAG SIZE CREATED AT
mcp-sinstaller-modelcontextprotocol-servers-fetch:latest 654MB 2025-06-09 16:28:35 -0700 PDT
- 端口:{}
- 环境变量:[]
- 必要的秘密:[]
- 元数据:/Users/mossaka/.mcp-sinstaller/servers/modelcontextprotocol-servers-fetch/metadata.json
运行容器(STDIO传输):
1. 设置必要的环境变量(如果有):
没有需要的秘密
2. 交互式运行容器:
docker run -i --rm --name mcp-modelcontextprotocol-servers-fetch-container mcp-sinstaller-modelcontextprotocol-servers-fetch
注意:此服务器使用STDIO传输(标准输入/输出通信)。
- 容器交互式运行(-i标志)
- 当其退出时会自动删除(--rm标志)
- 不需要端口映射,因为它使用标准输入/输出
3. 使用您的MCP客户端通过子进程/STDIO传输连接
✅ fetch MCP服务器已成功安装!
服务器已构建并准备好使用。以下是关键信息:
服务器信息:
名称:modelcontextprotocol-servers-fetch
仓库:https://github.com/modelcontextprotocol/servers/tree/typescript-servers-0.6.2/src/fetch
传输:STDIO(标准输入/输出)
镜像大小:654MB
"fetch": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp-sinstaller-modelcontextprotocol-servers-fetch"
]
},