mcp-forge
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-forgescaffold a new MCP server project with a hello world tool"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-forge
The FastAPI-style framework for building MCP servers in Python.
Declarative tools. Auto-schema. Type-safe. Production-ready.
Quick Start • Documentation • Examples • Roadmap • Contributing
Why mcp-forge?
Every MCP server you write starts the same way: hand-craft JSON Schema, wire a transport loop, handle notifications/initialized, redirect stderr, copy-paste validation logic. It's the same boilerplate every time.
mcp-forge eliminates all of it. You write a typed Python function. The framework derives the schema from your type hints, validates inputs at runtime, and exposes the tool over any transport — STDIO, HTTP, or SSE — without changing a single line of your logic.
Think of it as the FastAPI moment for MCP servers.
from mcp_forge import Forge
app = Forge(name="my-server", version="1.0.0")
@app.tool(description="Search the knowledge base")
async def search(query: str, limit: int = 10) -> list[dict]:
"""Returns ranked results for the given query."""
... # your logic here
if __name__ == "__main__":
app.run() # STDIO — Claude Desktop / Cursor / VS Code readyNo JSON Schema by hand. No transport boilerplate. No config files.
Related MCP server: Berry MCP Server
⚡ Quick Start
pip install mcp-forge
mcp-forge new my-server && cd my-server
mcp-forge run --reloadConnect to Claude Desktop in 30 seconds:
{
"mcpServers": {
"my-server": {
"command": "python",
"args": ["-m", "my_server"]
}
}
}Switch to HTTP transport with one flag:
mcp-forge run --transport http --port 8080✨ Features
🏗️ Declarative Tools
Define tools as typed Python functions with @app.tool(). No schema files, no registration calls.
🧠 Auto JSON Schema Pydantic v2 under the hood. Full draft-07 JSON Schema generated from your type hints — automatically.
✅ Runtime Validation Inputs validated before execution. Errors surface as proper MCP-spec error responses.
🚀 Multi-Transport STDIO · HTTP · SSE. Switch transports at runtime — your tool code never changes.
⏳ Async-First
async def and def tools work side by side. No event loop management needed.
🔌 Contrib Routers
memory · filesystem · web — production-ready tools, one-line include.
🧪 Testing Client
ForgeTestClient calls tools directly — no running server, no mocking, no sockets.
📦 PEP 561 Typed
Ships py.typed. Full mypy --strict and Pyright support out of the box.
📚 Examples
Minimal server — 3 lines of logic
from mcp_forge import Forge
app = Forge(name="calculator")
@app.tool()
def add(a: float, b: float) -> float:
"""Add two numbers."""
return a + b
@app.tool()
def multiply(a: float, b: float) -> float:
"""Multiply two numbers."""
return a * b
app.run()With contrib tools
from mcp_forge import Forge
from mcp_forge.contrib import memory, filesystem, web
app = Forge(name="agent-tools")
app.include(memory) # remember(), recall(), forget(), list_memory()
app.include(filesystem) # read_file(), write_file(), list_dir(), delete_file()
app.include(web) # fetch_url()
app.run()HTTP transport with custom config
from mcp_forge import Forge, ForgeConfig
app = Forge(
name="api-server",
config=ForgeConfig(
transport="http",
port=8080,
cors_origins=["*"],
max_tool_timeout=30,
),
)
@app.tool()
async def summarize(text: str, max_words: int = 100) -> str:
"""Summarize text to a given word count."""
...
app.run()Unit testing — no server needed
from mcp_forge.testing import ForgeTestClient
client = ForgeTestClient(app)
def test_add():
result = client.call("add", {"a": 2, "b": 3})
assert result == 5
async def test_summarize_async():
result = await client.acall("summarize", {"text": "Hello world"})
assert isinstance(result, str)📐 Architecture
mcp-forge
├── core/
│ ├── forge.py ← Forge class — declarative app entrypoint
│ ├── schema.py ← Auto JSON Schema from Pydantic v2 type hints
│ ├── validator.py ← Input/output validation engine
│ ├── config.py ← ForgeConfig dataclass
│ └── exceptions.py ← MCP-aligned exception hierarchy
├── transports/
│ ├── stdio.py ← STDIO — MCP spec 2024-11-05 compliant
│ ├── http.py ← HTTP — FastAPI-based REST transport
│ └── sse.py ← SSE — Server-Sent Events streaming
├── cli/
│ └── main.py ← Typer CLI — new, run, list, build
└── contrib/
├── memory.py ← Scoped in-process memory store
├── filesystem.py ← Safe filesystem tools with path sandboxing
└── web.py ← HTTP fetch with timeout and error handlingDesign principles:
Transport is a runtime concern — your tool code never changes between STDIO, HTTP, and SSE
Schema is derived, never written — if your types are correct, your schema is correct
Contrib is opt-in —
app.include(memory)adds tools; you stay in controlStrict by default — mypy strict, ruff format + lint, 100% typed public API
🌍 Ecosystem Compatibility
Client | Transport | Status |
Claude Desktop | STDIO | ✅ Tested |
Cursor | STDIO | ✅ Tested |
VS Code (GitHub Copilot) | STDIO · HTTP | ✅ Tested |
Continue.dev | HTTP · SSE | ✅ Tested |
Custom LLM agents | HTTP · SSE | ✅ Tested |
📦 Installation
# Core only (STDIO transport)
pip install mcp-forge
# With HTTP + SSE transports
pip install "mcp-forge[http]"
# Everything
pip install "mcp-forge[all]"Requires: Python 3.11+ · pydantic>=2.0
🤝 Contributing
Contributions are welcome. See CONTRIBUTING.md for the full guide.
git clone https://github.com/nsfwbunny/mcp-forge
cd mcp-forge
pip install -e ".[dev]"
pytest🐛 Found a bug? → Open an issue
💡 Have an idea? → Start a discussion
📜 See what's planned → ROADMAP.md
Built by Benni Alencar · Part of the Benni OS open-source ecosystem
If mcp-forge saves you time, consider giving it a ⭐
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
- Flicense-qualityDmaintenanceA production-ready MCP server built with FastAPI, providing an enhanced tool registry for creating, managing, and documenting AI tools for Large Language Models (LLMs).Last updated34
- Alicense-qualityDmaintenanceA universal framework for creating and deploying custom Model Context Protocol (MCP) tool servers with decorator-based tool registration, supporting multiple transports and automatic JSON schema generation for AI assistants.Last updated1MIT
- AlicenseBqualityDmaintenanceA Python library to build MCP servers with decorators, auto-generating JSON Schema from type hints and including built-in filesystem and HTTP servers.Last updated3MIT
- Flicense-qualityDmaintenanceA Python-based MCP server that exposes tools over streamable HTTP using FastAPI, enabling connection to AI assistants like Cursor. Supports multiple servers mounted in a single FastAPI app.Last updated
Related MCP Connectors
Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
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/benni-os/mcp-forge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server