MCP指令服务器是一个基于TypeScript的模型上下文协议(Model Context Protocol)服务器,它能让AI助手发现并访问结构化的Markdown指令,为AI辅助任务提供了集中式、标准化的指令管理方案。
MCPInstructionServer允许像Claude这样的AI助手通过标准化接口访问集中式的Markdown指令库。借助该服务器,你可以创建集中的提示知识库,维护版本化、结构化的指导文档,还能让AI助手按需搜索和检索特定指令,建立一致的AI辅助任务模式。
# 克隆仓库
git clone https://github.com/yourusername/MCPInstructionServer.git
cd MCPInstructionServer
# 安装依赖项
npm install
# 构建项目
npm run build
# 指定指令目录启动
npm start -- /path/to/instructions
# 或直接使用node
node dist/index.js /path/to/instructions
指令是简单的Markdown文件,扩展名为.md
。每个文件应遵循以下结构:
# 指令标题
该指令目的的简要描述。此第一段将用作列表中指令的摘要。
## 详细信息
包含更多详细信息的其他部分...
## 示例
使用示例、代码片段等。
instructions/
├── api/
│ ├── authentication.md
│ └── rate-limiting.md
├── design/
│ ├── color-system.md
│ └── typography.md
└── general/
├── code-review.md
└── git-workflow.md
服务器提供两个MCP工具:
listInstructions
返回所有可用指令的列表及其ID和摘要。 示例响应:
id: api/authentication
summary: 身份验证API - 本文件概述了我们在系统中使用的身份验证协议。
id: design/typography
summary: 字体指南 - 本指南解释了我们的字体比例和使用规则。
readInstruction
接受一个指令ID并返回对应指令的完整内容。
示例请求:{ "id": "api/authentication" }
# 使用开发模式运行(自动重启)
npm run dev -- /path/to/instructions
# 运行测试
npm test
本项目采用MIT许可证。
欢迎贡献!请随意提交Pull Request。