linea
A Model Context Protocol (MCP) server that provides on-chain tools for AI applications to interact with the Linea blockchain.
claude mcp add --transport stdio qvkare-linea-mcp npx linea-mcp@latest \ --env PORT="3000" \ --env NODE_ENV="development" \ --env INFURA_API_KEY="your_infura_key_here" \ --env ALCHEMY_API_KEY="your_alchemy_key_here" \ --env ETHEREUM_RPC_URL="https://mainnet.infura.io/v3/your_infura_key" \ --env WALLET_PRIVATE_KEY="your_wallet_private_key_or_mnemonic" \ --env LINEA_MAINNET_RPC_URL="https://rpc.linea.build" \ --env LINEA_TESTNET_RPC_URL="https://rpc.sepolia.linea.build" \ --env ETHEREUM_TESTNET_RPC_URL="https://sepolia.infura.io/v3/your_infura_key" \ --env PRIVATE_KEY_ENCRYPTION_KEY="your_encryption_key_here"
How to use
Linea MCP Server provides a suite of on-chain tools for interacting with the Linea blockchain, enabling AI assistants and MCP-compatible clients to perform wallet management, token operations, smart contract interactions, NFT handling, bridging, DeFi activities, Verax identity verifications, and Linea ENS operations. Clients can connect to the Linea MCP server using a configured MCP entry (e.g., linea) and issue natural-language or structured requests that map to these tools. The server is designed to work with common MCP clients like Cursor, Claude Desktop, Windsurf, and others, translating high-level requests into blockchain actions via the Linea RPC endpoints. If you experience tool lookup or protocol issues, prefer direct Node.js execution of the server for more reliable communication. Start by configuring the server in your MCP client with the provided linea entry, including environment variables for RPC endpoints and keys.
Available capabilities include wallet address retrieval and balance checks, ERC20 token transfers and balance inquiries, contract deployment and contract function calls, listing and transferring NFTs, asset bridging between Ethereum and Linea, DeFi protocol interactions (liquidity, swaps, yields), Verax identity attestations, and Linea ENS resolution and management. The server exposes an organized set of tools under categories such as Wallet, Tokens, Contracts, NFTs, Bridge, DeFi, ENS, and Verax, each with usage guidance in the project's docs.
How to install
Prerequisites
- Node.js v16+ (recommended)
- npm or yarn
- Access to Linea RPC endpoints (mainnet and/or testnet) and any required API keys
Option A: Quick Install (Global Package)
- Install globally npm install -g linea-mcp
- Create a basic .env file with necessary configuration (example shown): LINEA_MAINNET_RPC_URL=https://rpc.linea.build LINEA_TESTNET_RPC_URL=https://rpc.sepolia.linea.build WALLET_PRIVATE_KEY=your_wallet_private_key_here INFURA_API_KEY=your_infura_key_here
- Start the server linea-mcp
Option B: Development Install (From Source)
- Clone the repository git clone https://github.com/qvkare/linea-mcp.git cd linea-mcp
- Install dependencies npm install
- Configure environment
cp .env.example .env
Edit .env with your configuration
- Build and start npm run build node dist/index.js # Using Node directly is more reliable than npm start
Notes
- If you run into issues with npm scripts, running the built JavaScript directly with Node.js is recommended for stability.
Additional notes
Tips and common issues:
- If you see "No tools available" or similar, prefer starting the server using Node.js directly (node dist/index.js) or via the explicit npm package entry (linea-mcp) rather than npm start scripts.
- Ensure all RPC URLs (LINEA_MAINNET_RPC_URL, LINEA_TESTNET_RPC_URL) and API keys (INFURA_API_KEY, ALCHEMY_API_KEY) are correctly set in your environment.
- When using a local installation, set cwd and absolute paths in your MCP configuration to avoid JSON parsing or protocol issues.
- For troubleshooting, consult the docs/troubleshooting.md equivalent in the repository for detailed guidance on common problems and environment setups.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
MiniMax -JS
Official MiniMax Model Context Protocol (MCP) JavaScript implementation that provides seamless integration with MiniMax's powerful AI capabilities including image generation, video generation, text-to-speech, and voice cloning APIs.
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
akyn-sdk
Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.
promptboard
The Shared Whiteboard for Your AI Agents via MCP. Paste screenshots, mark them up, and share with AI.