kf-mcp服务器
HTTP MCP服务器的Monrepo,每个服务器都作为独立的Railway服务部署。
服务器
| 文件夹 | 用途 | 端口 | 文档 |
|---|---|---|---|
blink-cms/ | Blink.new CMS+网络搜索工具 | 3100 | → |
postgres/ | PostgreSQL查询+模式资源管理器 | 3200 | → |
stripe/ | Stripe产品、账单、活动 | 3300 | → |
railway/ | 铁路基础设施管理 | 3400 | → |
运作原理
每个服务器都是一个无状态的HTTP MCP服务器,使用 MCP可流式HTTP传输.凭据(API密钥、令牌)通过HTTP头逐请求传递-一个部署的服务器为任何数量的客户端提供服务。
Cursor / AI client
│
│ POST /mcp
│ Authorization: Bearer
│ X--Token:
▼
Railway service
(kf-mcp-servers/)
│
▼
Upstream API / Database光标设置
添加 ~/.cursor/mcp.json:
{
"mcpServers": {
"blink-cms": {
"url": "https://blink-cms-production.up.railway.app/mcp",
"headers": { "Authorization": "Bearer " }
},
"pg2-postgres": {
"url": "https://postgres-production-85106.up.railway.app/mcp",
"headers": {
"Authorization": "Bearer ",
"X-Database-URL": "postgresql://..."
}
},
"stripe": {
"url": "https://stripe-production-bc3a.up.railway.app/mcp",
"headers": { "X-Stripe-Api-Key": "sk_live_..." }
},
"railway": {
"url": "https://railway-production-9f1b.up.railway.app/mcp",
"headers": {
"Authorization": "Bearer ",
"X-Railway-Token": ""
}
}
}
}铁路部署
每个服务器都从这个单独的仓库部署。铁路:
- 创建新服务→ 连接此GitHub仓库
- 集 根目录 到服务器子文件夹(例如。
postgres/) - 铁路使用
Dockerfile在该文件夹内 - 在铁路仪表板中添加环境变量
本地开发
cd
npm install
npm run dev # starts with tsx watch服务器正在监听 http://localhost: /mcp.
添加新服务器
- 创建
/与:src/index.ts,Dockerfile,railway.json,package.json,tsconfig.json,README.md - 使用Express 5+
@modelcontextprotocol/sdkStreamableHTTPServerTransport(无国籍,sessionIdGenerator: undefined) - 始终暴露
GET /health和POST /mcp - 接受
MCP_API_KEY通过Authorization: Bearer头球 - 通过专用服务器接受服务凭据
X-头球 - 更新
AGENTS.md包含服务器详细信息
