
mcpforge
io.github.saagpatel由 GitHub 账号 saagpatel 发布v0.3.4更新于 Oct 24, 2026
Generate complete, tested FastMCP 3.x MCP servers from one plain-English sentence.
概览
根据一句自然语言描述生成完整且经过测试的 FastMCP 3.x MCP 服务器,并可验证、检查和更新它们。
- 可以做什么
- mcpforge 把一句英文描述变成完整的 FastMCP 3.x 服务器项目:工具、Pydantic 输入校验、错误处理、pytest 测试套件、运行配置和客户端接入文档。它先规划工具,再生成代码,然后执行语法、安全、lint、导入和 pytest 检查。其他工具可验证、检查、列出和诊断已生成的服务器,update 可用自然语言对现有服务器做修改。演示模式使用内置录制运行整条流水线,无需 API 密钥。
- 适用场景
- 适合想快速搭建新 MCP 服务器、不想手写 MCP 协议样板代码的场景,也适合让助手在对话中构建、验证并迭代 MCP 服务器。面向已有模型服务商密钥和本地 Python 工作区的开发者。
- 运行要求
- 以 stdio 本地进程运行,通过 uvx 从 PyPI 包 fastmcp-builder 启动。需要 Python 3.12+ 和 uv。generate、update 和 plan 会调用模型服务商,因此需要 API 密钥:默认 ANTHROPIC_API_KEY,其他服务商使用 OPENROUTER_API_KEY 或 OPENAI_API_KEY。MCPFORGE_WORKSPACE 设置工作区路径。模型调用和依赖安装需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 mcpforge,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcpforge
[PyPI] [Python] [CI] [License: MIT]
One English sentence in. A tested, spec-free FastMCP 3.x server out.
mcpforge turns a plain-English description into a complete FastMCP 3.x MCP server — tools, Pydantic input validation, error handling, a pytest suite, run config, and client setup docs — all wired together and ready to inspect, validate, and install. There's no MCP schema or protocol boilerplate to hand-write: the sentence is the spec. You write it; Claude writes the implementation; mcpforge runs the generated test suite and validators before you ever run it.
⚡ 60-second start
[mcpforge demo: one command to a tested, validated MCP server]
You need Python 3.12+, uv, and an Anthropic API key.
No key yet? Try the demo.
mcpforge demoruns the real plan → generate → validate pipeline against a built-in recording and writes a complete, validated weather server — no API key, no spend. It's the fastest way to see exactly what mcpforge produces:
Bring your own key (BYOK). Generation runs on your Anthropic API key — mcpforge calls the Claude API directly and nothing is proxied through a hosted service. A single
generatemakes a few model calls (plan → server → tests), so a typical run costs roughly $0.05–$0.30 in API usage on the default model (claude-sonnet-4-6). That figure is an estimate — it scales with server complexity and your chosen model, and is not a live measurement. Everything that doesn't call the model —validate,inspect,list,doctor, andinit— is free.
That's the whole loop. mcpforge plans the tools, generates the code, then runs syntax, security, lint, import, and pytest checks against the result — so what lands in ./weather-server/ is already validated:
Every generation also produces test_server.py (a real pytest suite), pyproject.toml, a README.md, and an MCP client config.json — a complete project, not a snippet. Run it with:
[Generated server: tests pass, then it runs]
The snippet above is an illustrative toy ("weather") for the docs. Real generations match your description — see
examples/for live generated servers (todo, file reader, database query, Slack notifier, TypeScript).
Build, then audit — the MCP toolkit
mcpforge has a sibling: mcp-audit (mcp-audits on PyPI). They're two halves of one workflow — forge a server, then audit what your agents can actually touch before you trust it.
mcp-audit is read-only by default — it never edits a config and reports env-var key names only, never values. Build with confidence, then verify your blast radius.
Registry-ready metadata lives in server.json with the MCP Registry name
io.github.saagpatel/mcpforge and PyPI package fastmcp-builder. Treat that metadata as
discovery/provenance context, not as proof that generated servers are safe to run without review.
Use as an MCP server
mcpforge is itself an MCP server: point an MCP client (Claude Code, Claude Desktop, Cursor) at it and your agent can forge, validate, and inspect MCP servers inside a conversation. It runs locally over stdio (it writes files into your workspace and calls your model provider on your own key), so it is not offered as a hosted remote.
Add it to a client config (Claude Code shown). generate, update, and plan call the model provider, so set the key in the server env:
Workspace paths are resolved against MCPFORGE_WORKSPACE and confined to it. Note that generate and update write files and incur model-provider cost (roughly $0.05 to $0.30 per call on your key).
Features
- Plain-English generation — describe your server in natural language; Claude writes the implementation
- Complete project scaffold — tools, Pydantic input models, error handling,
pyproject.toml, and a pytest suite generated together - FastMCP 3.x native — output uses modern FastMCP decorators and transport configuration, not raw MCP protocol boilerplate
- Validate before running —
mcpforge validateruns syntax, security, lint, import, and pytest checks against generated servers - Iterate safely —
mcpforge updatemodifies an existing generated server and backs up changed files before writing - Discover generated servers —
mcpforge listfinds mcpforge-generated projects in a workspace - Inspect and diagnose —
mcpforge inspectsummarizes generated server shape, whilemcpforge doctorchecks local readiness - Machine-readable output — status-like commands expose
--jsonfor agent workflows - OpenAPI curation controls — include/exclude tags, operation allowlists, and operation limits keep generated integrations focused
- Scaffold without an LLM —
mcpforge initcreates a minimal FastMCP server skeleton for local iteration - MCP server mode —
mcpforge-serverexposes generation, planning, validation, inspection, doctor, and discovery tools so AI assistants can build safely
More commands
The PyPI distribution is fastmcp-builder; the installed commands are mcpforge and mcpforge-server. Beyond generate:
Useful generation flags:
--dry-rundisplays the structured plan without writing files.--no-executewrites files but skips dependency installation and generated-code execution. Python still reports static syntax, security, and lint results; imports and generated tests do not run. TypeScript also skips type checking and generated tests, and its MCP response reportsvalidation_mode: "write_only"andtests_status: "not_run". Provider-backed planning and code generation may still make API calls. The legacytests_okflag alone does not prove tests ran.--stricttreats Python lint errors as hard validation failures; TypeScript has no lint stage.--from-openapi FILEgenerates from an OpenAPI 3.x spec.--openapi-include-tag TAG,--openapi-exclude-tag TAG,--openapi-operation ID, and--openapi-limit Ncurate OpenAPI conversion.--language python|typescriptchooses the target server language.--auth-profile none|api-key|jwtadds optional Python auth profile metadata and env docs.--middleware-profile logging|timing|rate-limitadds optional Python middleware profiles; repeat it to combine profiles.--provider anthropic|openai|openrouterselects the generation provider.openrouteris the "bring any model" path: setOPENROUTER_API_KEYand pick any OpenRouter model with--model(e.g.--model anthropic/claude-opus-4.8), including free and low-cost ones. Generation quality and structured-output support vary by model — the recommended models are Claude Opus 4.8 (xHigh) and/or GPT 5.5 (High/Extra High). Theopenaipackage is a default dependency (included in all installs) because it backs both--provider openaiand--provider openrouter; setMCPFORGE_ENABLE_OPENAI_PROVIDER=1to enable the direct OpenAI provider for use withOPENAI_API_KEY.
Useful status flags:
mcpforge list --jsonmcpforge inspect PATH --jsonmcpforge validate PATH --jsonmcpforge doctor --jsonmcpforge version --json
mcpforge doctor --json always prints the complete JSON report and exits 0 when
the report's ok is true, or 1 when it is false, matching ordinary doctor.
For Cloud development, use the portable MCP Forge Cloud workflow skill. It covers prepared startup and credential-free checks, continuing an authorized existing PR, and the tested GitHub connector fallback when configured Git transport is blocked, with remote history and tested contents verified before delivery.
Tech Stack
Development setup
The repository pins Python 3.12.15 in .python-version and requires uv 0.13.0 or later. Set up the locked environment and run the full local check with:
make check includes validation of examples/todo-server; on macOS it uses the available sandbox-exec boundary. CI disables that wrapper for the example-validation command because GitHub-hosted runners do not provide it.
Architecture
The generate command sends the user's description to Claude with a structured prompt that includes FastMCP 3.x idioms and a tool-schema contract. Claude returns a JSON plan (tool names, signatures, and descriptions) that mcpforge validates against a Pydantic model before rendering through Jinja2 templates into a complete project directory. The generated project is then validated with syntax checks, security scanning, ruff linting, import checks, and pytest execution. The update command reads an existing generated server, asks Claude for a targeted modification, writes backups for changed files, and validates the result.
Status
Stack
The current package version is 0.3.4, published to PyPI as fastmcp-builder. It adds a fastmcp-builder console-script alias and corrects the registry metadata. Version 0.3.3 added mcpforge demo, the OpenRouter provider, and MCP Registry metadata. The project targets Python 3.12+ and FastMCP 3.x. The repository toolchain pins Python 3.12.15 and requires uv 0.13.0 or later.
Known risks
- Generated code runs during ordinary validation. macOS uses
sandbox-execwhen available; non-macOS validation runs without that sandbox. Review generated code before use. - Python
--no-executeperforms static syntax, security, and lint checks only; imports and generated tests do not run. Static results are not proof of runtime behavior. - The update command currently handles Python servers. TypeScript validation is narrower than the Python validation pipeline and does not use the Python lint or security stages.
- Provider compatibility and deployment readiness depend on the selected provider and environment. See the provider matrix.
Next steps
Use CHANGELOG.md for release history and the provider matrix for hosted-provider readiness before planning release work.
See CHANGELOG.md for the full version history.
License
MIT
来源:README.md,提交 3a27576
工具
0版本历史
1- v0.3.4最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
