How to List All Available Arbitrum Chains Using the Arbitrum MCP Server
The Arbitrum MCP Server aggregates both core Arbitrum networks (One and Nova) and public Orbit chains via the ChainLookupService, exposing them through the list_chains tool that returns an alphabetically sorted list of chain names.
The dewanshparashar/arbitrum-mcp repository implements a Model Context Protocol (MCP) server that provides unified access to Arbitrum network data. To list all available Arbitrum chains, the server combines on-chain data with a curated registry of Orbit chains, making it simple for AI agents and developers to discover supported networks.
How Chain Discovery Works
The ChainLookupService class in src/services/chain-lookup.ts handles the discovery and caching of chain metadata. It merges two distinct data sources into a unified dataset.
Orbit Chain Registry
The service fetches public Orbit chain definitions from a JSON file hosted in the Offchain Labs repository. The fetchChainsData() method (lines 155-168) retrieves this file from:
https://raw.githubusercontent.com/OffchainLabs/arbitrum-token-bridge/master/packages/arb-token-bridge-ui/src/util/orbitChainsData.json
This registry contains metadata for every public Orbit chain, including testnets and production networks.
Core Arbitrum Networks
In addition to Orbit chains, the service constructs objects for the two canonical Arbitrum networks by calling getArbitrumNetwork from @arbitrum/sdk:
- Arbitrum One (Chain ID
42161) - Arbitrum Nova (Chain ID
42170)
The getCoreArbitrumChains() method (lines 79-115 in src/services/chain-lookup.ts) programmatically builds these chain objects.
Data Merging and Caching
The fetchChainsData() method merges the fetched Orbit data with the core chain objects into a single OrbitChainData[] array stored in this.chainsData. To optimize performance, the service caches this merged dataset for 5 minutes (CACHE_TTL defined at lines 59-68), ensuring repeated calls do not trigger unnecessary network requests.
Listing Chain Names Programmatically
The public method listChainNames() (lines 224-227 in src/services/chain-lookup.ts) provides the primary interface for retrieving chain names. It first invokes ensureChainsData() to guarantee the cache is populated, then returns an alphabetically sorted array of the name field from every chain object.
Using the list_chains MCP Tool
The MCP server exposes a tool named list_chains that wraps the lookup service for client consumption. The handler in src/index.ts (lines 324-333) calls this.chainLookupService.listChainNames() and formats the response.
CLI Usage
Invoke the tool directly through an MCP-compatible client:
list_chains
JSON-RPC Request
Programmatic clients can call the tool via JSON-RPC:
{
"jsonrpc": "2.0",
"method": "call_tool",
"params": {
"name": "list_chains",
"arguments": {}
},
"id": 1
}
Response Format
The tool returns a text response containing the sorted list:
{
"jsonrpc": "2.0",
"result": {
"content": [
{
"type": "text",
"text": "Available chains:\nArbitrum One\nArbitrum Nova\nXai\nSuperposition\n..."
}
]
},
"id": 1
}
Direct Service Integration
For applications requiring programmatic access without the MCP protocol, import and invoke the ChainLookupService directly:
import { ChainLookupService } from "./services/chain-lookup.js";
async function showChains() {
const names = await ChainLookupService.getInstance().listChainNames();
console.log("Supported Arbitrum chains:");
console.log(names.join("\n"));
}
showChains();
This approach instantiates the singleton service and retrieves the cached chain list immediately.
Summary
- The Arbitrum MCP Server discovers chains through the
ChainLookupServiceclass located insrc/services/chain-lookup.ts. - It aggregates core networks (Arbitrum One and Nova) with public Orbit chains fetched from the Offchain Labs registry.
- Data is cached for 5 minutes to balance freshness with performance.
- Use the
list_chainstool via MCP clients or calllistChainNames()directly for programmatic access. - The response includes an alphabetically sorted list of all human-readable chain names.
Frequently Asked Questions
What chains are included when I list all available Arbitrum chains?
The list includes Arbitrum One (Chain ID 42161), Arbitrum Nova (Chain ID 42170), and every public Orbit chain defined in the Offchain Labs bridge UI repository. This covers both Layer 2 mainnets and testnets maintained by the Arbitrum ecosystem.
How often is the chain data updated?
The ChainLookupService caches the merged chain data for 5 minutes (CACHE_TTL). After this period expires, the next call to listChainNames() refreshes the data by re-fetching the Orbit chain registry and rebuilding the core chain objects.
Can I use the chain lookup functionality without running the MCP server?
Yes. You can import the ChainLookupService class directly from src/services/chain-lookup.ts and call getInstance().listChainNames() in any TypeScript or JavaScript application. This bypasses the MCP protocol entirely while maintaining the same caching and data aggregation logic.
Where does the Orbit chain metadata originate?
The service fetches Orbit chain definitions from https://raw.githubusercontent.com/OffchainLabs/arbitrum-token-bridge/master/packages/arb-token-bridge-ui/src/util/orbitChainsData.json, which is the official registry maintained by Offchain Labs for their token bridge interface.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →