A Model Context Protocol (MCP) server that provides onchain tools for Claude AI, allowing it to interact with the Polygon PoS blockchain.
- Call contract functions on Polygon PoS
- Get ERC20 token balances
- Transfer ERC20 tokens
- Get current gas prices
npm install -g polygon-mcp
This will install the Polygon MCP server globally on your system.
- Clone this repository:
git clone https://github.com/Dablclub/polygon-mcp.git
cd polygon-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
Create a .env
file in the root directory with the following variables:
SEED_PHRASE="your twelve word seed phrase here"
If installed globally via npm:
polygon-mcp
If installed from source:
npm start
A test script is included to demonstrate how to use the Polygon MCP server tools:
node test-polygon-mcp.js
This script will show examples of how to use each of the available tools in Claude.
To use this MCP server with Claude, you need to add it to your MCP settings file:
For VSCode Claude extension:
{
"mcpServers": {
"polygon": {
"command": "polygon-mcp",
"env": {
"SEED_PHRASE": "your twelve word seed phrase here"
},
"disabled": false,
"autoApprove": []
}
}
}
For Claude desktop app:
{
"mcpServers": {
"polygon": {
"command": "polygon-mcp",
"env": {
"SEED_PHRASE": "your twelve word seed phrase here"
},
"disabled": false,
"autoApprove": []
}
}
}
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 call -
functionName
: The name of the function to call -
functionArgs
: The arguments to pass to the function -
abi
: The ABI of the contract -
value
(optional): The value of MATIC to send with the transaction
Get the balance of an ERC20 token on Polygon PoS.
Parameters:
-
contractAddress
: The address of the contract to get the balance of
Transfer an ERC20 token on Polygon PoS.
Parameters:
-
contractAddress
: The address of the contract to transfer the token from -
toAddress
: The address of the recipient -
amount
: The amount of tokens to transfer
Get the current gas price on Polygon PoS.
This MCP server is being submitted to the Cline MCP Marketplace. The submission details can be found in the mcp-marketplace-submission.md
file.
To complete the submission, you'll need to:
- Create a new issue in the MCP Marketplace repository
- Follow the submission steps outlined in the
mcp-marketplace-submission.md
file - Attach the logo image (
assets/logo.png
) to your submission
MIT