M

MCP Tally治理API服务器

@crazyrabbitLTC/mpc-tally-api-server
0 Stars 327 次浏览 crazyrabbitLTC 更新于 2026-08-23

允许AI代理通过Tally API访问DAO治理数据、提案和元数据的服务器,使用Model Context Protocol (MCP)构建,采用TypeScript和GraphQL。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

MPC Tally API Server

一个用于与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. Tally获取您的API密钥

⚠️ 安全提示:请妥善保管您的API密钥:

  • 切勿将.env文件提交到版本控制系统
  • 不要在日志或错误消息中暴露您的API密钥
  • 如果您的API密钥被泄露,请更换它
  • 使用环境变量进行配置

使用

运行服务器

# Start the server
bun run start

# Development mode with auto-reload
bun run dev

Claude桌面配置

向您的Claude桌面配置中添加以下内容:

{
  "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进行排序 (默认: popular)
    • 选项: "id", "name", "explore", "popular"

许可证

MIT

相关 MCP 服务