> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Portal MCP Server

> Query blockchain data from AI agents via the Portal MCP server — 27 tools for blocks, txns, logs, and analytics across EVM, Solana, Bitcoin, Substrate, and Hyperliquid.

<Info>
  The Portal MCP server is experimental. Available tools and behavior may change.
</Info>

Connect the Portal MCP server to your favorite AI coding clients.

MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. The Portal MCP server gives your agent direct access to blockchain data across 225+ datasets. Discover datasets, query transactions and logs, analyze wallets, and compare chains.

<video autoPlay loop muted playsInline style={{ maxWidth: "640px", borderRadius: "8px", marginTop: "1rem", marginBottom: "1rem" }}>
  <source src="https://mintcdn.com/sqd-2119b3c3/KRRXbq03tb5ulLlM/files/portal-mcp-demo.mp4?fit=max&auto=format&n=KRRXbq03tb5ulLlM&q=85&s=08fb931c7a31002744df4934c24cc8b4" type="video/mp4" data-path="files/portal-mcp-demo.mp4" />
</video>

## Connect Portal MCP

* MCP endpoint: `https://portal.sqd.dev/mcp`
* Authentication: Free, no API keys required

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={"system"}
    claude mcp add --transport http sqd-portal https://portal.sqd.dev/mcp
    ```

    Test the connection:

    ```bash theme={"system"}
    claude mcp list
    ```

    See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.
  </Tab>

  <Tab title="Claude">
    <Info>
      Custom connectors are available on all Claude plans. Free users are limited to one custom connector. For Team and Enterprise plans, only Owners can add connectors.
    </Info>

    <Steps>
      <Step title="Add the Portal MCP server to Claude">
        1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in Claude settings.
        2. Select **Add custom connector**.
        3. Add the Portal MCP server:
           * Name: `Portal`
           * URL: `https://portal.sqd.dev/mcp`
        4. Select **Add**.
      </Step>

      <Step title="Access the MCP server in your chat">
        1. When using Claude, select the attachments button (the plus icon).
        2. Select the Portal MCP server.
        3. Ask Claude questions about blockchain data from Portal API.
      </Step>
    </Steps>

    See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server) for more details.
  </Tab>

  <Tab title="Cursor">
    <Steps>
      <Step title="Open MCP settings">
        1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.
        2. Search for "Open MCP settings".
        3. Select **Add custom MCP**. This opens the `mcp.json` file.
      </Step>

      <Step title="Configure the Portal MCP server">
        In `mcp.json`, add:

        ```json theme={"system"}
        {
          "mcpServers": {
            "sqd-portal": {
              "url": "https://portal.sqd.dev/mcp"
            }
          }
        }
        ```
      </Step>

      <Step title="Test the connection">
        In Cursor's chat, ask "What tools do you have available?" Cursor should show the Portal MCP server as an available tool.
      </Step>
    </Steps>

    See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.
  </Tab>

  <Tab title="VS Code">
    Create a `.vscode/mcp.json` file and add:

    ```json theme={"system"}
    {
      "servers": {
        "sqd-portal": {
          "type": "http",
          "url": "https://portal.sqd.dev/mcp"
        }
      }
    }
    ```

    See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.
  </Tab>
</Tabs>

## Available tools

24 public tools and 3 debug helpers across EVM, Solana, Bitcoin, Substrate, and Hyperliquid. All queryable in natural language. Every tool follows the same description style, input schema, response envelope, and routing metadata, and every response includes structured follow-up hints and optional interactive panels for MCP-aware clients.

### Discovery & shared

| Tool                         | Description                                                                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `portal_list_networks`       | Find the right network or alias across EVM, Solana, Bitcoin, Substrate, and Hyperliquid. First stop when you're not sure which dataset to query. |
| `portal_get_network_info`    | Check if a network is indexed, fresh, caught up, or behind, and see which tables are available.                                                  |
| `portal_get_head`            | Get just the latest or finalized head block or slot for a network.                                                                               |
| `portal_get_recent_activity` | Cross-VM recent-activity feed with chronological paging. Simplest answer to "what's been happening on X lately?".                                |
| `portal_get_wallet_summary`  | One-call wallet analysis across supported VMs. Overview, activity, and assets.                                                                   |
| `portal_get_time_series`     | Chart-ready metric buckets over time with optional compare-to-previous and EVM contract grouping.                                                |

### EVM

| Tool                                 | Description                                                                                                       |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| `portal_evm_query_transactions`      | Query raw EVM transactions with optional logs, traces, and state-diff context via include flags.                  |
| `portal_evm_query_logs`              | Query raw EVM logs with address/topic filters and optional inline decoding.                                       |
| `portal_evm_query_token_transfers`   | Token-transfer activity on EVM without needing to remember the Transfer event signature.                          |
| `portal_evm_get_analytics`           | Network-wide EVM snapshot with ranked top contracts and compact overview metrics.                                 |
| `portal_evm_get_contract_activity`   | Contract-centric summary: recent interactions, unique callers, and optional event activity.                       |
| `portal_evm_get_contract_deployment` | Look up the deployment block, transaction, and deployer for any EVM contract address.                             |
| `portal_evm_get_ohlc`                | **Experimental.** DEX OHLC candles plus a recent-trade tape from Uniswap v2/v3/v4 and Aerodrome Slipstream swaps. |

### Solana

| Tool                               | Description                                                                                                   |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `portal_solana_query_transactions` | Query raw Solana transactions with optional balances, token balances, rewards, logs, and instruction context. |
| `portal_solana_query_instructions` | Query raw instructions with program, account, and Anchor-discriminator filters.                               |
| `portal_solana_get_analytics`      | Solana throughput, fee, wallet activity, and optional top-program snapshot.                                   |

### Bitcoin

| Tool                                | Description                                                                          |
| ----------------------------------- | ------------------------------------------------------------------------------------ |
| `portal_bitcoin_query_transactions` | Query raw Bitcoin transactions with optional inline inputs and outputs.              |
| `portal_bitcoin_get_analytics`      | Bitcoin block cadence, fees, SegWit/Taproot adoption, and address activity snapshot. |

### Hyperliquid

| Tool                               | Description                                     |
| ---------------------------------- | ----------------------------------------------- |
| `portal_hyperliquid_query_fills`   | Query trade fills with PnL, fees, and routing.  |
| `portal_hyperliquid_get_analytics` | Trading volume, top coins, and trader rankings. |
| `portal_hyperliquid_get_ohlc`      | OHLC candles for Hyperliquid markets.           |

### Substrate

| Tool                             | Description                                                                                         |
| -------------------------------- | --------------------------------------------------------------------------------------------------- |
| `portal_substrate_query_calls`   | Query Polkadot-, Kusama-, and other Substrate-style extrinsic calls with pallet and method filters. |
| `portal_substrate_query_events`  | Query Substrate events emitted by runtime pallets.                                                  |
| `portal_substrate_get_analytics` | Substrate network-wide snapshot: block cadence, extrinsic volume, and top pallets.                  |

### Debug

| Tool                                              | Description                                                                                      |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `portal_debug_query_blocks`                       | Inspect raw blocks across VMs for schema debugging.                                              |
| `portal_debug_resolve_time_to_block`              | Resolve a timestamp to a block or slot for any supported network.                                |
| `portal_debug_hyperliquid_query_replica_commands` | Low-level access to Hyperliquid replica commands (orders, cancels, transfers, leverage updates). |

## Known limitations

The MCP server may struggle with memory issues when handling large volumes of data, especially on high-TPS chains like Solana and Hyperliquid. v0.7.5 introduced chunked fetching and lower default limits to mitigate this, but large unfiltered queries can still cause timeouts or incomplete results. Always use filters and keep block ranges tight on dense chains.

## Best practices

1. **Use timeframes for any query**. All query tools support the `timeframe` parameter (e.g., `"24h"`, `"7d"`). No need to calculate block ranges manually
2. **Try specialized tools first**. Use high-level tools like `portal_get_wallet_summary` or `portal_get_recent_transactions` before lower-level query tools
3. **Always filter queries**. Use addresses, topics, or other filters to keep responses under the 50KB cap
4. **Leverage analytics tools**. Use per-chain analytics and time series tools to get summaries without fetching raw data
5. **Mind block ranges**. Keep queries under 10K blocks for logs, 5K for transactions, and 1K for traces for best performance. On high-TPS chains, use even smaller ranges

## Related

* [AI Development Overview](/en/ai/ai-development). Resources for building AI agents with SQD
* [Portal API Reference](/en/portal/evm/overview). HTTP API for blockchain data
* [Documentation MCP Server](/en/ai/mcp-server-docs). Search SQD documentation
* [Pipes SDK](/en/sdk/pipes-sdk/evm/quickstart). TypeScript SDK for custom pipelines
* [llms.txt](https://docs.sqd.dev/llms.txt). Documentation index for LLMs
