1Money网络协议服务器

1Money网络协议的MCP服务器,提供账户、代币、交易等API端点以及签名、哈希等实用工具。

  • by 1Money-Co
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 1Money-Co/1moneynetwork-mcp

使用说明

1Money网络MCP

1Money网络协议的MCP(stdio)服务器,由 @1money/protocol-ts-sdk.

此MCP服务器的功能

  • 公开协议API端点(帐户、令牌、交易、检查点、链)作为MCP工具。
  • 包括用于签名、哈希、RLP编码和地址推导的实用工具。
  • 使用SDK客户端配置并尊重网络/基础URL/超时。

配置

环境变量:

  • ONEMONEY_PROTOCOL_NETWORK: testnet, mainnet,或 local (默认值: testnet)
  • ONEMONEY_PROTOCOL_BASE_URL:覆盖网络基础URL
  • ONEMONEY_PROTOCOL_TIMEOUT_MS:请求超时(毫秒)(默认值: 10000)
  • ONEMONEY_PROTOCOL_HEADERS:所有请求中包含的可选JSON标头字符串(仅自定义网关/代理需要)

示例 .env 文件(参见 .env.example):

export ONEMONEY_PROTOCOL_NETWORK=testnet
export ONEMONEY_PROTOCOL_TIMEOUT_MS=15000

大多数用户可以省略 ONEMONEY_PROTOCOL_HEADERS.

整合

光标(一键安装)

安装后,将配置添加到 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "1money-network": {
      "command": "npx",
      "args": ["-y", "@1money/network-mcp"],
      "env": {
        "ONEMONEY_PROTOCOL_NETWORK": "testnet"
      }
    }
  }
}

克劳德代码

在终端中运行以下命令:

claude mcp add --transport stdio 1money-network --env ONEMONEY_PROTOCOL_NETWORK=testnet -- npx -y @1money/network-mcp

克劳德桌面版

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

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
窗户: %APPDATA%\\Claude\\claude_desktop_config.json

{
  "mcpServers": {
    "1money-network": {
      "command": "npx",
      "args": ["-y", "@1money/network-mcp"],
      "env": {
        "ONEMONEY_PROTOCOL_NETWORK": "testnet"
      }
    }
  }
}

食品法典整合

将MCP服务器添加到Codex配置文件中,然后重新启动Codex:

[mcp_servers.1money-network]
command = "npx"
args = ["-y", "@1money/network-mcp"]
env = { ONEMONEY_PROTOCOL_NETWORK = "testnet" }

工具调用示例

{
  "tool": "accounts.get_nonce",
  "input": {
    "address": "0x9E1E9688A44D058fF181Ed64ddFAFbBE5CC74ff3"
  }
}
{
  "tool": "transactions.estimate_fee",
  "input": {
    "from": "0x9E1E9688A44D058fF181Ed64ddFAFbBE5CC74ff3",
    "value": "1000000000",
    "token": "0x2cd8999Be299373D7881f4aDD11510030ad1412F"
  }
}
{
  "tool": "utils.sign_message",
  "input": {
    "payload": [
      1212101,
      2,
      "0x0000000000000000000000000000000000000000",
      "1000000000000000000",
      "0x0000000000000000000000000000000000000000"
    ],
    "private_key": "0xYOUR_PRIVATE_KEY"
  }
}

注: utils.sign_message 直接接受私钥。避免在共享环境中使用真实密钥。

示例提示

  • “获取当前链id。”
  • “获取测试网上的最新检查点编号。”
  • “使用令牌0x…从0x发送1000000000个单位的估计费用。”
  • “获取0x的令牌元数据…。”
  • “导出钱包0x…和薄荷0x…的令牌帐户地址。”

工具

账户

  • accounts.get_nonce
  • accounts.get_bbnonce
  • accounts.get_token_account

链条

  • chain.get_chain_id

检查点

  • checkpoints.get_number
  • checkpoints.get_by_hash
  • checkpoints.get_by_number
  • checkpoints.get_receipts_by_number

代币

  • tokens.get_token_metadata
  • tokens.manage_blacklist
  • tokens.manage_whitelist
  • tokens.burn
  • tokens.grant_authority
  • tokens.issue
  • tokens.mint
  • tokens.pause
  • tokens.update_metadata
  • tokens.bridge_and_mint
  • tokens.burn_and_bridge

交易

  • transactions.get_by_hash
  • transactions.get_receipt_by_hash
  • transactions.get_finalized_by_hash
  • transactions.estimate_fee
  • transactions.payment

实用工具

  • utils.derive_token_address
  • utils.sign_message
  • utils.encode_payload
  • utils.to_hex
  • utils.calc_tx_hash
  • utils.typeof
  • utils.safe_promise_all
  • utils.safe_promise_line

批处理工具(utils.safe_promise_all 和 utils.safe_promise_line)接受a calls 数组 { tool, input } 物体。这 safe_promise_all 变量并行执行,并在第一个错误时失败。这 safe_promise_line variant按顺序执行并忽略错误。

模式

schemas/tools.json 是所有工具的JSON模式源。