DAO数据查询服务

一个基于TypeScript和GraphQL构建的服务器,用于通过Tally API获取DAO的治理数据、提案和元数据。

  • by crazyrabbitLTC
  • TypeScript
  • 本地部署
  • 6 星标
  • 更新于
在 GitHub 查看 crazyrabbitltc/mpc-tally-api-server

使用说明

MPC理货API服务器

用于与Tally API交互的模型上下文协议(MCP)服务器。该服务器允许AI代理获取有关DAO的信息,包括其治理数据、提案和元数据。

特性

  • 按受欢迎程度或探索状态列出DAO
  • 获取全面的DAO元数据,包括社交链接和治理信息
  • 处理大型结果集的分页支持
  • 使用TypeScript和GraphQL构建
  • Bun的测试流道实现了全面的测试覆盖

安装

# Clone the repository
git clone https://github.com/yourusername/mpc-tally-api-server.git
cd mpc-tally-api-server

# Install dependencies
bun install

# Build the project
bun run build

配置

  1. 创建一个 .env 根目录中的文件:
TALLY_API_KEY=your_api_key_here
  1. 从获取API密钥 计数

⚠️ 安全说明:确保API密钥的安全:

  • 永远不要承诺你的 .env 文件
  • 不要在日志或错误消息中公开API密钥
  • 如果API密钥已暴露,请旋转该密钥
  • 使用环境变量进行配置

用法

运行服务器

# Start the server
bun run start

# Development mode with auto-reload
bun run dev

Claude桌面配置

将以下内容添加到您的Claude Desktop配置中:

{
  "tally": {
    "command": "node",
    "args": [
      "/path/to/mpc-tally-api-server/build/index.js"
    ],
    "env": {
      "TALLY_API_KEY": "your_api_key_here"
    }
  }
}

可用脚本

  • bun run clean -清理构建目录
  • bun run build -构建项目
  • bun run start -运行内置服务器
  • bun run dev -在开发模式下运行并自动重新加载
  • bun test -运行测试
  • bun test --watch -在监视模式下运行测试
  • bun test --coverage -运行覆盖率测试

API函数

服务器公开以下MCP功能:

list_daos

列出按指定条件排序的DAO。

参数:

  • limit (可选):要返回的最大DAO数(默认值:20,最大值:50)
  • afterCursor (可选):分页光标
  • sortBy (可选):如何对DAO进行排序(默认:流行)
    • 选项:“id”、“name”、“explore”、“popular”

许可证

麻省理工学院