godMCP-MCP服务器创建者和管理器
   
godMCP 是一个功能强大的模型上下文协议(MCP)服务器,使您能够轻松创建、管理和部署自定义MCP服务器。将其视为一个元服务器,帮助您构建其他MCP服务器。
🎯 非常适合: 人工智能开发人员、自动化爱好者以及任何想用自定义功能扩展其启用MCP的工具的人。
特性
- 🚀 创建MCP服务器 -使用自定义工具生成完整的、可用于生产的MCP服务器
- 🔧 工具实施 -为增量开发提供完整的实现或存根
- 📝 配置管理 -在MCP配置中自动注册服务器
- 🔄 更新工具 -创建服务器后修改工具实现
- 🎯 多客户端支持 -适用于Kiro、Claude Desktop、Cursor和其他MCP客户端
- ✅ 正确的缩进 -生成语法正确的Python代码
- 🌍 基于环境的配置 -对服务器注册位置的显式控制
目录
安装
先决条件
- Python 3.10或更高版本
- 紫外线 包管理器
安装uv
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or with pip
pip install uv克隆和设置
git clone
cd god-mcp入门指南
快速设置
将此配置添加到MCP客户端的配置文件中:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/god-mcp", "god-mcp"],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/path/to/this/config/mcp.json", //here newly created mcps will be added
"USER_MCP_CONFIG_PATH": "/path/to/user/config/mcp.json" //here newly created mcps will be added
},
"disabled": false
}
}
}重要提示:
- 替换
/absolute/path/to/god-mcp使用您实际的godMCP安装目录 - 集
USER_MCP_CONFIG_PATH到您的用户/全局mcp配置(mcp.json文件的路径,您希望在其中添加新创建的mcp服务器。) - 集
WORKSPACE_MCP_CONFIG_PATH到要添加新创建的mcp服务器的工作区mcp配置文件的路径。(如果提供了工作区mcp配置路径,将默认使用。) - 如果提供了任何一个,将用于创建新的mcp服务器。
1.客户特定设置
godMCP适用于任何兼容MCP的客户端。在下面选择您的客户端以获取特定的配置路径和说明:
Kiro
配置路径:
- 工作区:
.kiro/settings/mcp.json(项目特定) - 用户:
~/.kiro/settings/mcp.json(全球)
设置:
编辑您的工作区或用户级配置:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/absolute/path/to/workspace/.kiro/settings/mcp.json",
"USER_MCP_CONFIG_PATH": "/Users/yourusername/.kiro/settings/mcp.json"
},
"disabled": false
}
}
}注: 将两个env变量设置为配置godMCP的同一文件。
Claude Desktop
配置路径:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 窗户:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
设置:
- 打开克劳德桌面
- 前往设置→ 开发者→ 编辑配置
- 添加godMCP配置:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "~/Library/Application Support/Claude/claude_desktop_config.json",
"USER_MCP_CONFIG_PATH": "~/Library/Application Support/Claude/claude_desktop_config.json"
},
"disabled": false
}
}
}注: Claude Desktop没有工作区概念,因此两个env变量都指向同一个文件。
Claude Code
配置路径:
- 项目:
.mcp.json(项目根) - 全球的:
~/.claude.json
通过CLI进行设置:
claude mcp add godMCP手动设置:
编辑 .mcp.json 或 ~/.claude.json:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/absolute/path/to/project/.mcp.json",
"USER_MCP_CONFIG_PATH": "/Users/yourusername/.claude.json"
},
"disabled": false
}
}
}Cursor
配置路径:
- 全球的:
- macOS: ~/Library/Application Support/Cursor/User/settings.json - 窗户: %APPDATA%\Cursor\User\settings.json - Linux: ~/.config/Cursor/User/settings.json
- 项目:
.cursor/mcp.json
设置:
编辑配置文件:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/absolute/path/to/project/.cursor/mcp.json",
"USER_MCP_CONFIG_PATH": "~/Library/Application Support/Cursor/User/settings.json"
},
"disabled": false
}
}
}GitHub Copilot
配置路径:
~/.copilot/config.json或mcp-config.json
通过命令设置:
/mcp add按照交互式提示添加godMCP。
手动设置:
编辑 ~/.copilot/config.json:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "~/.copilot/config.json",
"USER_MCP_CONFIG_PATH": "~/.copilot/config.json"
},
"disabled": false
}
}
}Cline (VS Code Extension)
配置路径:
.cline_mcp_settings.json
设置:
- 打开VS代码
- 单击MCP服务器图标
- 转到“配置”选项卡
- 添加godMCP配置:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/absolute/path/to/project/.cline_mcp_settings.json",
"USER_MCP_CONFIG_PATH": "/absolute/path/to/project/.cline_mcp_settings.json"
},
"disabled": false
}
}
}Windsurf IDE
配置路径:
- macOS:
~/Library/Application Support/Windsurf/User/settings.json - 窗户:
%APPDATA%\Windsurf\User\settings.json - Linux:
~/.config/Windsurf/User/settings.json
设置:
- 打开Cascade AI面板
- 转到MCP服务器
- 点击“添加自定义服务器”
- 添加配置:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "~/Library/Application Support/Windsurf/User/settings.json",
"USER_MCP_CONFIG_PATH": "~/Library/Application Support/Windsurf/User/settings.json"
},
"disabled": false
}
}
}Zed IDE
配置路径:
settings.json随着context_servers对象
设置:
- 打开代理面板
- 前往设置
- 点击“添加自定义服务器”
- 添加配置:
{
"context_servers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/path/to/settings.json",
"USER_MCP_CONFIG_PATH": "/path/to/settings.json"
}
}
}
}JetBrains IDEs (IntelliJ, PyCharm, etc.)
要求:
- 版本2025.2或更高版本
设置:
- 前往设置→ 工具→ 模型上下文协议
- 添加新的MCP服务器
- 配置:
- 命令: uv - 论据: run --directory /absolute/path/to/god-mcp god-mcp - 环境变量: - FASTMCP_LOG_LEVEL=INFO - WORKSPACE_MCP_CONFIG_PATH=/path/to/config - USER_MCP_CONFIG_PATH=/path/to/config
PurecodeAI
配置路径:
- 项目特定或全局配置文件
设置:
将godMCP添加到您的MCP配置中:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/path/to/workspace/config.json",
"USER_MCP_CONFIG_PATH": "/path/to/user/config.json"
},
"disabled": false
}
}
}Other MCP Clients
对于任何兼容MCP的客户端,请使用标准配置格式:
{
"mcpServers": {
"godMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/god-mcp",
"god-mcp"
],
"env": {
"FASTMCP_LOG_LEVEL": "INFO",
"WORKSPACE_MCP_CONFIG_PATH": "/path/to/workspace/mcp.json",
"USER_MCP_CONFIG_PATH": "/path/to/user/mcp.json"
},
"disabled": false
}
}
}要点:
- 替换
/absolute/path/to/god-mcp使用您实际的godMCP目录 - 集
WORKSPACE_MCP_CONFIG_PATH到您的工作区/项目配置文件 - 集
USER_MCP_CONFIG_PATH到您的用户/全局配置文件 - 如果您的客户端不支持工作空间概念,两者都可以指向同一个文件
2.重新启动MCP客户端
重新启动或重新连接MCP客户端以加载godMCP。
3.验证安装
使用 health_check 用于验证godMCP是否正在运行的工具:
Can you check if godMCP is healthy?配置
环境变量
godMCP使用两个环境变量来确定在哪里注册创建的服务器:
WORKSPACE_MCP_CONFIG_PATH:工作空间级MCP配置路径USER_MCP_CONFIG_PATH:用户级MCP配置路径
重要提示: 两者通常都应该指向配置godMCP本身的同一个文件(“当前作用域”)。
配置级别
创建服务器时,可以指定:
config_level="workspace"-在工作区配置中注册(默认)config_level="user"-在用户配置中注册target_config_path="/custom/path/mcp.json"-显式路径覆盖
检查当前配置
使用 get_config_info 查看当前配置的工具:
Show me the current godMCP configuration用法
创建服务器
使用自定义工具创建新的MCP服务器:
Create an MCP server called "calculator" with these operations:
- add: adds two numbers
- subtract: subtracts two numbers
- multiply: multiplies two numbers
- divide: divides two numbers (with zero check)全面实施:
create_mcp_server(
name="calculator",
description="A calculator with basic arithmetic operations",
tools=[
{
"name": "add",
"description": "Add two numbers together",
"parameters": {
"type": "object",
"properties": {
"a": {"type": "number", "description": "First number"},
"b": {"type": "number", "description": "Second number"}
},
"required": ["a", "b"]
},
"implementation": """result = a + b
return {
"status": "success",
"result": result,
"expression": f"{a} + {b} = {result}"
}"""
}
]
)更新工具实施
创建后修改工具的实现:
Update the calculator's add function to include a timestampupdate_tool_implementation(
server_name="calculator",
tool_name="add",
implementation="""from datetime import datetime
result = a + b
return {
"status": "success",
"result": result,
"expression": f"{a} + {b} = {result}",
"timestamp": datetime.now().isoformat()
}"""
)管理配置
读取配置:
read_mcp_json(level="both") # Read both workspace and user configs更新配置:
update_mcp_json(
server_name="my-server",
server_config={
"command": "uvx",
"args": ["my-server"],
"disabled": false
},
level="workspace"
)删除服务器:
remove_mcp_server(server_name="calculator")可用工具
服务器创建
create_mcp_server-使用自定义工具创建新的MCP服务器
- 参数:名称、描述、工具、依赖关系、output_dir、寄存器、config_level、target_config路径 - 返回:服务器信息,包括路径和注册状态
工具管理
update_tool_implementation-更新工具的实现代码
- 参数:服务器名、工具名、实现 - 返回:更新状态和文件路径
配置管理
read_mcp_json-读取MCP配置文件
- 参数:级别(“工作区”、“用户”或“两者”) - 返回:包含元数据的配置数据
update_mcp_json-添加或更新服务器条目
- 参数:服务器名称、服务器配置、级别 - 返回:成功确认
remove_mcp_server-从配置中删除服务器
- 参数:服务器名称 - 返回:删除确认
get_config_info-获取当前配置路径和状态
- 返回:配置信息,包括路径、源和可写性
公用事业
health_check-验证godMCP是否正在运行
- 返回:健康状态信息
示例
示例1:简单计算器
Create a calculator MCP server with add, subtract, multiply, and divide operations.
Include proper error handling for division by zero.示例2:文件实用程序服务器
Create an MCP server called "file-utils" with these tools:
- read_file: reads a file and returns its content
- write_file: writes content to a file
- list_directory: lists files in a directory示例3:增量开发
1. Create a server with stub implementations:
"Create a data-processor server with parse_csv and analyze_data tools"
2. Later, implement the tools:
"Update the parse_csv tool to actually parse CSV files using the csv module"故障排除
服务器未在正确位置注册
问题: 创建的服务器出现在错误的mcp.json文件中。
解决方案: 确保环境变量设置正确:
"env": {
"WORKSPACE_MCP_CONFIG_PATH": "/correct/path/to/mcp.json",
"USER_MCP_CONFIG_PATH": "/correct/path/to/mcp.json"
}使用 get_config_info 以验证电流路径。
生成的代码中存在识别错误
问题: 生成的服务器存在语法错误。
解决方案: 这应该在最新版本中修复。如果您遇到以下情况:
- 更新至godMCP的最新版本
- 重新连接godMCP服务器
- 重新创建服务器
服务器未启动
问题: 创建的服务器无法启动。
解决方案:
- 检查服务器的调试日志:
.mcp-servers//_debug.log - 验证服务器目录是否存在
- 确保
uv已安装且可访问 - 重新连接MCP客户端
环境变量不起作用
问题: godMCP仍然使用回退路径。
解决方案:
- 验证环境变量是否在正确的配置文件中
- 重新启动/重新连接MCP客户端
- 使用
get_config_info确认变量已加载
发展
项目结构
god-mcp/
├── src/
│ └── god_mcp/
│ ├── __init__.py
│ ├── server.py # Main FastMCP server
│ ├── config_manager.py # Configuration file management
│ ├── server_creator.py # Server generation logic
│ └── models.py # Data models
├── .mcp-servers/ # Generated servers location
├── pyproject.toml
└── README.md本地运行
cd god-mcp
uv run god-mcp生成的服务器结构
每个创建的服务器都具有以下结构:
.mcp-servers//
├── src/
│ └──
/
│ ├── __init__.py
│ └── server.py
├── pyproject.toml
├── README.md
└── _debug.log贡献
我们欢迎捐款!请查看我们的 贡献.md 详细指南:
- 设置您的开发环境
- 代码风格指南
- 提交拉取请求
- 报告问题
贡献者快速入门
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/godmcp.git
cd godmcp/god-mcp
# Install dependencies
uv sync
# Run locally
uv run god-mcp许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
致谢
支持
路线图
- \[\]添加对资源模板的支持
- \[\]实施及时管理
- \[\]添加服务器测试实用程序
- \[\]创建用于服务器管理的web UI
- \[\]支持多种编程语言
- \[\]与流行的AI开发工具集成
______________________________________________________________________
由以下材料制成❤️ 对于MCP社区
