Skip to main content
Glama
Phrases MCP Server
by ronniemh

🤖 短语 MCP 服务器

一个优雅高效的 MCP(模型上下文协议)服务器,用于管理励志名言。旨在与 Claude for Desktop 和其他 MCP 客户端无缝集成。

✨ 特点

  • 完整的短语管理——轻松创建、阅读、更新和删除短语

  • Claude 桌面集成- 直接通过 Claude 与您的短语进行交互

  • 集成 Mock API - 使用模拟 API 进行测试和开发

Related MCP server: PoetryQuill Analytics MCP

🛠️ 可用工具

该服务器公开以下 MCP 工具:

工具

描述

get-all-phrases

获取所有可用短语

get-phrase-by-id

通过 ID 搜索短语

get-phrase-by-name

按作者姓名搜索短语

create-phrase

创建新句子

update-phrase

更新现有句子的文本

delete-phrase

根据短语 ID 删除短语

🚀 安装

# Clonar el repositorio
git clone https://github.com/ronniemh/phrases-MCP-server.git
cd phrases-MCP-server

# Instalar dependencias
npm install

# Compilar el proyecto
npm run build

🔌 使用 Claude 桌面版进行设置

  1. 安装Claude 桌面版(确保您拥有最新版本)

  2. 配置 Claude for Desktop 以使用此 MCP 服务器:

    打开配置文件(MAC/Linux):

    ~/Library/Application Support/Claude/claude_desktop_config.json
  3. 添加服务器配置:

    {
        "mcpServers": {
            "phrases": {
                "command": "node",
                "args": [
                    "/RUTA_ABSOLUTA_A/phrases/build/index.js"
                ]
            }
        }
    }
  4. 重启 Claude 桌面版

💡 与 Claude 一起使用

配置完成后,您可以直接从 Claude for Desktop 与短语进行交互:

  • “显示所有可用的短语”

  • “查找 [作者姓名] 的引文”

  • “为 [name] 创建一个新句子,内容为 [text]”

  • “将 ID 为 [number] 的短语更新为 [new text]”

  • “删除 ID 为 [number] 的短语”

🧪 测试

⚠️ 重要:测试设置

在运行测试之前,您应该临时修改tsconfig.json文件。将compilerOptions部分更改为:

"compilerOptions": {
  "target": "ES2020",
  "module": "NodeNext",
  "moduleResolution": "NodeNext",
  "esModuleInterop": true,
  "outDir": "build",
  "strict": true
}

注意:测试后请不要忘记恢复到原始配置,以确保 MCP 服务器构建正常工作。

运行测试:

npm run test:requests

此命令将运行一系列使用模拟 API 创建、读取、更新和删除句子的测试。

🏗️ 项目结构

src/
├── helpers/
│   └── makeMockAPIRequest.ts  # Funciones de ayuda para interactuar con la API
├── index.ts                   # Punto de entrada principal y definición de herramientas
└── testRequest.ts             # Script para probar las funciones de la API

🔄 开发工作流程

  1. 修改src/中的代码

  2. 使用npm run build进行编译

  3. 使用npm run test:requests进行测试

  4. 重新启动 Claude for Desktop 以应用更改

🔍 MockAPI 配置

该项目使用MockAPI作为后端来存储和管理短语。配置的基本 URL 是:

https://67ec86aeaa794fb3222e0682.mockapi.io/frases/api/v1/user

设置您自己的 MockAPI 实例

  1. 在MockAPI上创建一个帐户

  2. 创建新项目

  3. 创建一个名为user资源,其中包含以下字段:

    • id (数字,自动生成)

    • name (字符串)

    • phrase (字符串)

  4. 复制您的 API URL

  5. 更新src/helpers/makeMockAPIRequest.ts文件中的BASE_URL常量

// Cambia esta línea con tu propia URL de MockAPI
const BASE_URL = "https://tu-proyecto.mockapi.io/tu-path/user";

📝 附加说明

  • 该服务器使用模拟 API 来存储数据。在生产环境中,考虑实现一个真实的数据库。

  • 项目结构遵循官方 MCP 指南,以提高可维护性。

  • 如果您遇到 Mock API 问题,请检查 MockAPI 免费使用限制。

📄 许可证

国际学习中心

Available Tools

6 tools
create-phraseC

Creates a new phrase for an author.

Inputs: name (required), phrase (required).

delete-phraseC

Deletes a phrase by its ID.

Inputs: id (required).

get-all-phrasesC

Returns a list of all phrases.

Inputs: no named parameters.

get-phrase-by-idC

Returns a phrase by its ID.

Inputs: id (required).

get-phrase-by-nameC

Returns a phrase by author name.

Inputs: name (required).

update-phraseC

Updates the text of a phrase by its ID.

Inputs: id (required), phrase (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct purpose with no overlap: create, delete, get all, get by ID, get by name, and update. The descriptions clearly differentiate between operations on phrases by ID, name, or all phrases, eliminating any ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., create-phrase, delete-phrase, get-all-phrases). The naming is uniform across all six tools, using hyphens to separate words and clear action verbs.

    Tool Count5/5

    With 6 tools, this server is well-scoped for managing phrases, covering essential CRUD operations and additional retrieval methods. The count is appropriate, providing comprehensive functionality without being excessive or insufficient.

    Completeness5/5

    The tool set offers complete CRUD coverage (create, read, update, delete) and includes multiple read options (all, by ID, by name). There are no obvious gaps; agents can perform all expected lifecycle operations for phrase management.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers