Get the FREE Ultimate OpenClaw Setup Guide →

linea

A Model Context Protocol (MCP) server that provides on-chain tools for AI applications to interact with the Linea blockchain.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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)

  1. Install globally npm install -g linea-mcp
  2. 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
  3. Start the server linea-mcp

Option B: Development Install (From Source)

  1. Clone the repository git clone https://github.com/qvkare/linea-mcp.git cd linea-mcp
  2. Install dependencies npm install
  3. Configure environment cp .env.example .env

    Edit .env with your configuration

  4. 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

Sponsor this space

Reach thousands of developers