Polygon区块链集成
STDIO用于区块链交互的Claude AI工具
用于区块链交互的Claude AI工具
A Model Context Protocol (MCP) server that provides onchain tools for Claude AI, allowing it to interact with the Polygon PoS blockchain.
git clone https://github.com/your-username/polygon-mcp.git cd polygon-mcp
npm install
npm run build
Create a .env
file in the root directory with the following variables:
SEED_PHRASE="your twelve word seed phrase here"
npm start
To use this MCP server with Claude, you need to add it to your MCP settings file:
For VSCode Claude extension:
{ "mcpServers": { "polygon": { "command": "node", "args": ["/path/to/polygon-mcp/build/index.js"], "env": { "SEED_PHRASE": "your twelve word seed phrase here" }, "disabled": false, "autoApprove": [] } } }
For Claude desktop app:
{ "mcpServers": { "polygon": { "command": "node", "args": ["/path/to/polygon-mcp/build/index.js"], "env": { "SEED_PHRASE": "your twelve word seed phrase here" }, "disabled": false, "autoApprove": [] } } }
Call a contract function on Polygon PoS.
Parameters:
contractAddress
: The address of the contract to callfunctionName
: The name of the function to callfunctionArgs
: The arguments to pass to the functionabi
: The ABI of the contractvalue
(optional): The value of MATIC to send with the transactionGet the balance of an ERC20 token on Polygon PoS.
Parameters:
contractAddress
: The address of the contract to get the balance ofTransfer an ERC20 token on Polygon PoS.
Parameters:
contractAddress
: The address of the contract to transfer the token fromtoAddress
: The address of the recipientamount
: The amount of tokens to transferGet the current gas price on Polygon PoS.
MIT