🤖 短语 MCP 服务器
一个优雅高效的 MCP(模型上下文协议)服务器,用于管理励志名言。旨在与 Claude for Desktop 和其他 MCP 客户端无缝集成。
✨ 特点
完整的短语管理——轻松创建、阅读、更新和删除短语
Claude 桌面集成- 直接通过 Claude 与您的短语进行交互
集成 Mock API - 使用模拟 API 进行测试和开发
🛠️ 可用工具
该服务器公开以下 MCP 工具:
工具 | 描述 |
| 获取所有可用短语 |
| 通过 ID 搜索短语 |
| 按作者姓名搜索短语 |
| 创建新句子 |
| 更新现有句子的文本 |
| 根据短语 ID 删除短语 |
🚀 安装
🔌 使用 Claude 桌面版进行设置
安装Claude 桌面版(确保您拥有最新版本)
配置 Claude for Desktop 以使用此 MCP 服务器:
打开配置文件(MAC/Linux):
~/Library/Application Support/Claude/claude_desktop_config.json添加服务器配置:
{ "mcpServers": { "phrases": { "command": "node", "args": [ "/RUTA_ABSOLUTA_A/phrases/build/index.js" ] } } }重启 Claude 桌面版
💡 与 Claude 一起使用
配置完成后,您可以直接从 Claude for Desktop 与短语进行交互:
“显示所有可用的短语”
“查找 [作者姓名] 的引文”
“为 [name] 创建一个新句子,内容为 [text]”
“将 ID 为 [number] 的短语更新为 [new text]”
“删除 ID 为 [number] 的短语”
🧪 测试
⚠️ 重要:测试设置
在运行测试之前,您应该临时修改tsconfig.json
文件。将compilerOptions
部分更改为:
注意:测试后请不要忘记恢复到原始配置,以确保 MCP 服务器构建正常工作。
运行测试:
此命令将运行一系列使用模拟 API 创建、读取、更新和删除句子的测试。
🏗️ 项目结构
🔄 开发工作流程
修改
src/
中的代码使用
npm run build
进行编译使用
npm run test:requests
进行测试重新启动 Claude for Desktop 以应用更改
🔍 MockAPI 配置
该项目使用MockAPI作为后端来存储和管理短语。配置的基本 URL 是:
设置您自己的 MockAPI 实例
在MockAPI上创建一个帐户
创建新项目
创建一个名为
user
资源,其中包含以下字段:id
(数字,自动生成)name
(字符串)phrase
(字符串)
复制您的 API URL
更新
src/helpers/makeMockAPIRequest.ts
文件中的BASE_URL
常量
📝 附加说明
该服务器使用模拟 API 来存储数据。在生产环境中,考虑实现一个真实的数据库。
项目结构遵循官方 MCP 指南,以提高可维护性。
如果您遇到 Mock API 问题,请检查 MockAPI 免费使用限制。
📄 许可证
国际学习中心
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一个优雅的 MCP 服务器,让用户直接通过 Claude for Desktop 管理励志短语,为带有作者归属的短语提供完整的 CRUD 操作。
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server implementation that integrates Claude with Salesforce, enabling natural language interactions with Salesforce data and metadata for querying, modifying, and managing objects and records.Last updated -15525101MIT License
- AsecurityAlicenseAqualityAn MCP server that enables saving and sharing Claude Desktop conversations, allowing users to store chats privately or make them public through a web interface.Last updated -11MIT License
- AsecurityAlicenseAqualityAn MCP server implementation that integrates Claude with Salesforce, enabling natural language interactions with Salesforce data and metadata for querying, modifying, and managing objects and records.Last updated -713214MIT License
- -securityFlicense-qualityAn MCP server that integrates with Claude to provide smart documentation search capabilities across multiple AI/ML libraries, allowing users to retrieve and process technical information through natural language queries.Last updated -