VA Lighthouse MCP 服务器
用于渐进式发现和验证VA Lighthouse API的模型上下文协议服务器。该服务器基于Cloudflare Workers构建,使用TypeScript和Zod进行验证。
特点/功能
13 MCP 工具 对于VA API探索:
- 发现 (2): 列出API,获取元数据
- 探索 (5): 概述API,浏览端点,搜索操作,查看模式
- 验证 (4): 验证有效载荷,生成示例,获取验证规则
- 公用设施/公共服务 (2): 检查健康状况,比较版本
生产就绪
- 314项测试(226项单元测试,88项集成测试),代码覆盖率94%
- 具有1小时TTL的LRU缓存,以实现最佳性能
- OpenAPI 3.0 解析和引用解析
- 基于Zod的验证并提供修复建议
- Cloudflare Workers 部署
快速入门
# Install dependencies
npm install
# Start development server
npm run dev
# Run all tests
npm run test:all服务器运行于 http://localhost:8788/sse
健康检查
curl http://localhost:8788/healthMCP 检查器
测试工具交互式地:
npx @modelcontextprotocol/inspector@latest
# Open http://localhost:5173
# Connect to http://localhost:8788/sseClaude 桌面集成
添加到 claude_desktop_config.json:
{
"mcpServers": {
"va-lighthouse": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8788/sse"]
}
}
}对于生产,请使用: https://va-lighthouse-mcp..workers.dev/sse
文档
测试
建筑
┌─────────────────────────────────────────┐
│ 13 MCP Tools (4 categories) │
├─────────────────────────────────────────┤
│ • Cache (LRU, 1hr TTL) │
│ • API Client (VA Lighthouse) │
│ • OpenAPI Parser (@scalar) │
│ • Validator (Zod) │
├─────────────────────────────────────────┤
│ Cloudflare Workers Runtime │
└─────────────────────────────────────────┘项目结构
src/
├── index.ts # MCP server entry point
├── services/ # Cache, API client, parser, validator
├── tools/ # 13 MCP tools (4 files)
└── utils/ # Error formatting, example generation
test/
├── unit/ # 226 tests (Workers pool, 94% coverage)
└── integration/ # 88 tests (Node.js + HTTP)
docs/
├── TOOLS.md # Complete MCP tools reference
├── DEVELOPMENT.md # Development and testing guide
└── DEPLOYMENT.md # Cloudflare deployment guide测试
运行所有测试 (314项测试)
npm run test:all单元测试 (226个测试,覆盖率94%)
npm run test:unit # Run unit tests
npm run test:coverage # Generate coverage report
npm run test:coverage:open # View coverage HTML report集成测试 (88项测试)
npm run dev # Terminal 1: Start server
npm run test:integration # Terminal 2: Run integration tests代码覆盖率
- 整体来说: 94%
- openapi-parser: 99%
- API客户端:96%
- json-schema-to-zod: 93%
- 验证器:85%
见 开发指南 以获取详细的测试信息。
部署
部署到 Cloudflare Workers:
npm run deploy您的服务器将在以下地址可用:
https://va-lighthouse-mcp..workers.dev/sse见 部署指南 for: (在中文中,"for" 通常不直接翻译,因为它是一个介词,根据上下文有不同的含义,如“为了”、“对于”等。如果要保留其英文形式并说明其用途,可以翻译为“对于(的)”或“为了(的)”,具体取决于上下文。)
- 账户设置与配置
- 自定义域名
- 环境变量和密钥
- 监控与可观测性
- 成本估算
栈(或称为堆栈)
- 运行时Cloudflare Workers(云防护网络工作者)
- 语言TypeScript 5.9
- MCP(Multi-Channel-Package)@modelcontextprotocol/sdk 1.19
- 验证Zod 3.25
- 解析器@scalar/openapi-parser 0.22
- 测试Vitest 3.2(314个测试,覆盖率94%)
资源
许可证
麻省理工学院(MIT)
