mcp-knowledge-base
mcp-knowledge-base
一个Model Context Protocol(MCP)服务器,向 MCP 客户端(Claude Desktop、IDE 或任何代理)暴露笔记知识库。它演示了 MCP 服务器提供的两样东西:工具(模型可以调用的操作)和资源(模型可以读取的数据)。使用 TypeScript 编写,通过 stdio 运行。
它提供了什么
工具(src/server.ts):
Tool | Purpose |
| 跨知识库进行关键词搜索(标题/标签/内容加权) |
| 添加新笔记 |
| 按 id 获取单条笔记 |
资源: 每条笔记都可以通过 note://{id} 读取,并提供列表——因此客户端可以将知识库作为数据浏览,而不仅仅是调用工具。
领域逻辑(笔记存储 + 搜索排序)位于 src/notes.ts 中,与协议层分离。
Related MCP server: simple-mcp-example
与 MCP 客户端一起使用
构建它,然后将客户端指向该二进制文件。例如,在 Claude Desktop 的 claude_desktop_config.json 中:
{
"mcpServers": {
"knowledge-base": { "command": "node", "args": ["/abs/path/to/dist/index.js"] }
}
}npm install && npm run build
node dist/index.js # speaks MCP over stdio测试
npm test两层,均离线运行:
单元测试 — 笔记存储和搜索排序。
集成测试 — 一个真实的 MCP
Client通过内存传输与服务器通信(与客户端通过 stdio 通信的方式相同):它列出工具,调用search_notes/add_note/get_note,并读取note://资源。共 9 个测试。
许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Search, read, write, and organize your Scratchpad notes from any MCP client.
Read and write your Caliu notes from any MCP client: search, create, tag, remind, attach files.
Notes, files, GitHub, and Drive through one MCP connection.
Notes, files, GitHub, and Drive through one MCP connection.
Related MCP Servers
- -licenseCqualityDmaintenanceEnables creating and managing text notes through MCP resources and tools. Provides note creation capabilities and automatic summarization of all stored notes.1-
- FlicenseNot gradedqualityBmaintenanceEnables managing local Markdown notes by creating, viewing, listing, and searching notes and their contents through MCP tools.-
- AlicenseNot gradedqualityCmaintenanceEnables creating, retrieving, updating, deleting, and listing notes through a simple MCP interface, with configurable note storage.MIT
- FlicenseNot gradedqualityCmaintenanceEnables managing notes through add, get, update, delete, and list tools via MCP.-