Polygon MCP Server
Interact with the Polygon PoS blockchain seamlessly. Call contract functions, check ERC20 token balances, transfer tokens, and get current gas prices with ease. Enhance your Claude AI capabilities by integrating onchain tools directly into your applications.
Installation
Installing for Claude Desktop
Option 1: One-Command Installation
npx mcpbar@latest install Dablclub/polygon-mcp -c claudeThis command will automatically install and configure the Polygon MCP Server MCP server for your selected client.
Option 2: Manual Configuration
Run the command below to open your configuration file:
npx mcpbar@latest edit -c claudeAfter opening your configuration file, copy and paste this configuration:
View JSON configuration
{
"mcpServers": {
"Polygon MCP Server": {
"command": "node",
"args": [
"/path/to/polygon-mcp/build/index.js"
],
"env": {
"SEED_PHRASE": "your twelve word seed phrase here"
},
"disabled": false,
"autoApprove": []
}
}
}Polygon MCP Server
A Model Context Protocol (MCP) server that provides onchain tools for Claude AI, allowing it to interact with the Polygon PoS blockchain.
Features
- Call contract functions on Polygon PoS
- Get ERC20 token balances
- Transfer ERC20 tokens
- Get current gas prices
Installation
- Clone this repository:
git clone https://github.com/your-username/polygon-mcp.git
cd polygon-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Create a .env file in the root directory with the following variables:
SEED_PHRASE="your twelve word seed phrase here"
Usage
Running the server
npm start
Using with 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": "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": []
}
}
}
Available Tools
call_contract
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 transaction
erc20_balance
Get the balance of an ERC20 token on Polygon PoS.
Parameters:
contractAddress: The address of the contract to get the balance of
erc20_transfer
Transfer 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 transfer
get_gas_price
Get the current gas price on Polygon PoS.
License
MIT
Stars
7Forks
6Last commit
7 months agoRepository age
8 months
Auto-fetched from GitHub .
MCP servers similar to Polygon MCP Server:
Stars
Forks
Last commit
Stars
Forks
Last commit
Stars
Forks
Last commit