Sage Intacct文档MCP服务器
一个MCP服务器,为AI助手提供对Sage Intacct REST API文档的可查询访问。加载一个或多个OpenAPI规范,让您的LLM搜索端点、浏览模式、生成示例有效载荷并检查文档质量——所有这些都不需要离开对话。
快速开始
1.安装
npm install -g @rowellewis/intacct-docs-mcp或者在不安装的情况下运行:
npx @rowellewis/intacct-docs-mcp2.添加到克劳德桌面 (claude_desktop_config.json):
{
"mcpServers": {
"intacct-docs": {
"command": "npx",
"args": ["-y", "@rowellewis/intacct-docs-mcp"],
"env": {
"SPEC_DIR": "/path/to/your/specs"
}
}
}
}省略 SPEC_DIR 使用捆绑的Sage Intacct规范。
3.试试看
“搜索与应付账款供应商相关的端点。” “显示POST/对象/应付账款/供应商的请求正文架构。” “生成用于创建日记条目的示例有效负载。”
工具
| 工具 | 它做什么 |
|---|---|
search-endpoints | 跨路径、摘要和描述的模糊全文搜索。支持多词查询和拼写错误容忍。 |
get-endpoint-docs | 特定端点的完整文档——参数、请求/响应模式、示例。 |
get-schema | 具有所有属性、类型和约束的模式定义。 |
list-schemas | 浏览可用的架构名称,可按前缀过滤。 |
list-tags | 具有终结点计数的所有API标记/类别。 |
get-endpoints-by-tag | 特定标记下的所有端点。使用 list-tags 首先查找标签名。 |
generate-example | 为任何端点生成一个真实的JSON请求体,从其模式中推断出来。 |
spec-quality-report | 对文档质量(0-100)进行评分,并按严重程度列出问题。 |
health | 准备状态、索引计数和启动时间。 |
完整的参数参考、错误代码和示例: docs/public-contract.md.
配置
| 变量 | 默认值 | 描述 |
|---|---|---|
SPEC_DIR | ../data/sage-intacct-rest-api | 已扫描目录 *.openapi.yaml 文件 |
TRANSPORT | stdio | stdio 或 http |
HTTP_PORT | 3000 | 使用HTTP传输时的端口 |
HTTP_HOST | 127.0.0.1 | 绑定HTTP传输地址(0.0.0.0 对于所有接口) |
MAX_RESPONSE_CHARS | 12000 | 响应大小上限——超过此上限时,输出将被截断并发出通知 |
LOG_LEVEL | info | error, warn, info,或 debug |
MAX_BODY_BYTES | 1048576 | 最大HTTP请求正文大小(字节) |
RATE_LIMIT_RPM | 60 | 每个IP每分钟的最大请求数(HTTP传输) |
发展
npm install
npm run build # compile TypeScript
npm run dev # watch mode with tsx
npm test # run all tests需要Node.js>=18。
项目布局:
src/
├── app.ts # tool registry and handlers
├── config.ts # env vars → AppConfig
├── index.ts # entry point, transport selection
├── core/
│ ├── indexer.ts # in-memory indexes + fuzzy search
│ ├── formatter.ts # markdown response formatting
│ ├── fuzzy.ts # trigram similarity matching
│ ├── example-generator.ts
│ ├── validate.ts
│ ├── cache.ts
│ └── spec-quality.ts
└── transport/
├── http-server.ts # MCP Streamable HTTP transport + GET /health
└── stdio.ts # MCP stdio wrapper测试使用Vitest。
部署
HTTP传输 (MCP流式HTTP——用于基于URL的MCP客户端):
TRANSPORT=http HTTP_PORT=3000 npm start运营
- 健康: 呼叫
healthtool——返回准备状态、索引计数和启动持续时间。或者点击GET /health在HTTP模式下运行时。 - 日志: stderr上的结构化JSON。调整措辞
LOG_LEVEL. - 运行手册:
docs/ops-runbook.md
故障排除
服务器无法启动 --验证 SPEC_DIR 至少包含一个 *.openapi.yaml 文件,然后运行 npm run build 并检查stderr。
未找到终结点 --使用 search-endpoints 发现路径。方法必须大写(GET, POST, …).
未找到架构 --使用 list-schemas 可选 prefix 浏览可用内容。名称区分大小写。
许可证
麻省理工学院
