Generate complete, runnable FastMCP 3.x MCP servers from plain-English descriptions
Project description
mcpforge
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
You need Python 3.12+, uv, and an Anthropic API key.
uv tool install fastmcp-builder # or: pip install fastmcp-builder
export ANTHROPIC_API_KEY="your_anthropic_api_key"
mcpforge generate "A weather server that returns today's forecast for a city" -o weather-server
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:
# weather-server/server.py (excerpt)
"""Weather forecast MCP server."""
from fastmcp import FastMCP
mcp = FastMCP("Weather")
# Illustrative lookup — describe a real source and mcpforge wires the call for you.
_FORECASTS: dict[str, dict] = {
"san francisco": {"high_c": 18, "low_c": 12, "summary": "Foggy"},
"denver": {"high_c": 24, "low_c": 9, "summary": "Clear"},
}
@mcp.tool
async def get_forecast(city: str) -> dict:
"""Return today's forecast for a city."""
key = city.strip().lower()
if key not in _FORECASTS:
raise ValueError(f"No forecast available for {city!r}")
return {"city": city, **_FORECASTS[key]}
if __name__ == "__main__":
mcp.run(transport="streamable-http")
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:
cd weather-server
uv run server.py # start the server (streamable-http)
uv run pytest -v # run the generated tests
mcpforge validate . # re-run the full validation suite anytime
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-permission-audit on PyPI). They're two halves of one workflow — forge a server, then audit what your agents can actually touch before you trust it.
| Stage | Tool | What it does |
|---|---|---|
| Build | mcpforge |
Generate a complete, tested MCP server from one sentence. |
| Audit | mcp-audit |
Scan every MCP server wired into your machine and risk-score what each one can reach. |
# build
mcpforge generate "A weather server that returns today's forecast for a city" -o weather-server
# audit everything your agents can reach (read-only, no install needed)
uvx --from mcp-permission-audit mcp-audit scan --ssrf-check
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.
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:
# Generate a new MCP server
mcpforge generate "A todo list manager with create, read, update, and delete operations"
# Validate an existing generated server
mcpforge validate ./my-server
# Modify an existing generated server
mcpforge update ./my-server "Add a tool to export todos as CSV"
# Find generated servers in the current workspace
mcpforge list . --recursive
# Inspect a generated server without executing it
mcpforge inspect ./my-server
# Check local prerequisites and provider readiness
mcpforge doctor
Useful generation flags:
--dry-rundisplays the structured plan without writing files.--no-executewrites files but skips import and test execution.--stricttreats lint errors as hard validation failures.--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|openaiselects the generation provider. OpenAI remains gated by default; setMCPFORGE_ENABLE_OPENAI_PROVIDER=1only for opt-in smoke testing afterOPENAI_API_KEYis available.
Useful status flags:
mcpforge list --jsonmcpforge inspect PATH --jsonmcpforge validate PATH --jsonmcpforge doctor --jsonmcpforge version --json
Tech Stack
| Layer | Technology |
|---|---|
| Language | Python 3.12+ |
| Generation | Anthropic Claude via anthropic SDK; OpenAI provider support is gated behind hosted smokes |
| MCP framework | FastMCP 3.x |
| CLI | Click 8 |
| Templates | Jinja2 |
| Validation | Pydantic v2 |
| Output | Rich |
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.
Current Status
mcpforge is published to PyPI as the fastmcp-builder distribution. The v0.3 builder lane expands mcpforge from runnable-server generation into a production integration builder with inspection, doctor checks, richer generated scaffolds, OpenAPI curation, MCP server parity, provider abstraction, remote MCP readiness docs, and live generated fixture examples for REST API, filesystem, database, authenticated OpenAPI, and TypeScript profiles. See docs/CURRENT-STATE.md, docs/ROADMAP-v0.3.md, and docs/PROVIDER-MATRIX.md.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastmcp_builder-0.3.2.tar.gz.
File metadata
- Download URL: fastmcp_builder-0.3.2.tar.gz
- Upload date:
- Size: 54.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb9d3b96f004b12d6bff22d052754352ce9c081eba0037e1e6cf45a08ec8e5b9
|
|
| MD5 |
affc9bcde8a27d2e4478beadcee53974
|
|
| BLAKE2b-256 |
a5febf916a36cecdab278f3c4be0d3fddb674a8bd2dcbc0924122414c857c9ff
|
Provenance
The following attestation bundles were made for fastmcp_builder-0.3.2.tar.gz:
Publisher:
publish.yml on saagpatel/mcpforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastmcp_builder-0.3.2.tar.gz -
Subject digest:
fb9d3b96f004b12d6bff22d052754352ce9c081eba0037e1e6cf45a08ec8e5b9 - Sigstore transparency entry: 1881993283
- Sigstore integration time:
-
Permalink:
saagpatel/mcpforge@92268ad0ebcaeeb84f3d27cd6880b7df012f1048 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/saagpatel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92268ad0ebcaeeb84f3d27cd6880b7df012f1048 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fastmcp_builder-0.3.2-py3-none-any.whl.
File metadata
- Download URL: fastmcp_builder-0.3.2-py3-none-any.whl
- Upload date:
- Size: 73.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71c768ea4490a5ad9260a9f15d25c28dcfbebd615790fd0023e88973065becd1
|
|
| MD5 |
f1a8dee481f91670e50da5d9e6be8946
|
|
| BLAKE2b-256 |
cc8c11620074f47541f26a997eaae850c1b967f9ca86b1dd0e225192877427ac
|
Provenance
The following attestation bundles were made for fastmcp_builder-0.3.2-py3-none-any.whl:
Publisher:
publish.yml on saagpatel/mcpforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastmcp_builder-0.3.2-py3-none-any.whl -
Subject digest:
71c768ea4490a5ad9260a9f15d25c28dcfbebd615790fd0023e88973065becd1 - Sigstore transparency entry: 1881993378
- Sigstore integration time:
-
Permalink:
saagpatel/mcpforge@92268ad0ebcaeeb84f3d27cd6880b7df012f1048 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/saagpatel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92268ad0ebcaeeb84f3d27cd6880b7df012f1048 -
Trigger Event:
push
-
Statement type: