lenina-mcp
Provides an RPC proxy for sending standard Ethereum JSON-RPC requests to the managed Anvil instance, enabling queries and operations against an Ethereum-compatible development chain.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Lenina MCP Server
MCP (Model Context Protocol) Server for Lenina - Anvil Management.
Architecture
AI Assistant ←MCP→ lenina-mcp ←REST→ Lenina API ←→ Anvil ServerAnvil: Blockchain development server (by Foundry)
Lenina: RESTful API server that manages Anvil instances
lenina-mcp: MCP server that wraps the Lenina REST API for AI assistants
This server exposes all Lenina REST API endpoints as MCP tools, enabling AI coding assistants (Cursor, Cline, etc.) to control Anvil instances remotely.
Related MCP server: Linode MCP Server
Features
RESTful Integration: Wraps the Lenina REST API as MCP tools
Full Lenina API Coverage: All 9 Lenina API endpoints exposed as MCP tools
Type-Safe: All tools use Pydantic models for parameter validation
Async: Built with async/await for optimal performance
No Authentication: Designed for local development only (matching Lenina)
Installation
pip install -r requirements.txtOr using uv:
uv pip install -r requirements.txtConfiguration
The server connects to Lenina API at a configurable base URL:
Default:
http://localhost:8000Environment Variable: Set
LENINA_BASE_URLto change (not yet implemented, hardcoded inmcp_server.py)
To change the URL, edit the LENINA_BASE_URL constant in mcp_server.py.
Running the Server
python mcp_server.pyOr using the installed command:
lenina-mcpAvailable Tools
Health Check
health_check: Verify connectivity to Lenina API
Anvil Lifecycle
anvil_start: Start an Anvil instance with configurationport(default: 8545): Port to run Anvil onchainId(default: 31337): Chain IDblockTime(default: 0): Block time in seconds (0 = manual mining)gasLimit(default: 30000000): Gas limit per blockmnemonic(optional): Mnemonic for deterministic accounts
anvil_stop: Stop the running Anvil instanceanvil_restart: Restart Anvil with optional new configurationSame parameters as
anvil_start
Status and Configuration
anvil_status: Get current Anvil status (running state, PID, uptime, port)get_config: Get the current Anvil configuration
Keys and Accounts
get_private_keys: Get all private keys and account informationReturns list of accounts with addresses and private keys
Includes mnemonic if configured
Contract Management
get_contract: Check if contract exists at addressaddress: The contract address (0x-prefixed)Uses
eth_getCodeto verify contract deployment
RPC Proxy
rpc_proxy: Send JSON-RPC requests to Anvilmethod: RPC method name (e.g.,eth_blockNumber,eth_getBalance)params: Method parameters (list)request_id: JSON-RPC request ID (default: 1)Supports all standard Ethereum JSON-RPC methods
MCP Client Configuration
Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"lenina": {
"command": "python",
"args": ["/path/to/lenina-mcp/mcp_server.py"],
"cwd": "/path/to/lenina-mcp"
}
}
}Cline
Add to your Cline MCP settings:
{
"mcpServers": [
{
"name": "lenina",
"command": "python",
"args": ["/path/to/lenina-mcp/mcp_server.py"],
"cwd": "/path/to/lenina-mcp"
}
]
}Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"lenina": {
"command": "python",
"args": ["/path/to/lenina-mcp/mcp_server.py"],
"cwd": "/path/to/lenina-mcp"
}
}
}Example Usage
Once connected, you can use natural language commands like:
"Start Anvil on port 8545 with chain ID 31337"
"Check if Anvil is running"
"Get the private keys for the first 3 accounts"
"What's the current block number?" (uses rpc_proxy)
"Stop the Anvil instance"
Lenina Skill for AI Assistants
This project includes a skill file (skills/lenina.md) that teaches AI assistants how to use Lenina for managing Anvil servers remotely.
Install the Skill
For Claude Desktop:
cp skills/lenina.md ~/.claude/skills/For Opencode:
cp skills/lenina.md ~/.config/opencode/skills/For Codex:
cp skills/lenina.md ~/.codex/skills/For Gemini CLI:
cp skills/lenina.md ~/.gemini/skills/After copying, the AI assistant will automatically learn how to:
Start, stop, and restart Anvil instances
Get the correct RPC URL using
get_config(essential for connecting tools like Hardhat, Foundry, MetaMask)Manage accounts and private keys
Deploy and interact with smart contracts
Debug using Anvil logs and RPC proxy
Why Use the Skill
The skill includes critical guidance on:
Checking
get_config: Always run this to get the correct host and port before connecting development toolsNetwork configuration: How to connect when Anvil runs on a remote machine
Common workflows: Standard patterns for development, debugging, and testing
Security warnings: Important notes about private keys and local-only usage
Development
Type Checking
mypy --strict mcp_server.pyRunning Tests
(No tests implemented yet)
Requirements
Python 3.10+
Lenina REST API server running at
http://localhost:8000(or configured URL)Anvil (installed via Foundry)
Dependencies
mcp>=1.0.0: MCP protocol implementationfastmcp>=0.1.0: FastMCP server frameworkhttpx>=0.27.0: Async HTTP clientpydantic>=2.0.0: Data validationpydantic-settings>=2.0.0: Settings management
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Create, watch, pay for and connect hosted AI agent pods on AgentsPodium. Needs an API key.
Create, configure and manage an AI phone receptionist. Requires a Fonixia account.
Give your AI hands. Identity, credential vault, and API gateway for autonomous agents.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables interaction with the RunPod REST API to manage GPU pods, serverless endpoints, templates, network volumes, and container registry authentications through natural language.261MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Linode cloud infrastructure, enabling the management of compute instances, databases, and networking resources through natural language. It provides a comprehensive suite of tools for resource orchestration, monitoring, and account management using stdio, SSE, or HTTP transports.21MIT
- AlicenseAqualityDmaintenanceProvides an interface to the CloudNet Service REST API v3, enabling AI assistants to observe and manage CloudNet nodes, services, and players.9MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Obsidian vaults via the local REST API, supporting CRUD operations, batch processing, templates, and vault analytics.MIT