@yinyoudexing/geoc-collect-node-api-mcp
v0.1.0
Published
MCP server for geoc-collect-node API tools
Readme
geoc-collect-node API MCP
这是 geoc-collect-node 项目的 MCP 服务,按 npm 包方式发布和接入。
工具来源
工具定义从仓库根目录的 docs/apifox-openapi.json 生成。生成规则:
- 暴露普通 JSON API 为 MCP tools。
- 跳过 MVT、文件流、导出下载等二进制接口。
- 跳过
delete、remove、abort、reset、clear等删除或清理类接口,避免 Agent 误操作真实数据。 - 跳过
multipart/form-data文件上传接口;文件上传更适合由业务系统或专门上传工具处理。
新增、更新、同步、执行类接口会保留,但 readOnlyHint 为 false。调用这些工具前应确认参数和影响范围。
环境变量
GEOC_COLLECT_API_BASE_URL:接口服务基础地址,默认http://localhost:6001。GEOC_COLLECT_API_TOKEN:鉴权 token。服务会自动补Bearer。GEOC_COLLECT_API_AUTHORIZATION:完整Authorization值;当已包含Bearer时会原样使用。GEOC_COLLECT_API_AK:可选AK请求头。
本地运行
npm install
npm run generate:tools
npm run build
GEOC_COLLECT_API_BASE_URL=http://localhost:6001 npm start真实接口调用通常需要在 MCP 客户端配置或启动环境中设置 GEOC_COLLECT_API_TOKEN。
发布为 npm 包
发布前确认 package.json 中的版本号,并确认当前 npm 账号有发布当前 scope 的权限。
cd mcp/geoc-collect-node-api
npm whoami
npm test
npm run build
npm pack --dry-run
npm publish --access public当前包名是 @yinyoudexing/geoc-collect-node-api-mcp。如果公司使用内网 registry,不要把 registry 写死到包里,优先在本机或 CI 的 .npmrc 中配置。
Codex MCP 配置
包发布后,使用 npx 启动,不依赖本机绝对路径:
[mcp_servers.geoc-collect-node-api]
command = "npx"
args = ["-y", "@yinyoudexing/[email protected]"]
[mcp_servers.geoc-collect-node-api.env]
GEOC_COLLECT_API_BASE_URL = "http://localhost:6001"
GEOC_COLLECT_API_TOKEN = "your-token"不要在包代码、README、测试或提交中写入真实 token。
