# Token Info MCP Server
## Background
Token listing and security analysis requires comprehensive information about smart contracts, including their upgrade mechanisms, access controls, and ownership structures. This analysis is critical for understanding:
- **Proxy Structure**: Whether contracts are upgradeable and who controls upgrades
- **Access Control**: What roles exist and who has administrative privileges
- **Address Analysis**: Whether addresses are EOAs, contracts, or multisigs
- **Ownership Chain**: Complete hierarchy from proxy to ultimate controllers
- **Security Assessment**: Centralization risks and admin renouncement status
## Problem
The manual process of gathering this information is tedious and error-prone:
- **Multiple Tools**: Requires switching between Etherscan, cast commands, and manual analysis
- **Time Consuming**: Each contract analysis can take 15-30 minutes of manual work
- **Human Error**: Easy to miss important details or misinterpret results
- **Inconsistent**: Different analysts may capture information differently
- **Scalability**: Analyzing hundreds of tokens manually is impractical
## Solution
The Token Info MCP Server provides automated contract analysis through Claude Desktop, offering:
**Three Main Tools:**
- `get_proxy_admin`: Comprehensive proxy and ownership analysis
- `get_contract_roles`: AccessControl role discovery and member tracking
- `check_address_type`: EOA/contract/multisig identification with threshold details
**Key Features:**
- **Accurate Proxy Detection**: Uses EIP-1967 storage verification to distinguish real proxies
- **Complete Ownership Chains**: Maps full control hierarchy from proxy to ultimate owner
- **Multisig Analysis**: Identifies Gnosis Safe and other multisig types with thresholds
- **Multiple Networks**: Supports Ethereum, Polygon, Arbitrum, and custom RPC endpoints
- **Natural Language**: Query contracts using plain English through Claude Desktop
## Installation/Getting Started
### Prerequisites
- Python 3.10+
- [Foundry](https://book.getfoundry.sh/getting-started/installation) (for proxy analysis)
- [Claude Desktop](https://claude.ai/download)
- Etherscan API key
### Quick Setup
1. **Clone and install dependencies:**
```bash
git clone <repository>
cd token-info
pip install -r requirements.txt
```
2. **Configure environment:**
```bash
cp .env.example .env
# Edit .env with your Etherscan API key and RPC URLs
```
3. **Configure Claude Desktop:**
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"token-info": {
"command": "/absolute/path/to/token-info/run_server.sh"
}
}
}
```
### Example Usage
```
Analyze the USDC contract at 0xA0b86a33E6441b2c20Ed5b0e15e0C6bfC9a57f9D -
what's the proxy structure and who controls upgrades?
```
The server will automatically:
- Detect proxy type and admin address
- Identify if admin is EOA, contract, or multisig
- Map complete ownership chain
- Analyze access control roles
- Provide security assessment
## References
- [MCP Documentation](https://modelcontextprotocol.io/)
- [Foundry Installation](https://book.getfoundry.sh/getting-started/installation)
- [EIP-1967 Proxy Standard](https://eips.ethereum.org/EIPS/eip-1967)
- [OpenZeppelin AccessControl](https://docs.openzeppelin.com/contracts/4.x/access-control)