The Sei MCP Server supports configuration through environment variables, which can be set in your MCP configuration JSON or passed directly to the Node.js command.

Configuration Methods

Add environment variables to your MCP server configuration:
{
  "mcpServers": {
    "sei": {
      "command": "npx",
      "args": ["-y", "@sei-js/mcp-server"],
      "env": {
        "WALLET_MODE": "private-key",
        "PRIVATE_KEY": "0x123...",
        "MAINNET_RPC_URL": "https://your-custom-rpc.com"
      }
    }
  }
}

Available Variables

Wallet Configuration

WALLET_MODE

  • Type: string
  • Default: "disabled"
  • Description: Controls wallet functionality and transaction capabilities
  • Options:
    • "disabled" - Read-only mode, no transaction capabilities
    • "private-key" - Enable wallet tools using private key

PRIVATE_KEY

  • Type: string
  • Default: -
  • Description: Private key for wallet operations (required when WALLET_MODE=“private-key”)
  • Format: 0x-prefixed hex string (64 characters after 0x)
Security Critical: Never commit private keys to version control. Use a dedicated test wallet with minimal funds.

Network Configuration

MAINNET_RPC_URL

  • Type: string
  • Default: "https://evm-rpc.sei-apis.com"
  • Description: Custom RPC endpoint for Sei mainnet
  • Use Case: Private RPC providers, local nodes, or custom endpoints

TESTNET_RPC_URL

  • Type: string
  • Default: "https://evm-rpc-testnet.sei-apis.com"
  • Description: Custom RPC endpoint for Sei testnet (Atlantic-2)
  • Use Case: Testing with custom infrastructure

DEVNET_RPC_URL

  • Type: string
  • Default: "https://evm-rpc-arctic-1.sei-apis.com"
  • Description: Custom RPC endpoint for Sei devnet
  • Use Case: Development and experimental features

Server Configuration

SERVER_TRANSPORT

  • Type: string
  • Default: "stdio"
  • Description: Transport mode for the MCP server
  • Options:
    • "stdio" - Standard input/output (default for AI assistants)
    • "streamable-http" - Streamable HTTP transport (recommended for web apps)
    • "http-sse" - HTTP Server-Sent Events (deprecated)

SERVER_PORT

  • Type: number
  • Default: 8080
  • Description: Port number for HTTP transports (http-sse, streamable-http)
  • Range: 1-65535

SERVER_HOST

  • Type: string
  • Default: "localhost"
  • Description: Host address for HTTP server
  • Use Case: Bind to specific network interfaces

SERVER_PATH

  • Type: string
  • Default: "/mcp"
  • Description: Base path for HTTP endpoints
  • Format: Must start with / (automatically normalized)

System Configuration

PATH

  • Type: string
  • Default: System PATH
  • Description: Override PATH to specify Node.js version
  • Use Case: Troubleshooting Node.js version conflicts

Configuration Examples

Security Best Practices

Test Wallet Only

Use a dedicated wallet for testing, not your main holdings

Minimal Funds

Keep only small amounts needed for testing transactions

Secure Storage

Never commit private keys to version control or share them

Regular Rotation

Rotate test wallet keys periodically for security

Troubleshooting

Common Issues

Private Key Format
  • Must start with 0x
  • Must be exactly 66 characters (0x + 64 hex characters)
  • Use lowercase hex characters
RPC Connection
  • Verify custom RPC URLs are accessible
  • Check for rate limiting on custom endpoints
  • Ensure RPC supports required methods
Environment Variables Not Loading
  • Restart your AI assistant after configuration changes
  • Verify JSON syntax in MCP configuration
  • Check for typos in variable names

Need More Help?

Check our comprehensive troubleshooting guide for solutions to specific problems.