mcp-toolforge
mcp-toolforge
一个 meta-MCP 服务器,可根据自然语言工具描述生成新的 MCP 服务器。
给定项目名称、简短描述以及一组自然语言工具描述(例如 `"fetches the weather for a string city and returns a string summary"` ),mcp-toolforge 会写入一个完整、可运行的 MCP 服务器项目——schema、实现、带真实断言的测试、README、LICENSE——可直接安装并运行。
flowchart TD
subgraph Client_Layer["AI Client / Claude Desktop"]
A["Client (Claude, Cursor, etc.)"]
end
subgraph Meta_Server["mcp-toolforge (this repo)"]
M["mcp_toolforge.server"]
G["mcp_toolforge.generator"]
end
subgraph Generated["Generated Server Project"]
P["src/<pkg>/__init__.py"]
S["src/<pkg>/server.py"]
T["tests/test_<pkg>.py"]
R["README.md"]
L["LICENSE"]
PP["pyproject.toml"]
end
A -- "MCP stdio JSON-RPC" --> M
M -- "generate_server tool call" --> G
G -- "writes files" --> P
G -- "writes files" --> S
G -- "writes files" --> T
G -- "writes files" --> R
G -- "writes files" --> L
G -- "writes files" --> PP架构
┌─────────────────────┐ ┌──────────────────────────┐
│ AI Client │ stdio │ mcp-toolforge server │
│ (Claude, Cursor) │──JSON──│ (this repo) │
└─────────────────────┘ RPC └────────┬───────────────┘
│ generate_server
│ (name, description,
│ tool_descriptions, dest)
▼
┌────────────────────────────────────┐
│ generator.generate_project() │
│ parses NL → ToolSpec → ServerSpec │
│ renders: pyproject, server.py, │
│ tests, README, LICENSE │
└────────────────────────────────────┘
│
┌─────────────────┴─────────────────┐
│ Example generated servers │
│ • examples/weather_server │
│ • examples/todo_server │
│ • examples/math_server │
└────────────────────────────────────┘Related MCP server: mcp-creator
快速开始
安装 mcp-toolforge
pip install -e ".[dev]"运行 mcp-toolforge 本身(meta 服务器)
作为 MCP 服务器(stdio 传输):
{
"mcpServers": {
"mcp-toolforge": {
"command": "python",
"args": ["-m", "mcp_toolforge.server"],
"cwd": "/path/to/mcp-toolforge"
}
}
}或者作为 CLI 生成独立的服务器项目:
# Interactive wizard
mcp-toolforge -i
# One-shot
mcp-toolforge \
--name my_server \
--description "A server that does X" \
--tool "fetches the weather for a string city and returns a string summary" \
--dest ./my_server使用 generate_server 工具
当 mcp-toolforge 被注册为 MCP 服务器时,AI 智能体可以调用:
generate_server(
name="my_server",
description="A server that does X",
tool_descriptions=[
"fetches the weather for a string city and returns a string summary",
"adds a string task and returns a string confirmation"
],
dest="/path/to/output" # optional, defaults to /tmp/mcp-toolforge-gen
)该工具会把一个完整项目写入 dest/<package_name>/ 并返回一个摘要字符串,随后生成的服务器可以独立安装并注册到你的 MCP 客户端。
自然语言解析的工作原理
每个工具描述都应遵循如下模式:
<VERB> [a/an] <type> <name> [, <type> <name>] ... and returns <type> <description>示例:
描述 | 工具名称 | 参数 |
|
|
|
|
|
|
|
|
|
|
|
|
可识别的参数类型:string、integer、number、boolean、array。如果检测不到带类型的参数,则推断一个自由格式的 query: string 参数。
示例
本文档在 examples/ 下生成三个示例服务器:
服务器 | 包名 | 工具 | 描述 |
WeatherServer |
|
| 获取天气信息 |
TodoServer |
|
| 管理待办事项列表 |
MathServer |
|
| 算术工具 |
每一个示例都是一台可以正常运行的 MCP 服务器,并自带测试:
cd examples/math_server
pip install -e .
pytest开发
# Install with dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run end-to-end test against the meta-server over stdio
python e2e_test.py
# Regenerate examples
python make_examples.py测试
tests/test_generator.py— 16 个测试,用于生成器(解析、schema 推断、文件渲染、项目创建)tests/test_server.py— 5 个测试,用于 meta-MCP 服务器(工具列举、工具调用、错误处理)e2e_test.py— 端到端测试,以真实 stdio 子进程方式运行 meta-MCP 服务器,并通过 MCPClient进行连接每个示例服务器自带 4 个测试(3 个示例共 12 个)
所有测试均使用真实断言,并校验实际文件输出 / 工具结果。
许可协议
MIT — 见 LICENSE。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn intelligent tool that automates the setup of new Model Context Protocol (MCP) server projects through a conversational interface. It generates project structures, technical specifications, and context-rich documentation to streamline AI-assisted development in TypeScript or Python.103MIT
- AlicenseAqualityCmaintenanceA tool that enables AI assistants to conversationally scaffold, build, and publish Python MCP servers to PyPI. It automates the entire development lifecycle, including package naming, tool scaffolding, GitHub repository setup, and package publishing.10MIT
- FlicenseNot gradedqualityDmaintenanceA production-ready Python scaffold for building Model Context Protocol (MCP) servers using FastMCP. It provides a structured framework for developers and AI agents to rapidly develop, test, and manage custom tools and workflows.1
- AlicenseAqualityCmaintenanceGenerates production-ready MCP servers with dual-mode (MCP + CLI) architecture, tests, and documentation. Includes progressive disclosure tools for AI agents and best practices guidance.7Apache 2.0
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/prem-the-dev/mcp-toolforge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server