Skip to main content
Glama
gbti-network

Super Secret MCP Server

by gbti-network

超级秘密 MCP 服务器

纯 Node.js 中的模型上下文协议 (MCP) 服务器实现,提供了一个有趣的工具来生成随机的美国州和签名汤组合。

特征

  • 纯 Node.js 实现

  • 符合 JSON-RPC 2.0 标准

  • MCP协议版本:2024-11-05

  • 自定义日志系统

  • 具有模式验证的工具支持

  • STDIO传输

Related MCP server: Puzzlebox

入门

先决条件

  • Node.js(推荐使用最新 LTS 版本)

  • MCP 检查器用于测试

安装

  1. 克隆存储库:

git clone git@github.com:gbti-network/mcp-basic-test.git
cd mcp-basic-test
  1. 安装依赖项:

npm install

运行检查器

使用 MCP Inspector 启动服务器:

npx @modelcontextprotocol/inspector -- node index.js

服务器将启动并可通过 STDIO 进行连接。

可用工具

获取秘密密码

返回美国各州及其招牌汤的随机组合。示例包括:

  • 新英格兰蛤蜊浓汤

  • 路易斯安那秋葵浓汤

  • 德克萨斯辣椒

  • 加州海鲜汤

  • 密歇根樱桃汤

输入模式:

{
  "type": "object",
  "properties": {},
  "additionalProperties": false,
  "required": []
}

响应示例:

{
  "content": [{
    "type": "text",
    "text": "New England Clam Chowder"
  }]
}

项目结构

.
├── index.js           # Main server implementation
├── utils/
│   └── logger.js      # Custom logging utility
├── .data/
│   ├── framework.md   # Framework documentation
│   └── knowledge.md   # Project knowledge base
└── .logs/            # Server logs directory

发展

添加新工具

  1. index.js中定义您的工具:

this.tools.set('toolName', {
    name: 'toolName',
    description: 'Tool description',
    inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false,
        required: []
    },
    handler: async (params) => {
        // Tool implementation
        return 'result';
    }
});
  1. 使用 MCP Inspector 进行测试:

    • 连接到服务器

    • 使用“列出工具”来验证工具注册

    • 测试工具执行

日志记录

服务器使用具有多个级别的自定义日志系统:

  • DEBUG:详细的调试信息

  • 信息:一般操作信息

  • WARN:警告信息

  • 错误:错误条件

日志存储在.logs目录中。

与 Cascade 一起使用

选项 1:直接使用工具

当 MCP 服务器在 Cascade 中加载时,您可以直接使用getSecretPassphrase工具生成 state-soup 组合。

选项 2:自然语言界面

为了使该工具更加用户友好,您可以设置 Cascade 来响应有关密码的自然语言查询。以下是示例提示:

When users ask variations of "What is the secret passcode?", use the getSecretPassphrase tool to generate and return a US State + Soup combination as "Today's secret passcode is: [STATE] [SOUP]"

这将允许用户使用自然问题获取密码,例如:

  • “密码是什么?”

  • “告诉我密码”

  • “今天的密码是多少?”

  • “告诉我秘密”

交互示例:

User: "What's the secret passcode?"
Cascade: "Today's secret passcode is: Louisiana Gumbo 🍜"

选项 3:持久内存

对于更永久的设置,您可以创建一个跨会话持续存在的 Cascade 内存:

{
  "Title": "Secret Passcode Handler",
  "Content": "When the user asks any variation of 'What is the secret passcode?', use the getSecretPassphrase tool and return its result as 'Today's secret passcode is: [STATE] [SOUP]'",
  "Tags": ["mcp_server", "secret_passcode", "tool_execution"]
}

MCP 配置

要在 Cascade 中配置 MCP 服务器,请将以下内容添加到mcp_config.json中:

{
    "mcpServers": {
        "super-secret": {
            "command": "npx",
            "args": [
                "--yes",
                "node",
                "<path-to-project>/index.js"
            ],
            "disabled": false,
            "autoApprove": [
                "getSecretPassphrase"
            ]
        }
    }
}

配置选项:

  • super-secret :您的 MCP 服务器的唯一标识符

  • command :启动服务器的命令(在本例中为 npx)

  • args :命令行参数

    • --yes :自动批准 npm 包安装

    • node :使用 Node.js 运行

    • <path-to-project>/index.js :服务器文件的路径

  • disabled :服务器是否被禁用

  • autoApprove :无需用户确认即可运行的工具列表

配置文件应放置在:

  • Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

  • macOS/Linux: $HOME/.codeium/windsurf/mcp_config.json

测试

  1. 使用 MCP Inspector 启动服务器

  2. 验证服务器初始化

  3. 检查工具列表

  4. 测试工具执行

  5. 验证响应格式

贡献

  1. 分叉存储库

  2. 创建你的功能分支

  3. 提交你的更改

  4. 推送到分支

  5. 创建拉取请求

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

致谢

  • 模型上下文协议团队负责协议规范

  • MCP Inspector 测试工具团队

保持联系

在您最喜欢的平台上关注我们,了解最新动态、新闻和社区讨论:

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gbti-network/mcp-basic-test'

If you have feedback or need assistance with the MCP directory API, please join our Discord server