Enterprise MCP Server
Production-grade FastMCP 3.x server template for scalable semantic tool retrieval, dynamic providers, paginated tool lists, and role-based progressive disclosure.
README
Enterprise MCP Server
Production-grade FastMCP 3.x server template built for teams that need to scale: semantic tool retrieval, dynamic providers, parameterised resource templates, paginated tool lists, session-scoped role unlocking, middleware, and full auth.
Architecture
server.py ← entry point — assembles everything
config/settings.py ← ALL configuration ← EDIT THIS FIRST
│
├── providers/ FastMCP 3.0 Dynamic Providers
│ └── registry.py FileSystemProvider · OpenAPIProvider · ProxyProvider
│
├── transforms/ FastMCP 3.0 Transforms (middleware for providers)
│ └── pipeline.py PrefixTransform · VersionFilter · TagFilter
│
├── tools/
│ ├── meta_tools.py search_tools (Search Transform) · unlock_role (progressive disclosure)
│ └── example_tools.py ← template for your own tools; drop files here
│
├── resources/
│ └── templates.py Parameterised URIs: enterprise://tables/{name}/schema
│
├── middleware/
│ └── stack.py Logging · RateLimiting · ResponseLimiting · Caching
│
├── auth/
│ └── setup.py JWT · OAuth 2.1 · Bearer
│
└── utils/
├── lifespan.py Startup / shutdown hooks
└── otel.py OpenTelemetry tracing
FastMCP 3.x Scale Features Used
| Feature | Where | Config key |
|---|---|---|
Pagination (list_page_size) |
server.py |
LIST_PAGE_SIZE |
| Dynamic Providers | providers/registry.py |
PROVIDERS |
| Search Transforms (meta-tool) | tools/meta_tools.py |
SEMANTIC_SEARCH |
| Resource Templates | resources/templates.py |
RESOURCE_TEMPLATES |
| Session State + progressive disclosure | tools/meta_tools.py |
ROLE_GATES |
| Component Versioning | tools/example_tools.py |
VERSIONING |
| Tag-based visibility | transforms/pipeline.py |
ROLE_GATES |
| Background Tasks | tools/example_tools.py |
BACKGROUND_TASKS |
| Returnable errors | tools/example_tools.py |
— |
| OpenTelemetry | utils/otel.py |
OTEL |
Quickstart
# 1. Install
pip install fastmcp>=3.4.1 httpx
# 2. Configure
# Open config/settings.py and fill every <CONFIGURE> marker.
# 3. Run (development — hot reload)
fastmcp dev server.py
# 4. Run (production)
python server.py
Optional extras
pip install fastmcp[tasks] # background tasks via Docket
pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http # OTEL
How to Add Your Own Tools
Drop a .py file into tools/ with a local mcp = FastMCP(...) instance and
decorate your functions. FileSystemProvider picks them up automatically
(set PROVIDERS.filesystem.reload = True for zero-restart hot-reload).
# tools/my_api_tools.py
from fastmcp import FastMCP, Context
mcp = FastMCP("my-api")
@mcp.tool(tags={"data", "read"}, version="1.0")
async def get_report(report_id: str, ctx: Context) -> dict:
"""Fetch an enterprise report by ID."""
# ... your implementation
return {}
Sensitive tools? Add tags={"admin"} (or any key in ROLE_GATES) and they
are hidden from the default tool list. Clients call unlock_role("admin")
after authenticating to reveal them for their session.
Semantic Search Flow
LLM calls search_tools(query="show me revenue by region")
│
▼
Your retrieval API (SEMANTIC_SEARCH.api_base_url)
│
▼
Top-K tools above score_threshold returned to LLM
│
▼
LLM calls the specific tool it needs
The LLM never receives the full tool catalog — only the relevant subset.
Pagination Flow
Client sends tools/list (no cursor)
│
▼
Server returns page 1 (LIST_PAGE_SIZE items) + nextCursor
│
▼
Client sends tools/list?cursor=<nextCursor>
│
▼
... repeat until nextCursor is null
fastmcp.Client.list_tools() handles this automatically.
Use list_tools_mcp(cursor=...) for manual control.
Testing
pip install pytest pytest-asyncio
pytest tests/
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。