MCP 服务器使用 Node.js 和 TypeScript 实现,基于 Model Context Protocol (MCP) 开放协议,能标准化应用程序向大型语言模型 (LLM) 提供上下文的方式,实现 AI 应用程序与各种数据源和工具之间的无缝通信。
npm install
npm run build
npm start
npm start -- --transport=sse
服务器将在默认的 3000 端口上运行。您可以通过设置 PORT
环境变量或使用端口参数更改此值:
npm start -- --transport=sse --port=8080
或:
PORT=8080 npm start -- --transport=sse
getDocumentsMetadata
:检索可用文档的元数据
query
(string):用户的原始查询或问题checkQueryRelevance
:评估相关文档并返回 intent 分析的指令
query
(string):用户的原始查询或问题files
(ArraygetDocumentMetadata
:根据文件路径检索特定文档的元数据
file
(string):文件路径/:path
:用来处理所有其他路由请求,返回 "default.html"要以开发模式运行服务器并启用自动重新加载:
npm run dev
对于 SSE 传输在开发模式下:
npm run dev -- --transport=sse
本项目采用 MIT 许可证。