Token Revoke MCP is a specialized server that implements the Model Context Protocol (MCP) to check and revoke ERC-20 token allowances. It provides a secure way to manage token permissions across multiple blockchain networks, allowing users to monitor approvals and revoke unwanted access to their tokens.
Before installing the Token Revoke MCP server, ensure you have:
fetch
support)git clone https://github.com/kukapay/token-revoke-mcp.git
cd token-revoke-mcp
npm install
Add the following configuration to your MCP client setup:
{
"mcpServers": {
"token-revoke-mcp": {
"command": "node",
"args": ["path/to/token-revoke-mcp/index.js"],
"env": {
"MORALIS_API_KEY": "your moralis api key",
"PRIVATE_KEY": "your wallet private key"
}
}
}
}
The server responds to natural language prompts by converting them into appropriate tool calls. Here are some common usage scenarios:
When you want to check what token approvals exist for a wallet:
Example Prompt:
"Show me all the token approvals for my wallet on Polygon."
Expected Response:
[
{
"tokenAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"tokenSymbol": "USDC",
"balance": "100.5",
"usdPrice": "1.00",
"usdValueAtRisk": "50.25",
"spenderAddress": "0x1111111254eeb25477b68fb85ed929f73a960582",
"approvedAmount": "1000.0",
"transactionHash": "0xabc...",
"timestamp": "2023-10-01T12:00:00Z"
}
]
To revoke a specific token allowance:
Example Prompt:
"Revoke the allowance for token 0x2791bca1f2de4661ed88a30c99a7a9449aa84174 to spender 0x1111111254eeb25477b68fb85ed929f73a960582 on BSC."
Expected Response:
Allowance revocation submitted on bsc. Transaction hash: 0x123.... Note: Transaction is not yet confirmed.
To verify if a revocation transaction was successful:
Example Prompt:
"Did my transaction 0x123... on BSC go through?"
Possible Responses:
For pending transactions:
Transaction 0x123... on bsc is still pending or not found.
For successful transactions:
Transaction 0x123... on bsc has completed with status: successful. Block number: 12345.
For failed transactions:
Transaction 0x123... on bsc has completed with status: failed. Block number: 12345.
The server works with numerous EVM-compatible blockchains including:
The full list of supported chains is defined in the SUPPORTED_CHAINS
variable in the server code.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.