asterai-mcp
v0.0.2
Published
An MCP server implementation that generates and manages smart contract interactions using ABI (Application Binary Interface), providing both read and write capabilities for blockchain interactions.
Readme
AsterAI MCP Server
An MCP server implementation that generates and manages smart contract interactions using ABI (Application Binary Interface), providing both read and write capabilities for blockchain interactions.
Features
- ABI Tool Generation: Automatically generate tools from contract ABIs
- Smart Contract Interaction: Read and write operations with type safety
- Transaction Management: Handle contract transactions with gas estimation
- Event Listening: Subscribe to contract events
- Multi-Chain Support: Works with EVM-compatible chains
- Error Handling: Comprehensive error management and reporting
- Auto Environment Variables: Automatically generates environment variables from contract ABI
Getting Started
There are two ways to configure MCP for Claude Desktop:
- Using direct ABI:
{
"mcpServers": {
"asterai-mcp": {
"command": "npx",
"args": ["-y", "asterai-mcp"],
"env": {
"RPC_PROVIDER_URL": "YOUR_RPC_URL",
"WALLET_PRIVATE_KEY": "YOUR_PRIVATE_KEY",
"CONTRACT_ABI": "YOUR_CONTRACT_ABI",
"CONTRACT_ADDRESS": "YOUR_CONTRACT_ADDRESS"
}
}
}
}- Fetching contract information on-chain:
{
"mcpServers": {
"asterai-mcp": {
"command": "npx",
"args": ["-y", "asterai-mcp"],
"env": {
"RPC_PROVIDER_URL": "YOUR_RPC_URL",
"WALLET_PRIVATE_KEY": "YOUR_PRIVATE_KEY",
"CONTRACT_ADDRESS": "YOUR_CONTRACT_ADDRESS",
"ETHERSCAN_API_KEY": "YOUR_ETHERSCAN_API_KEY"
}
}
}
}Auto-Generated Environment Variables
The server automatically generates environment variables based on your configuration:
When using direct ABI:
CONTRACT_ABI: The full contract ABI in JSON format (stringify)
When fetching on-chain:
CONTRACT_ADDRESS: The deployed contract addressETHERSCAN_API_KEY: Your Etherscan API key for fetching contract ABI
Choose the method that best suits your needs:
- Use direct ABI if you already have the contract ABI and want to avoid API calls
- Use on-chain fetching if you want to work with deployed contracts and have access to Etherscan API
These variables are automatically available in your MCP tools and can be used for contract interactions.
- Copy the configuration to Claude's config directory:
cp mcp-config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json- Restart Claude Desktop
Usage with Claude Desktop
After setup, you can use the following commands in Claude:
- Generate contract tools from ABI
- Read contract state
- Send transactions
- Listen to contract events
- Get transaction receipts
- Estimate gas costs
License
MIT
