fastmcp-endpoint-toolsets
A single FastMCP server that exposes multiple URL-scoped tool groups, allowing agents to access only relevant tools via separate endpoints, reducing context bloat and token costs.
README
FastMCP Endpoint Toolsets
Stop shipping one giant MCP tool surface to every agent.
The missing FastMCP starter for URL-scoped native MCP toolsets: one server, one port, many focused endpoints.
fastmcp-endpoint-toolsets gives you a clean packaging pattern for tool-bloat-free MCP servers: keep your tools in one FastMCP server, but expose each tool group through its own native MCP URL.
/mcp -> all tools
/json/mcp -> JSON tools only
/db/mcp -> database tools only
/docs/mcp -> documentation tools only
/text/mcp -> text tools only
/math/mcp -> math tools only
/time/mcp -> time tools only
Point an agent at /math/mcp and it sees only the math tools. Point it at /mcp and it sees everything. Same process, same port -- and every URL is native FastMCP Streamable HTTP. No proxy. No gateway. No fleet of tiny servers. No custom REST wrapper.
Why it matters
Once a server has 50+ tools, every agent gets all of them in its prompt -- context bloats, token cost climbs, and tool-selection accuracy drops. Endpoint Toolsets keep the deployment simple while keeping each agent's tool surface focused:
- Focused context -- each agent loads only its toolset, not your entire catalog.
- One deploy -- one server, one port, one container for all your tool code.
- Zero extra infra -- nothing to run or secure between the agent and your tools.
- Add a tool in ~5 lines -- drop a file in
tools/, register it once, and a new endpoint appears.
How it's different
Every row below is a valid pattern. This project fills the gap in the bottom one.
| Approach | Deploys / ports | Tool surface per agent | Extra moving parts |
|---|---|---|---|
| One big FastMCP server | 1 | All tools, always | None |
FastMCP mount() / import_server() |
1 | All tools (name-prefixed) at one URL | None |
| Tag filtering per client | 1 | Filtered, but configured client-side | None |
| N separate MCP servers | N | Scoped | N processes / ports / containers |
| MCP gateway / proxy | 1+ | Scoped, routes to external servers | A gateway to run and secure |
| Endpoint Toolsets (this repo) | 1 | Scoped, per URL, server-side | None |
Scoping here is per-endpoint context isolation -- each group is its own FastMCP instance with its own tool registry. Everything runs in one process.
Quick start
cd fastmcp_endpoint_toolsets
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python server.py
Open the dashboard at http://127.0.0.1:8001, or connect any MCP client:
http://127.0.0.1:8001/mcp # all tools
http://127.0.0.1:8001/json/mcp # json only
http://127.0.0.1:8001/math/mcp # math only
http://127.0.0.1:8001/text/mcp # text only
http://127.0.0.1:8001/time/mcp # time only
Prefer containers? One image, one port, every endpoint behind it:
docker compose up --build
Podman:
podman build/podman runwork unchanged. Its default OCI format ignores theHEALTHCHECKline -- add--format dockertopodman buildto keep it.
Built-in dashboard
Dynamic UI to see existing tools!
http://127.0.0.1:8001 serves a zero-dependency web UI that reads /toolsets live and shows every endpoint, its tools, and its tags at a glance -- the fastest way to confirm exactly what each agent will see.
GET / -> this dashboard
GET /health -> health check
GET /toolsets -> JSON discovery of every endpoint + its tools
See it in MCP Inspector
Want proof the scoping is real? With the server running:
npx @modelcontextprotocol/inspector
Set Transport to Streamable HTTP, connect to http://127.0.0.1:8001/json/mcp, and List Tools -- you'll see only the JSON tools. Switch the URL to /math/mcp and you'll see only math tools. Same server, same port -- a focused surface at every URL.
Full walkthrough in USAGE.md.
Add a toolset
# tools/docs_tools.py
from fastmcp import FastMCP
def register(mcp: FastMCP) -> None:
@mcp.tool()
def docs_search(query: str) -> list[str]:
"""Search docs."""
return [f"Result for {query}"]
# registry.py -- add one entry to TOOLSETS
Toolset(name="docs", title="Docs Toolset",
description="Documentation search tools.",
tags=("docs", "search"), register=docs_tools.register),
Restart the server and /docs/mcp is live. Full guide in USAGE.md.
What it is / isn't
It is: native endpoint toolsets from a single FastMCP server -- a clean base to fork, rename, and build your own MCP server on.
It isn't: an MCP proxy, an MCP gateway, a REST API in MCP clothing, or a bridge to external MCP servers. In-process, by design.
Documentation
- USAGE.md -- mental model, MCP Inspector, Docker, project layout, adding toolsets
- CONTRIBUTING.md -- dev setup, running tests, and how to contribute
License
MIT -- fork it, rename it, ship it.
<sub>Keywords: FastMCP endpoint toolsets, MCP endpoint toolsets, scoped MCP endpoints, per-agent MCP tools, grouped MCP tools, one server one port MCP, multi endpoint MCP server, native MCP tool groups, reduce MCP tool context, FastMCP Streamable HTTP, MCP server template, tool-bloat-free MCP.</sub>
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。