未来 MCP
用于与 Solana 上的 Futarchy 协议交互的服务器实现。
设置说明
克隆存储库:
git clone <repository-url>
cd futarchy-mcp安装依赖项:
npm install配置 RPC URL:
打开
src/server.ts更新连接初始化中的RPC URL:GXP3
您可以使用:
主网:
https://api.mainnet-beta.solana.com开发网:
https://api.devnet.solana.com或者您自己的 RPC 提供程序 URL(仅适用于此)
启动开发服务器:
npm run devRelated MCP server: Solana MCP Server
可用路线
DAO 路线
GET /daos- 获取所有 DAOGET /daos/:id- 通过 ID 获取特定的 DAOGET /daos/:id/proposals- 获取特定 DAO 的所有提案POST /daos/:id/proposals- 为 DAO 创建新提案(目前尚未测试,因为 dao 创建路线不存在)身体:
{ "descriptionUrl": "string", "baseTokensToLP": "number", "quoteTokensToLP": "number" }
提案路线
GET /proposals/:id- 根据 ID 获取特定提案
测试
您可以使用 Postman 或 curl 等工具测试路由。服务器默认在端口 9000 上运行。
curl 命令示例:
# Get all DAOs
curl http://localhost:9000/daos
# Get a specific DAO
curl http://localhost:9000/daos/<dao-address>
# Get proposals for a DAO
curl http://localhost:9000/daos/<dao-address>/proposals
# Create a new proposal
curl -X POST http://localhost:9000/daos/<dao-address>/proposals \
-H "Content-Type: application/json" \
-d '{
"descriptionUrl": "https://example.com/proposal",
"baseTokensToLP": 1000,
"quoteTokensToLP": 1000
}'光标的 MCP 服务器
该项目还包括一个 MCP(模型上下文协议)服务器,允许 Cursor 通过自定义工具与 Futarchy 后端进行交互。
设置 MCP 服务器
运行安装脚本来安装依赖项、构建项目并配置 Cursor:
chmod +x setup.sh
./setup.sh或者手动配置:
安装依赖项并构建项目:GXP8
打开或创建
~/.cursor/mcp.json添加以下配置(根据需要调整路径):GXP9
在 Cursor 中使用 MCP 服务器
您可以在 Cursor 的聊天中使用以下工具:
getDaos- 从 Futarchy 系统获取所有 DAOgetDao- 根据 ID 获取特定的 DAOgetProposals- 获取特定 DAO 的所有提案getProposal- 根据 ID 获取特定提案createProposal- 为 DAO 创建新提案
例如,在 Cursor 的聊天中,你可以说:
Use the getDaos tool to retrieve a list of all DAOs from the futarchy-routes backend.有关 MCP 服务器的更多详细信息,请参阅src/mcp/README.md 。
情绪分析功能
Futarchy MCP 服务器现已包含一个情绪分析工具,可以分析来自 Discord 和 Twitter 数据中针对特定提案的情绪。此功能有助于了解社区对提案的情绪,并可用于做出更明智的决策。
工作原理
情绪分析工具从 Discord 和 Twitter 收集有关特定提案的数据。
它使用自然语言处理技术分析情绪。
它将情绪分为不同的类别(代币经济学、协议参数等)。
它根据分析生成摘要、要点和关注点。
结果以结构化的格式呈现,前端可以轻松使用。
示例响应
{
"proposalId": "F3hsZzWinRAHbr6CUxdkUFBCH8qNk6Mi9Zfu3PMX49BC",
"sentimentScore": -0.8,
"primaryCategory": "Tokenomics",
"categories": [
{
"name": "Tokenomics",
"score": 0.4
},
{
"name": "Protocol Upgrades",
"score": 0.3
},
{
"name": "Partnerships Integrations",
"score": 0.2
},
{
"name": "Protocol Parameters",
"score": 0.1
}
],
"summary": "The proposal to launch a new Horizon token for the Aave ecosystem has faced significant backlash from the community...",
"keyPoints": [
"The proposed token launch is seen as unnecessary and potentially harmful to the Aave token and community.",
"The revenue-sharing model is perceived as frontloaded and unfair, favoring early years when adoption and revenue may be low.",
"There is a desire to maintain the Aave token as the primary governance and utility token for the ecosystem."
],
"concerns": [
"Dilution of the Aave token's value and attention.",
"Misalignment of incentives with the proposed revenue-sharing model.",
"Creation of a separate entity that could compete with the Aave ecosystem.",
"Lack of transparency and community involvement in the decision-making process."
],
"sources": {
"discord": true,
"twitter": true
}
}如何使用
您可以按如下方式在 MCP 服务器中使用情绪分析工具:
const result = await mcp_futarchy_routes_getProposalSentiment({
proposalId: "F3hsZzWinRAHbr6CUxdkUFBCH8qNk6Mi9Zfu3PMX49BC"
});这将返回指定提案的情绪分析。