Overview

IDLHub is a comprehensive registry of Interface Definition Language (IDL) files for Solana protocols. It provides web interface and programmatic access via REST and MCP APIs.

Comprehensive Coverage

IDLs for 100+ Solana protocols including Jupiter, Orca, Marinade, Drift, and more.

REST API

Complete REST API for loading and managing IDL files dynamically.

MCP Server

Model Context Protocol server for LLM and editor integration.

Code Generation

Generate TypeScript, Rust, Python code from IDL schemas.

Quick Start

Programmatic Access

// Fetch protocol list
const response = await fetch('https://idlhub.com/api/idl');
const data = await response.json();

// Get specific IDL
const jupiter = await fetch('https://idlhub.com/api/idl/jupiter');
const jupiterIdl = await jupiter.json();

MCP Server Installation

# One-line install
curl -fsSL https://idlhub.com/mcp | sh

# Or manual install
git clone https://github.com/openSVM/idlhub.git
cd idlhub && npm install
npm run mcp:start

REST API

The IDLHub REST API provides endpoints for loading and managing Solana program IDL files.

Base URL

https://idlhub.com/api

Endpoints

GET /api/idl

Get all IDLs in the registry.

curl https://idlhub.com/api/idl
GET /api/idl/:id

Get a specific IDL by protocol ID.

curl https://idlhub.com/api/idl/jupiter
GET /api/idl/search?q=query

Search for protocols by name or description.

curl "https://idlhub.com/api/idl/search?q=dex&limit=5"
GET /api/status

Get service status and statistics.

curl https://idlhub.com/api/status

MCP API

The Model Context Protocol (MCP) server provides structured access to IDL schemas, symbol lookup, code generation, and diagnostics.

MCP Tools

list_schemas

List all available IDL schemas with optional filtering.

{
  "name": "list_schemas",
  "arguments": { "category": "dex" }
}

get_schema

Retrieve a specific IDL schema by protocol ID.

{
  "name": "get_schema",
  "arguments": { "protocol_id": "jupiter" }
}

lookup_symbol

Look up types, instructions, accounts in an IDL.

{
  "name": "lookup_symbol",
  "arguments": {
    "protocol_id": "jupiter",
    "symbol_name": "route",
    "symbol_type": "instruction"
  }
}

generate_code

Generate code from an IDL for a target language.

{
  "name": "generate_code",
  "arguments": {
    "protocol_id": "jupiter",
    "target": "typescript"
  }
}

Integration

Claude Desktop

{
  "mcpServers": {
    "idlhub": {
      "command": "node",
      "args": ["/path/to/idlhub/mcp-server/src/index.js"]
    }
  }
}

API Playground

Test API endpoints interactively.

Try It Out

Response:

Response will appear here...

Code Examples

JavaScript

// Fetch all IDLs
const response = await fetch('https://idlhub.com/api/idl');
const data = await response.json();
console.log(data.idls);

// Get specific IDL
const jupiter = await fetch('https://idlhub.com/api/idl/jupiter');
const jupiterData = await jupiter.json();

// Use with Anchor
import { Program } from '@coral-xyz/anchor';
const program = new Program(jupiterData.idl, provider);

Python

import requests

# Fetch all IDLs
response = requests.get('https://idlhub.com/api/idl')
idls = response.json()['idls']

# Get specific IDL
jupiter = requests.get('https://idlhub.com/api/idl/jupiter')
jupiter_idl = jupiter.json()['idl']

cURL

# Get all IDLs
curl https://idlhub.com/api/idl

# Get specific IDL
curl https://idlhub.com/api/idl/jupiter

# Search
curl "https://idlhub.com/api/idl/search?q=lending&limit=5"