crypto-allowance-manager
A utility service designed to inspect and nullify pre-existing ERC-20 token spending authorizations, facilitate the management of token permissions across various supported blockchains, and offer continuous monitoring of digital asset access rights for robust wallet security posture.
Author

kukapay
Quick Info
Actions
Tags
Crypto Allowance Sentinel (CAS)
This specialized MCP module serves as a dedicated endpoint for reviewing and terminating established ERC-20 token spending limits, thereby reinforcing digital asset control and security.
Core Functionality
- Retrieve Token Authorizations: Gathers comprehensive data on all current ERC20 token grants associated with a given cryptographic address on a specified network, detailing token metadata, current holdings, and estimated financial exposure.
- Authorization Termination: Executes on-chain transactions specifically designed to set the approved spending ceiling for selected token/spender pairs back to zero.
- Verification of Operations: Provides mechanisms to confirm the final state (success or failure) of submitted revocation transactions via their unique transaction identifiers.
- Broad Network Interoperability: Supports interaction with upwards of fifty distinct EVM-compatible ledger environments, encompassing primary networks (e.g., Ethereum Mainnet, Polygon PoS, BNB Smart Chain) and development/testing environments (e.g., Goerli, Mumbai).
System Requirements
- Node.js Runtime: Minimum version 18 is mandated to leverage modern built-in network utilities.
- API Credential: An active subscription key for the Moralis decentralized data service is necessary for retrieving off-chain approval ledger data.
- Signing Key: The private cryptographic key corresponding to the controlling wallet address must be supplied to authorize outgoing revocation transactions.
Deployment Instructions
-
Repository Cloning: bash git clone https://github.com/kukapay/token-revoke-mcp.git cd token-revoke-mcp
-
Dependency Installation: bash npm install
-
Client Environment Mapping:
{ "mcpServers": { "crypto-allowance-manager": { "command": "node", "args": ["path/to/token-revoke-mcp/index.js"], "env": { "MORALIS_API_KEY": "your-key-here", "PRIVATE_KEY": "your-signing-key-here" } } } }
Operational Examples
These scenarios illustrate the anticipated raw data response when interacting with the service via natural language commands processed by a client interface.
Scenario 1: Auditing Approvals
User Query:
"Display all active token spending permissions for my address on the Polygon network."
Service Output (Content Array Raw Text):
[ { "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" } ]
Scenario 2: Revoking a Specific Grant
User Query:
"Please execute a nullification for the token 0x2791bca1f2de4661ed88a30c99a7a9449aa84174 granting access to spender 0x1111111254eeb25477b68fb85ed929f73a960582 on the BNB Smart Chain."
Service Output (Content Array Raw Text):
Authorization revocation transaction dispatched on bsc. Txn ID: 0x123.... Note: Confirmation processing is ongoing.
Scenario 3: Checking Operation Confirmation Status
User Query:
"What is the current processing state for transaction hash 0x123... on BSC?"
Service Output (Content Array Raw Text) (Possible States): - In Progress:
Transaction 0x123... on bsc remains unconfirmed or has not yet propagated across the network.
- Confirmed:
Transaction 0x123... on bsc has finalized successfully. Confirmed at block: 12345.
- Reverted:
Transaction 0x123... on bsc concluded with a failure status. Block number reached: 12345.
Supported Environments
The underlying service integrates with a broad spectrum of EVM-compliant ledgers, leveraging the comprehensive chain mapping provided by the Moralis SDK, found within chaindata.ts. Examples include:
- Major Networks: ethereum, polygon, bsc, avalanche, fantom, arbitrum, optimism, etc.
- Test Networks: goerli, mumbai, bsc testnet, arbitrum goerli, optimism sepolia, etc.
- Comprehensive List: Refer to the SUPPORTED_CHAINS constant defined within the core server logic file (server.js).
Legal Notice
This software is distributed under the stipulations of the MIT License. Detailed terms are available in the accompanying [LICENSE] file.
