Token Revoke MCP server

Enables secure management and revocation of ERC20 token allowances across 40+ blockchain networks, helping users protect their assets by controlling which protocols have permission to spend their tokens.
Back to servers
Provider
kukapay
Release date
Mar 29, 2025
Language
TypeScript
Stats
1 star

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.

Prerequisites

Before installing the Token Revoke MCP server, ensure you have:

  • Node.js: Version 18 or higher (required for native fetch support)
  • Moralis API Key: For fetching token approval data
  • Private Key: An Ethereum-compatible private key for signing revocation transactions

Installation

Clone and Set Up

git clone https://github.com/kukapay/token-revoke-mcp.git
cd token-revoke-mcp
npm install

Client Configuration

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"
      }
    }
  }
}

Usage Examples

The server responds to natural language prompts by converting them into appropriate tool calls. Here are some common usage scenarios:

Fetching Token Approvals

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"
  }
]

Revoking Token Allowances

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.

Checking Transaction Status

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.
    

Supported Blockchain Networks

The server works with numerous EVM-compatible blockchains including:

  • Mainnets: Ethereum, Polygon, BSC, Avalanche, Fantom, Arbitrum, Optimism, and more
  • Testnets: Goerli, Mumbai, BSC Testnet, Arbitrum Goerli, Optimism Sepolia, and others

The full list of supported chains is defined in the SUPPORTED_CHAINS variable in the server code.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later