HoPe Chatbot MCP Server
HoPe Chatbot MCP Server
使用 FastMCP v3。
出于代码组织的考虑,MCP 功能被拆分为多个逻辑模块,即 MCP 子服务器。
主 MCP 服务器可以导入/挂载子域 MCP 服务器(mcp_server/app.py)。
开发
将你的能力拆分成可组合的 MCP 服务器。
定义新的 MCP 工具、资源、提示词...
用于 <some> 领域
用于 <some> 业务能力
在 <some> MCP 子服务器中
在 mcp_server/servers/<some>/mcp.py 中。
公开 MCP 服务器能力
决定你希望你的 MCP 工具、资源、提示词... 以何种方式可用:
在一个组合式 MCP 服务器(一体化)中 🌐
仅作为独立的 MCP 服务器 🔒🪪
两者兼有 ✨
一体化 MCP 服务器
将子域 MCP 服务器包含到组合式 MCP 服务器中。
在 mcp_server/app.py 中按以下步骤操作:
导入你的 FastMCP 应用
from mcp_server.servers.some import some_mcp找到已定义的主 MCP 服务器,在主 MCP 服务器的启动/初始化生命周期阶段,将你的 MCP 服务器的能力添加到主 MCP 服务器中
async def setup(app: FastMCP): # Import or mount subservers app.mount(some_mcp) # dynamic mount # await app.import_server(some_mcp) # static copy @contextlib.asynccontextmanager async def lifespan(app: FastMCP): # Setup await setup(app) yield # Cleanup main_mcp = FastMCP( name="home-of-performance-mcp-server", lifespan=lifespan )主组合式 MCP 服务器在
BASE_URL/mcp处包含你的 MCP 服务器的能力。对于主组合式 MCP 服务器,以下所有运行场景均应成立:
mcp_server/app.py作为模块运行FastMCP.run 方法
mcp_server/app.py通过 uvicorn 运行FastMCP.http_app将你的 MCP 服务器的 ASGI 应用挂载到 FastAPI 应用,uvicorn 访问 FastAPI 的 ASGI 应用
(uvicorn 直接访问 FastMCP 的 ASGI 应用也可正常工作)
独立的 MCP 服务器
公开独立的子域 MCP 服务器。
在 mcp_server/app.py 中按以下步骤操作:
导入你的 FastMCP 应用
from mcp_server.servers.some import some_mcp从你的 FastMCP 应用创建 ASGI 应用
(无需重新定义
path="/mcp"关键字参数)some_mcp_app = some_mcp.http_app()将你的 FastMCP 应用的生命周期添加到 FastAPI 应用使用的组合生命周期中
@contextlib.asynccontextmanager async def combined_lifespan(app: FastAPI): """Combine lifespans for FastAPI app""" # Run all lifespans async with main_mcp_app.lifespan(app): async with some_mcp_app.lifespan(app): # Setup yield # Cleanup fastapi_app = FastAPI( title="Home of Performance MCP", lifespan=combined_lifespan )将你的 MCP 服务器的 ASGI 应用挂载到 FastAPI 应用的
/some路径下fastapi_app.mount("/some", some_mcp_app)在
BASE_URL/some/mcp处找到你的独立 MCP 服务器
Related MCP server: Golf
本地运行
根据
.env.template在.env中定义环境变量(不要提交密钥)通过
requirements.txt安装必需的 Python 包通过
run方法启动 FastMCP 应用python -m mcp_server.app或者通过 gunicorn、uvicorn 等运行挂载了 MCP 服务器的 FastAPI 应用:
source .venv/bin/activate && uvicorn src.app:app --host 0.0.0.0 --port 8000 --reload
This server cannot be deployed
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Search, vet & assemble MCP servers from your agent: verified tools, risk labels, and trust scores.
Capability registry for the agentic economy. Semantic search over verified MCP server listings.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables dynamic loading, hot-reloading, and orchestration of MCP servers without restarting Claude Code, allowing programmatic tool calling and workflow automation across multiple servers.2-
- AlicenseNot gradedqualityCmaintenanceEasiest framework for building MCP servers with automatic discovery of tools, prompts, and resources, plus enterprise-grade authentication and telemetry.841Apache 2.0

Fluent MCPofficial
AlicenseNot gradedqualityDmaintenanceEnables building MCP servers with embedded reasoning, allowing complex tasks to be offloaded to an internal LLM for token and cost efficiency.2MIT- AlicenseNot gradedqualityDmaintenanceAggregates multiple MCP servers into a single endpoint, enabling LLM clients to access tools, resources, and prompts from various backends through one connection.7 npmMIT