返回市场
佩纳克斯-MCP

佩纳克斯-MCP

作者:pinax-network6 星标更新:2025-11-20

项目介绍

MCP 客户端:@pinax/mcp

license

连接到兼容MCP服务器服务的客户端,地址为 https://thegraph.market。

使用方法

使用方法: @pinax/mcp [选项]

一个桥接客户端,用于连接Claude Desktop和其他兼容MCP的客户端到远程MCP服务器。

选项:
  -V, --version              输出版本号
  --remote-url <字符串>      远程MCP服务器URL(环境变量: REMOTE_URL)
  --sse-url <字符串>         [已废弃] 使用--remote-url代替(环境变量: SSE_URL)
  --access-token <字符串>    JWT访问令牌(环境变量: ACCESS_TOKEN)
  -v, --verbose <布尔值>     启用详细日志记录(可选值: "true", "false",默认: false,环境变量: VERBOSE)
  -h, --help                 显示命令帮助

文档: https://thegraph.com/docs/en/ai-suite/token-api-mcp/introduction/

端点

此MCP允许LLMS访问由The Graph Token API提供的数据。

有两个可用的MCP:

  • 使用 https://token-api.mcp.thegraph.com/mcp 对于基于REST的MCP(所有层级)
  • 使用 https://token-api.mcp.thegraph.com/sse 对于基于SQL的MCP(付费层级)

认证

  1. 使用GitHub凭证在 https://thegraph.market 创建免费账户
  2. 转到仪表盘
  3. 点击创建新密钥
  4. 点击生成访问令牌

配置

环境变量(.env

ACCESS_TOKEN=<从thegraph.market获取的JWT令牌>
REMOTE_URL=https://token-api.mcp.thegraph.com/mcp

Claude Desktop配置

添加到你的Claude Desktop配置文件中:

位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

配置:

{
  "mcpServers": {
    "pinax": {
      "command": "npx",
      "args": [
        "@pinax/mcp",
        "--remote-url",
        "https://token-api.mcp.thegraph.com/mcp",
        "--access-token",
        "YOUR_ACCESS_TOKEN_HERE"
      ]
    }
  }
}

或使用环境变量:

{
  "mcpServers": {
    "pinax": {
      "command": "npx",
      "args": ["@pinax/mcp"],
      "env": {
        "REMOTE_URL": "https://token-api.mcp.thegraph.com/mcp",
        "ACCESS_TOKEN": "YOUR_ACCESS_TOKEN_HERE"
      }
    }
  }
}

使用Bun(开发)

{
  "mcpServers": {
    "pinax": {
      "command": "/path/to/bun",
      "args": [
        "run",
        "/path/to/pinax-mcp/index.ts",
        "--remote-url",
        "http://localhost:8080/mcp",
        "--access-token",
        "YOUR_ACCESS_TOKEN_HERE",
        "-v",
        "true"
      ]
    }
  }
}

支持的客户端

此桥接适用于支持stdio传输的任何MCP客户端:

故障排除

启用详细日志记录

在命令中添加 -v true 或设置 VERBOSE=true 在环境变量中:

npx @pinax/mcp --remote-url https://example.com/mcp --access-token YOUR_TOKEN -v true

常见问题

连接超时:

  • 验证你的 ACCESS_TOKEN 是否有效
  • 检查 REMOTE_URL 是否正确且可访问

认证失败:

服务器断开连接:

  • 查看Claude Desktop的日志以获取详细的错误信息
  • 验证与远程服务器的网络连接

开发

安装依赖

npm install
# 或
bun install

本地运行

bun run index.ts --remote-url http://localhost:8080/mcp --access-token YOUR_TOKEN -v true

构建

npm run build
# 或
bun run build

架构

┌─────────────────┐          ┌──────────────┐          ┌─────────────────┐
│  Claude Desktop │◄──stdio─►│  MCP Bridge  │◄──HTTP──►│  Remote MCP     │
│  (或其他        │          │   Client     │    或    │  Server         │
│   MCP客户端)    │          └──────────────┘◄──SSE───►└─────────────────┘
└─────────────────┘

许可证

Apache 2.0