Coderift MCP Server
MCP server for managing customer feature requests with role-based approvals, elicitation for high-impact changes, and support for notifications, sampling, and progress tracking. Enables employees to review, prioritize, and approve requests without direct database access.
README
Coderift MCP Project
Overview
Coderift Technologies is a B2B software company. Customers submit feature requests continuously, and internal employees need to review, prioritize, and approve them without touching the production database directly. This project is an MCP server sitting in front of that database, plus a client that talks to it through the protocol instead of raw SQL.
The Problem
Before this system, support agents queried the database directly (or asked an engineer to) whenever a customer asked about a request's status, and a product manager approved requests from a spreadsheet with no audit trail and no check on how many customers a change actually affected. Two things made this risky enough to justify a real protocol-aware server instead of a thin CRUD wrapper:
- Approvals are not all equal. Approving a request that affects 800 customers is a different decision than approving one that affects 40. The naive version either lets any agent approve anything, or hard-codes a blanket rule that ignores context. We wanted a manager to have to explicitly sign off on high-impact approvals, live, not just trust a role field the caller sends us.
- Roles change mid-session. A support agent gets promoted to product manager during their shift (or a manager is filling in). The tool set available to them should change the moment that happens, not after they reconnect.
Those two facts are what justify elicitation and notifications in this system, not a rule bolted on for the assignment. Report generation over the full pending-request backlog is also genuinely slow-ish and benefits from progress feedback instead of a blocking call.
Database & ERD
Engine: SQLite (db/coderift.db, built from db/schema.sql +
db/seed.sql via db/create_db.py).

Tables: customers, employees, feature_requests (FK to customers),
approvals (FK to feature_requests and employees, for a future audit
trail). Seed data covers both roles, all three statuses (Pending,
Approved, Rejected), and both sides of the 500-customer elicitation
threshold (a 40-customer request, a 500-customer boundary case, and an
800-customer request).
Project Structure
coderift-mcp/
├── db/
│ ├── schema.sql
│ ├── seed.sql
│ ├── create_db.py
│ ├── ERD.png
│ └── coderift.db (generated)
├── mcp_server/
│ ├── server.py
│ └── models.py
├── agent/
│ └── client.py
├── requirements.txt
└── README.md
Installation
python -m venv .venv
source .venv/bin/activate # .venv\Scripts\activate on Windows
pip install -r requirements.txt
python db/create_db.py
Running
# server, local development
cd mcp_server
python server.py # stdio (default)
python server.py --transport streamable-http --port 8000 # remote
# agent, in a second terminal
cd agent
python client.py # stdio, spawns server.py itself
python client.py --http http://127.0.0.1:8000/mcp # against a running HTTP server
Set ANTHROPIC_API_KEY before running the agent to have the sampling
callback use a real model; otherwise it uses a labeled stub response so
the demo still runs end to end.
Where each protocol concern lives
| Concern | File / function |
|---|---|
| Capability negotiation | server.py: CoderiftMCP._init_options declares tools.listChanged=True. client.py: run_demo reads init.capabilities.tools.listChanged before assuming notifications will arrive. |
| Notifications | server.py: promote_to_manager calls ctx.session.send_tool_list_changed() after verifying the employee against the employees table. client.py: make_notification_handler reacts to ToolListChangedNotification. |
| Elicitation | server.py: approve_feature_request calls ctx.elicit(...) when affected_customers > 500, gated behind has_capability(ctx, elicitation=True). client.py: elicitation_callback prompts a human and returns accept/decline. |
| Sampling | server.py: generate_feature_analysis calls ctx.session.create_message(...) for the written risk recommendation, gated behind has_capability(ctx, sampling=True). client.py: sampling_callback answers using the client's own model. |
| Resources | server.py: policy://feature-prioritization, policy://approval-guidelines, policy://release-guidelines, fetched via resources/read, never wrapped in a tool. |
| Prompts | server.py: draft_feature_summary, draft_rejection_email, customer_feature_update. |
| Transport | server.py __main__ accepts `--transport stdio |
| Progress tracking | server.py: generate_impact_report calls ctx.report_progress(...) at five real milestones while it scans pending requests. client.py passes a progress_callback to call_tool. |
| Defensive tool design | models.py: every write tool takes a single Pydantic model with extra="forbid", Field(gt=0), and Literal enums. server.py: change_priority and approve_feature_request re-validate server-side and check get_role(ctx) — a role read from server-held session state, never a client-supplied parameter. |
Comparison note
| Tool | Read/Write | Requires elicitation | Notes |
|---|---|---|---|
get_feature_request |
Read | No | |
list_customer_requests |
Read | No | |
search_knowledge_base |
Read | No | BM25 over titles/descriptions |
approve_feature_request |
Write | Conditional — only when affected_customers > 500 |
Falls back to an explanatory error if the client lacks elicitation support, instead of silently approving or hanging |
change_priority |
Write | No | Role-gated only |
generate_impact_report |
Read (long-running) | No | Progress-tracked |
generate_feature_analysis |
Read | No | Uses sampling if available; deterministic rule-based fallback otherwise |
promote_to_manager |
Write (session state) | No | Verified against employees table server-side |
If a client connects without elicitation support, approve_feature_request
refuses to silently approve a high-impact request — it returns a structured
elicitation_unsupported error explaining that a manager needs to approve
it out of band. If a client connects without sampling support,
generate_feature_analysis still returns a usable (if less nuanced)
rule-based risk rating instead of failing.
Transport choice, justified
Development happens over stdio — no server process to manage, easy to
run from the agent script directly, matches how one developer iterates
locally. server.py also runs over Streamable HTTP (--transport streamable-http), which is the right choice once Coderift's own product
managers across multiple offices need to hit the same server concurrently
instead of each spawning their own local process — a single deployed HTTP
endpoint sits behind normal auth/network controls, which stdio can't do.
Both paths share the same tool/resource/prompt code; only the transport
layer changes.
Demonstration Workflow
agent/client.py runs, in order: initialize + capability check, list
tools as a support_agent, an unauthorized change_priority attempt,
promote_to_manager (real employee lookup + real notification), tool list
re-fetch showing the unlocked write tools, generate_impact_report with
live progress, approve_feature_request on an 800-customer request
(elicitation fires) and a 40-customer request (it doesn't), sampling-backed
generate_feature_analysis, change_priority, a resource read, and a
prompt fetch.
Where it stands now
Session role state lives in a process-local dict keyed by session id,
which is fine for the stdio demo and a single-process HTTP deployment but
wouldn't survive a restart or a multi-instance deployment — a production
version would move that to a signed session token or a real auth layer
instead. The approvals table exists in the schema for an audit trail but
isn't written to yet; that'd be the next addition, along with a director
review tier for requests over 1000 affected customers as described in the
approval-guidelines resource.
Technologies Used
Python, MCP Python SDK (mcp), SQLite, Pydantic, rank_bm25.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。