MCP上线服务(POC)
在Intility,提供一项概念验证服务,用于捕获、存储和审查MCP服务器上线报告。
这是什么?
这个概念验证(POC)验证了一个完整的流程:
- 开发者 使用(相关工具/方法)完成MCP上线检查清单
mcp-go-live在Claude代码方面的技能 - 开发者 通过(某种方式)提交生成的报告
submit_report()MCP工具 - 平台团队 通过以下方式审阅并批准/拒绝:
- 网页用户界面(Web UI) (React 前端) - 可视化仪表板和报告查看器 - MCP工具 list_servers() - 在Claude代码中 - API - 直接HTTP调用
建筑
┌─────────────┐
│ Developer │
│ Claude Code │
└──────┬──────┘
│ MCP Go-Live Skill
│ (generates report)
▼
┌─────────────────┐
│ MCP Server │ submit_report()
│ (Python) │ ────────────────► ┌──────────────┐
└─────────────────┘ │ Rust API │◄──── Platform Team
│ (Axum) │ (Web UI)
└──────┬───────┘ │
│ │
▼ ▼
┌──────────────┐ ┌─────────────┐
│ PostgreSQL │ │ React App │
└──────────────┘ │ (Bifrost) │
└─────────────┘组件
| 组件 | 技术 | 目的 |
|---|---|---|
| 前端/ | React + Vite + Bifrost | 报告审查的Web用户界面 |
| rust-api/(可译为“Rust API 目录/项目/等”,具体根据上下文确定,此处保留原样以展示原文格式) Rust + Axum | 用于CRUD操作的HTTP API | |
| mcp-server/(可译为:“MCP服务器/” 或保持原样,若“mcp-server”为特定名称或项目名) | Python + uv | MCP 工具(提交,列出) |
| PostgreSQL(中文常译为“波斯特格瑞斯数据库”或直接使用原名“PostgreSQL”,因其已成为一个广泛认知的数据库管理系统名称) | 数据库 | 存储报告 |
快速入门
先决条件
- Rust(通过
rustup) - Python 3.11及以上版本
- Node.js 18及以上版本
- 紫外线 (
pip install uv或者brew install uv) - Docker
- just (
cargo install just或者brew install just)
选项1:使用Justfile(推荐)
# One-time setup
just setup
# Start all services (API + Frontend)
just start-all
# Or start individually
just run-api # Start API only
just run-frontend # Start frontend only
# Check status
just status
# Test the workflow
just test-workflow
# Stop services
just stop-all接入点:
- 前端:http://localhost:5173
- API: http://localhost:8080
- 数据库:localhost:5433
选项2:手动设置
# 1. Start PostgreSQL
docker run -d --name golive-postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=golive \
-p 5433:5432 \
postgres:16-alpine
# 2. Start Rust API
cd rust-api
export DATABASE_URL="postgres://postgres:password@localhost/golive"
cargo run
# Running on http://localhost:8080
# 3. Start Frontend (in new terminal)
cd frontend
npm install
npm run dev
# Running on http://localhost:5173
# 4. Start MCP Server (in new terminal)
cd mcp-server
uv sync
export API_BASE_URL="http://localhost:8080/api/v1"
uv run python -m mcp_golive.server
# 5. Test
curl http://localhost:8080/healthz
# Open http://localhost:5173 in browserMCP 工具
submit_report()
提交一份完整的上线报告。
{
server_name: string,
repository_url: string,
developer_email: string,
report_markdown: string
}list_servers(status)
列出已提交的服务器以供审核。
{
status?: "pending_review" | "approved" | "rejected" | "all"
}API 端点
| 方法 | 终点 | 目的 | ||
|---|---|---|---|---|
| POST | (通常用于网络编程中,表示一种HTTP请求方法,即“提交”或“发送”请求) /api/v1/reports | 提交报告 | ||
| GET | (译文: | 获取 | ) /api/v1/reports | 列出报告 |
| GET | /api/v1/reports/{id} | 获取报告详情 | ||
| 补丁 | /api/v1/reports/{id}/status | 批准/拒绝 |
Justfile 命令
顶级命令(在仓库根目录下执行)
# Setup & Installation
just setup # Install all dependencies (Rust + Python + Node)
just install # Install dependencies
# Service Management
just start-all # Start all services (API + Frontend)
just stop-all # Stop all services
just status # Show service status
just run # Run API and MCP server
just run-api # Run only Rust API
just run-frontend # Run only React frontend
just run-mcp # Run only MCP server
# Database
just db-start # Start PostgreSQL
just db-stop # Stop PostgreSQL
just db-reset # Reset database
just db-view # View reports in DB
# Testing
just test # Run all tests
just test-api # Test Rust API only
just test-frontend # Test React frontend only
just test-mcp # Test MCP server only
just test-workflow # Test full workflow
just test-integration # Full integration test
# Code Quality
just fmt # Format all code (Rust + TypeScript)
just lint # Lint all code (Rust + TypeScript)
just check # Run all checks
# Utilities
just clean # Clean build artifacts
just reset # Full reset (stop + db-reset + clean)
just info # Show project info特定服务命令
Rust API (cd rust-api && just ):
build,run,test,lint,fmttest-health,test-submit,test-list- 看
rust-api/justfile对于所有命令
React 前端 (cd frontend && npm ):
npm run dev- 启动开发服务器npm test- 运行测试npm run build- 为生产环境构建npm run lint- 检查TypeScript代码- 见
frontend/README.md对于所有命令
MCP 服务器 (cd mcp-server && just ):
run,test,test-manualtest-submit,test-list,test-list-pending- 看见
mcp-server/justfile对于所有命令
示例工作流程
# 1. Developer submits report (via MCP tool in Claude Code)
# Result: Report stored with status "pending_review"
# 2. Platform team reviews reports (multiple options):
# Option A: Web UI (recommended)
# Open http://localhost:5173
# - View dashboard with statistics
# - Click on report to view details
# - Click "Approve" or "Reject" button
# - Add review notes
# - Submit
# Option B: API
curl http://localhost:8080/api/v1/reports?status=pending_review
curl http://localhost:8080/api/v1/reports/{id}
curl -X PATCH http://localhost:8080/api/v1/reports/{id}/status \
-H "Content-Type: application/json" \
-d '{
"status": "approved",
"reviewed_by": "platform@intility.no",
"review_notes": "All checks passed"
}'
# Option C: MCP tool (in Claude Code)
cd mcp-server && just test-list-pending数据库模式
CREATE TABLE mcp_server_reports (
id UUID PRIMARY KEY,
server_name VARCHAR(255),
repository_url VARCHAR(500) UNIQUE,
developer_email VARCHAR(255),
report_data TEXT, -- Full markdown report
status VARCHAR(50), -- pending_review | approved | rejected
submitted_at TIMESTAMP,
reviewed_at TIMESTAMP,
reviewed_by VARCHAR(255),
review_notes TEXT
);POC(概念验证)范围
包括:
- ✅ 提交并存储报告
- ✅ 查看/浏览/批准报告
- ✅ 基本数据持久化
- ✅ 简单的工作流验证
- ✅ 网页用户界面(React + Bifrost)
- ✅ 带有统计数据的仪表板
- ✅ 报表过滤和搜索
- ✅ Markdown 渲染
未包含(POC之后):
- 自动化验证(GitHub API,kubectl)
- ❌ 代码分析工具
- ❌ OBO(On-Behalf-Of)身份验证(已配置MSAL,但未强制执行)
- ❌ 电子邮件通知
- ❌ 审计日志记录
- ❌ OpenTelemetry(注:OpenTelemetry是一个用于观测分布式系统的开源工具包,直接翻译为“开放遥测”可能不够准确,但在此处按照要求仅提供直接的字面翻译,实际使用时建议根据上下文选择更贴切的表述)
文档
- PRD 可以翻译为“民主党”(在墨西哥的政治语境中,通常指革命制度党,但根据上下文也可能指其他含义,如“民主党”等,具体需结合语境理解)。不过,最常见的翻译还是“革命制度党”(Partido Revolucionario de México,简称PRD) - 产品需求(POC范围)
- 建筑 - 技术架构
- CLAUDE.md(可译为“克劳德文档”或保持原样,若“CLAUDE”为特定名称或文件名,则通常不翻译,直接保留原名) - Claude Code开发者指南
发展
见 CLAUDE.md(文件名,可译为“克劳德文档”或保持原样,具体取决于上下文是否需要翻译文件名) 包含详细开发说明的:
- 添加API端点
- 修改数据库模式
- 添加MCP工具
- 测试
- 故障排除
测试
# Run Rust tests
cd rust-api && cargo test
# Run Python tests
cd mcp-server && uv run pytest
# Run React tests
cd frontend && npm test
# Integration test
just test-integration
# Or manually:
docker-compose up -d
curl -X POST http://localhost:8080/api/v1/reports \
-H "Content-Type: application/json" \
-d '{"server_name":"test","repository_url":"https://github.com/test","developer_email":"test@test.com","report_data":"# Test"}'
# Then visit http://localhost:5173 to see it in UI技术栈
- Rust + Axum(注:Axum 是一个用于构建 Rust 语言 Web 服务的框架) 快速、类型安全的API
- PostgreSQL + sqlx - 可靠的数据库,支持类型检查的查询
- React 19 + TypeScript(或译为:React 19搭配TypeScript) - 带有类型安全性的现代用户界面
- Vite + Bifrost 翻译为中文是“Vite + Bifrost(维特+比弗罗斯特)”。不过,这里的“Vite”和“Bifrost”可能是特定技术、项目或品牌名称,在中文语境中可能需要根据具体上下文来确定其准确含义或翻译。但基于直接翻译的原则,上述翻译是通用的。 - 快速开发服务器 + Intility 设计系统
- TanStack Query(注:TanStack Query 是一个用于数据查询和管理的 JavaScript 库,此翻译直接保留了原名,因为“TanStack Query”在中文中并没有一个广泛接受的官方译名,且直接使用原名在技术语境下更为常见和准确。) - 数据获取和缓存
- Python + uv(或理解为“Python 加上 uv”,其中 uv 可能代表某个特定的库、工具或环境变量,具体含义需根据上下文确定) - 快速包管理
- MCP协议 - 克劳德代码集成的模型上下文协议
许可证
内部Intility项目。
有问题吗?
- Slack(通讯软件): #编程 或 #开发运维
- 电子邮箱: platform-team@intility.no(邮箱地址可直接保留原样,无需翻译,若需说明,可表述为“邮箱地址:platform-team@intility.no”)
