SuperAPI AI 工具集

injective-mcp-servers

智能体与模型

查看项目

更新于 10-16 09:56

技能介绍

用途:本技能说明如何搭建和使用面向 Injective 的 MCP(Model-Context-Protocol)服务器,供 LLM 发现并调用工具。当需要查询 Injective 权威信息时用 Injective Documentation MCP Server;当在 Injective 主网或测试网查询、交易,或使用永续合约、现货转账、跨链桥与原生 EVM 交易时,用 Injective MCP Server。

文档 MCP:已有托管服务,无需自建,连接 https://docs.injective.network/mcp(streamable HTTP 端点,多数 MCP 客户端可消费)。可用工具:SearchInjectiveDocs,检索官方文档并返回含引用的结果。

自建 Injective MCP:安装命令为 git clone https://github.com/InjectiveLabs/mcp-server injective-mcp-server,cd injective-mcp-server,npm install && npm run build。手动运行:INJECTIVE_NETWORK="mainnet" node ./dist/mcp/server.js。在 Claude Code 中需编辑 ~/.claude/mcp.json 或项目内 MCP 配置,加入 mcpServers.injective,command 为 node,args 指向 dist/mcp/server.js 的绝对路径,env 设置 INJECTIVE_NETWORK 为 mainnet。

主要工具:钱包类有 wallet_generate、wallet_import、wallet_list、wallet_remove;行情与账户类有 market_list、market_price、account_balances、account_positions、token_metadata;交易类有 trade_open、trade_close、trade_open_eip712、trade_close_eip712、trade_limit_open、trade_limit_orders、trade_limit_close、trade_limit_states;资金类有 transfer_send、subaccount_deposit、subaccount_withdraw;跨链类有 bridge_withdraw_to_eth、bridge_debridge_quote、bridge_debridge_send;以及 evm_broadcast。

限制与注意事项:需 Node.js v22 或更高(node -v 检查)。使用 MetaMask 的 EIP-712 签名必须用 V2(getEip712TypedDataV2 与 SIGN_EIP712_V2),V1 会静默产生无效签名;getEip712TypedDataV2 与 createTransaction 必须传入完全相同的 fee 对象;evmChainId 可为任意 EVM 链,但需从 eth_chainId 读取并同时传入 EIP-712 domain 与 createWeb3Extension。fromJSON 会内部乘 10^18,链上单位需 price/margin 先乘 10^6;保证金建议加 1–2% 缓冲,并按 max(oraclePrice, markPrice) 校验;平仓用 margin '0'(reduce-only)且滑点用 1%。银行余额与交易子账户余额不同,下单前需先 subaccount_deposit。部署时 server.js 若从 dist/ 提供文件,需把构建产物放到 dist/,并对 HTML 设置 no-cache 头。本技能不依赖其他技能。