这是一个基于 TypeScript 的 MCP 服务器,它通过实现简单的笔记系统,来演示核心上下文概念。该服务器提供了以下功能:
note://
URI 和元数据表示的文本笔记资源。note://
URI)。create_note
- 用于创建新笔记。
summarize_notes
- 生成所有存储笔记的摘要。
安装依赖:
npm install
构建服务器:
npm run build
使用自动重建进行开发:
npm run watch
要在 Claude 桌面中使用,请在配置文件中添加以下内容:
在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json%
{
"mcpServers": {
"sourcify-context-server": {
"command": "/path/to/sourcify-context-server/build/index.js"
}
}
}
由于 MCP 服务器通过标准输入输出进行通信,调试可能会有些挑战。我们推荐使用 MCP 检查器,该工具作为一个包脚本提供:
npm run inspector
检查器会提供一个可在浏览器中访问调试工具的 URL。