Linea MCP Server

by qvkare

2 208 downloads Not rated yet MIT

About

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

Details

License
MIT

Explore

- Wallet Management: Retrieve addresses and check balances
- Token Operations: Transfer ERC20 tokens, check balances, list tokens
- Smart Contract Interactions: Deploy and call contracts
- NFT Management: List and transfer NFTs
- Bridge Operations: Bridge assets between Ethereum and Linea
- DeFi Integrations: Interact with DeFi protocols
- Verax Integration: Verify identity with Linea Verax attestations
- Linea ENS: Resolve and manage Linea ENS names

See examples.md for detailed usage examples.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Linea MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Node.js (v16+)
- npm or yarn
- Access to Linea RPC endpoints


npm install -g linea-mcp

bash

npm install

cp .env.example .env

1. Find your client's MCP configuration file location
2. Add a Linea MCP server configuration section
3. Configure the server using one of the following approaches:

{
  "mcpServers": {
    "linea": {
      "command": "npx",
      "args": ["linea-mcp@latest"],
      "env": {
        "PORT": "3000",
        "LINEA_MAINNET_RPC_URL": "https://rpc.linea.build",
        "LINEA_TESTNET_RPC_URL": "https://rpc.sepolia.linea.build",
        "INFURA_API_KEY": "your_infura_key",
        "ALCHEMY_API_KEY": "your_alchemy_key",
        "PRIVATE_KEY_ENCRYPTION_KEY": "your_encryption_key_please_change",
        "WALLET_PRIVATE_KEY": "your_wallet_private_key_or_mnemonic",
        "NODE_ENV": "development",
        "ETHEREUM_RPC_URL": "https://mainnet.infura.io/v3/your_infura_key",
        "ETHEREUM_TESTNET_RPC_URL": "https://sepolia.infura.io/v3/your_infura_key"
      }
    }
  }
}
{
  "mcpServers": {
    "linea": {
      "command": "node",
      "args": ["/absolute/path/to/linea-mcp/dist/index.js"],
      "cwd": "/absolute/path/to/linea-mcp",
      "env": {
        // Same environment variables as Option 1
        "PORT": "3000",
        "LINEA_MAINNET_RPC_URL": "https://rpc.linea.build",
        // ... other variables from Option 1
      }
    }
  }
}

> Important Note: When using a local installation, directly running the JavaScript file with Node.js provides more reliable communication than using npm scripts.

The server provides tools across multiple categories:

- Wallet: Address management, balance checking, fund transfers
- Tokens: ERC20 transfers, balance checking, token information
- Contracts: Deployment and interaction
- NFTs: Listing and transfers
- Bridge: Asset bridging between Ethereum and Linea
- DeFi: Liquidity pools, token swaps, yield farming
- ENS: Name resolution and record management
- Verax: Identity verification

For a complete list of tools and their usage, see docs/tools.md.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "linea mcp server": {
            "linea-mcp": {
                "command": "node",
                "args": [
                    "dist/index.js",
                    "#",
                    "Using",
                    "Node",
                    "directly",
                    "is",
                    "more",
                    "reliable",
                    "than",
                    "npm",
                    "start"
                ]
            }
        }
    }
}

McpServers

{
    "linea-mcp": {
        "command": "node",
        "args": [
            "dist/index.js",
            "#",
            "Using",
            "Node",
            "directly",
            "is",
            "more",
            "reliable",
            "than",
            "npm",
            "start"
        ]
    }
}

<div align="center">
Linea MCP Logo
</div>

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

Ask DeepWiki
npm version
License: MIT

Overview

Linea-MCP extends any MCP client's capabilities by providing tools to interact with the Linea blockchain, an Ethereum Layer 2 scaling solution using zero-knowledge proof technology. This server enables AI assistants like Claude, Cursor, and other MCP-compatible clients to perform blockchain operations through natural language requests.

Key Features

- Wallet Management: Retrieve addresses and check balances
- Token Operations: Transfer ERC20 tokens, check balances, list tokens
- Smart Contract Interactions: Deploy and call contracts
- NFT Management: List and transfer NFTs
- Bridge Operations: Bridge assets between Ethereum and Linea
- DeFi Integrations: Interact with DeFi protocols
- Verax Integration: Verify identity with Linea Verax attestations
- Linea ENS: Resolve and manage Linea ENS names

See examples.md for detailed usage examples.

Quick Start

Prerequisites

- Node.js (v16+)
- npm or yarn
- Access to Linea RPC endpoints

Installation Options

Option 1: Quick Install (Global Package)

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.