User MCP Server
Click on "Deploy 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., "@User MCP Servershow me my latest bills"
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.
User MCP Servers
Streamable HTTP MCP Server:通过 HTTP 调用独立的 User REST API(my-user-service),覆盖 MCP 三要素(Tools / Resources / Prompts)。
本仓库 不包含 FastAPI / SQLite / JWT 实现。MCP 只依赖 API_BASE_URL。
架构
┌──────────────────────┐ HTTP /mcp ┌──────────────────────┐
│ MCP Client │ ──────────────────────────▶ │ MCP Server :3001 │
│ (Cursor / Inspect) │ │ Streamable HTTP │
└──────────────────────┘ └──────────┬───────────┘
│ httpx
▼
┌──────────────────────┐
│ User REST API :8000 │
│ (my-user-service) │
└──────────────────────┘Related MCP server: Tripleshot MCP Server
快速开始
先启动 API(另一个仓库):
cd /Users/jasqia/00D_PythonProject/my-user-service
source .venv/bin/activate
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload再启动 MCP:
cd /Users/jasqia/00D_PythonProject/my-mcp-servers
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # 可选;默认 API_BASE_URL=http://127.0.0.1:8000
python -m mcp_server或一条命令拉起两边(API 目录默认同级的 ../my-user-service):
./scripts/start_services.sh
# 自定义 API 仓库路径:
# USER_SERVICE_ROOT=/path/to/my-user-service ./scripts/start_services.shMCP 端点:http://127.0.0.1:3001/mcp
REST 文档:http://127.0.0.1:8000/docs
端口被占用(Address already in use)
启动时如果看到:
ERROR: [Errno 48] error while attempting to bind on address ('127.0.0.1', 3001): [errno 48] address already in use说明 3001 已被占用(拆仓后常见原因:旧仓库 my-mcp 里残留的 python -m mcp_server 还在跑)。
查出占用进程:
lsof -nP -iTCP:3001 -sTCP:LISTEN输出里的 PID 就是占用端口的进程号,例如:
COMMAND PID USER FD TYPE ...
Python 83386 jasqia ... TCP 127.0.0.1:3001 (LISTEN)确认是哪个项目(可选):
ps -p <PID> -o pid,command=停掉该进程后重试启动:
kill <PID>
# 若未退出:kill -9 <PID>
python -m mcp_server确认端口已空闲:
lsof -nP -iTCP:3001 -sTCP:LISTEN || echo "port 3001 is free"如果不想停旧进程,也可以换端口:
MCP_PORT=3002 python -m mcp_serverCursor / Inspect 需改连 http://127.0.0.1:3002/mcp。API :8000 被占用时,处理方式见 my-user-service README。
MCP 三要素
Tools
用户
register_user/login_user/get_current_user/update_user_profile
账单
create_bill/list_my_bills/list_shared_bills/get_billupdate_bill/delete_billshare_bill/unshare_billlike_bill/unlike_bill
Resources
user://api/health— API 健康检查user://docs/overview— 项目说明user://profile/{access_token}— 当前用户资料bill://mine/{access_token}— 我的账单列表bill://shared/{access_token}— 分享给我的账单bill://item/{access_token}/{bill_id}— 单条账单
Prompts
welcome_new_user— 欢迎新用户help_update_profile— 协助更新资料help_create_bill— 协助记账help_share_bill— 协助分享账单help_like_bill— 协助点赞
Cursor 连接(Streamable HTTP)
{
"mcpServers": {
"user-mcp": {
"url": "http://127.0.0.1:3001/mcp"
}
}
}本地验证
source .venv/bin/activate
pip install -r requirements-dev.txt # 首次需要
# 单元 / 协议测试(不需要先起 API)
make test
# make test-e2e # L4 真 Streamable HTTP
# 手工 E2E 冒烟(需 API + MCP 都已启动)
python scripts/test_mcp_user_client.py
python scripts/test_mcp_bill_client.py测试分层说明:docs/MCP_L2_L4_EXPLAINED.zh.md
Inspect 评测
先启动 API + MCP,再:
pip install -r requirements-inspect.txt
export GOOGLE_API_KEY='...'
./scripts/run_inspect_gemini.sh google/gemini-3.6-flash evals/bill_mcp_scenarios.py
./scripts/run_inspect_gemini.sh google/gemini-3.6-flash suite
# 无 API Key:用 mockllm 本地验证 Inspect→MCP 接线
python scripts/run_inspect_user_mcp_smoke_mock.py目录结构
my-mcp-servers/
├── mcp_server/ # Streamable HTTP MCP Server
│ ├── config.py # MCP_HOST / MCP_PORT / API_BASE_URL
│ ├── __main__.py # python -m mcp_server
│ └── server.py # Tools / Resources / Prompts
├── tests/mcp/
├── evals/ # Inspect 评测
├── scripts/
├── docs/
├── Makefile
├── pytest.ini
├── requirements.txt
└── README.mdThis server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
- UnifAPIOAuthcom.unifapi
Hosted MCP server for live public-data APIs and Skills for AI agents.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA stateless HTTP-based protocol for building MCP-compatible servers. Enables easy creation of tools, resources, and prompts using RESTful conventions.-
- FlicenseNot gradedqualityDmaintenanceStreamable HTTP MCP server that fronts api.tripleshot.ai, enabling AI clients to search, fetch, and render prompts from the Tripleshot prompt library.-
- AlicenseNot gradedqualityBmaintenanceTwitter/X MCP server for the API v2, enabling users to manage profiles, posts, likes, retweets, and follows through natural language using a stateless Streamable HTTP transport with OAuth user access token authentication.8 npmISC
- FlicenseNot gradedqualityCmaintenanceRemote MCP server for Mini Accountant that lets AI assistants manage invoices, customers, expenses, services, payment settings, analytics, and account/profile data via OAuth 2.1-secured streamable HTTP.-