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

# MCP Quickstart

> Get started with Token Layer MCP server in minutes

## Prerequisites

Before connecting the Token Layer MCP server, you'll need:

1. A Token Layer account at [tokenlayer.network](https://tokenlayer.network)
2. Your API key (see [Getting Your API Key](#getting-your-api-key))
3. An MCP-compatible AI assistant (Claude Code, Claude Desktop, ChatGPT, Cursor, or Windsurf)

## Getting Your API Key

<Steps>
  <Step title="Visit Token Layer Platform">
    Go to [tokenlayer.network](https://tokenlayer.network) and sign in
  </Step>

  <Step title="Access Profile Menu">
    Hover over your **profile avatar** in the top-right header
  </Step>

  <Step title="Copy API Key">
    Click to copy your API key to clipboard
  </Step>
</Steps>

<img src="https://mintcdn.com/tokenlayer/dNfhfiOTMldvOYcM/images/api-key-copy.png?fit=max&auto=format&n=dNfhfiOTMldvOYcM&q=85&s=fb64dcfbb55a449b3900d5128217262f" alt="Copy API key from profile menu" style={{borderRadius: '8px', marginTop: '16px'}} width="308" height="220" data-path="images/api-key-copy.png" />

<Note>
  Keep your API key secure! It provides access to your Token Layer account and can execute transactions on your behalf.
</Note>

***

## Claude Code

Claude Code is Anthropic's official CLI tool. Add Token Layer with a single command:

<iframe width="100%" height="400" src="https://www.youtube.com/embed/PZF08dm4Kis" title="Claude Code MCP Integration Demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style={{borderRadius: '8px', marginBottom: '24px'}} />

<Steps>
  <Step title="Run Installation Command">
    Open your terminal and run:

    ```bash theme={null}
    claude mcp add --transport http token-layer https://mcp-server.onthrust.com \
      --header "Authorization: Bearer YOUR_API_KEY"
    ```

    Replace `YOUR_API_KEY` with your actual API key from tokenlayer.network
  </Step>

  <Step title="Verify Installation">
    Start a new Claude Code session:

    ```bash theme={null}
    claude
    ```

    Try: "Show me trending tokens on Token Layer"
  </Step>
</Steps>

<Tip>
  Claude Code automatically includes the Authorization header in all MCP requests.
</Tip>

### Example Usage

```bash theme={null}
$ claude
You: Create a meme token called "Rocket Dog" with symbol RDOG

Claude: I'll help you create a token called "Rocket Dog" with symbol RDOG.
What blockchain would you like to deploy on?
1. Base (mainnet)
2. Base Sepolia (testnet)

You: Base Sepolia for testing

Claude: [Uses create_token MCP tool]
Token created successfully! Contract: 0x742d35Cc...
```

***

## Claude Desktop

Claude Desktop supports MCP through a visual connector interface:

<iframe width="100%" height="400" src="https://www.youtube.com/embed/mJgqSSxEaLw" title="Claude Desktop MCP Integration Demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style={{borderRadius: '8px', marginBottom: '24px'}} />

<Steps>
  <Step title="Open Settings">
    Launch Claude Desktop and click the **Settings** icon (gear) in the bottom-left
  </Step>

  <Step title="Navigate to Connectors">
    Select **Connectors** from the settings menu
  </Step>

  <Step title="Add Custom Connector">
    Click **"Add Custom Connector"**
  </Step>

  <Step title="Enter Details">
    * **Name**: `Token Layer`
    * **URL**: `https://mcp-server.onthrust.com`

    Click **"Connect"**
  </Step>

  <Step title="Authenticate">
    You'll be redirected to authenticate with your Token Layer account
  </Step>

  <Step title="Authorize">
    Review the permissions and click **"Authorize"** to grant access
  </Step>
</Steps>

### Visual Guide

<img src="https://mintcdn.com/tokenlayer/dNfhfiOTMldvOYcM/images/claude-desktop-1-add-connector.png?fit=max&auto=format&n=dNfhfiOTMldvOYcM&q=85&s=1218daeb47d355857410893f63af3175" alt="Step 1: Add connector button" style={{borderRadius: '8px', marginBottom: '16px'}} width="931" height="710" data-path="images/claude-desktop-1-add-connector.png" />

<img src="https://mintcdn.com/tokenlayer/dNfhfiOTMldvOYcM/images/claude-desktop-2-add-connector-details.png?fit=max&auto=format&n=dNfhfiOTMldvOYcM&q=85&s=fdf60b35431567c36745f196214bbf2b" alt="Step 2: Enter connector details" style={{borderRadius: '8px', marginBottom: '16px'}} width="551" height="412" data-path="images/claude-desktop-2-add-connector-details.png" />

<img src="https://mintcdn.com/tokenlayer/dNfhfiOTMldvOYcM/images/claude-desktop-3-press-connect.png?fit=max&auto=format&n=dNfhfiOTMldvOYcM&q=85&s=ede6624eee9cb0cd6400128b09fa245f" alt="Step 3: Press connect" style={{borderRadius: '8px', marginBottom: '16px'}} width="607" height="117" data-path="images/claude-desktop-3-press-connect.png" />

<img src="https://mintcdn.com/tokenlayer/dNfhfiOTMldvOYcM/images/claude-desktop-authenticate.png?fit=max&auto=format&n=dNfhfiOTMldvOYcM&q=85&s=c080428915104c3767a2f0733e1aec0b" alt="Step 4: Authenticate" style={{borderRadius: '8px', marginBottom: '16px'}} width="616" height="698" data-path="images/claude-desktop-authenticate.png" />

<img src="https://mintcdn.com/tokenlayer/dNfhfiOTMldvOYcM/images/claude-desktop-authorize.png?fit=max&auto=format&n=dNfhfiOTMldvOYcM&q=85&s=e436378daf5dfc86981676f7db46eda0" alt="Step 5: Authorize access" style={{borderRadius: '8px', marginBottom: '16px'}} width="554" height="995" data-path="images/claude-desktop-authorize.png" />

<Success>
  Once connected, Claude Desktop can use all Token Layer MCP tools in your conversations!
</Success>

***

## ChatGPT

ChatGPT supports custom MCP connectors through a similar interface:

<Steps>
  <Step title="Open Settings">
    In ChatGPT, click your profile icon and select **Settings**
  </Step>

  <Step title="Navigate to Connectors">
    Go to **Settings → Connectors**
  </Step>

  <Step title="Add Custom Connector">
    Click **"Add Custom Connector"**
  </Step>

  <Step title="Configure">
    * **Name**: `Token Layer`
    * **URL**: `https://mcp-server.onthrust.com`

    Click **"Connect"**
  </Step>

  <Step title="Complete OAuth Flow">
    Authenticate and authorize access (same as Claude Desktop)
  </Step>
</Steps>

<Note>
  The OAuth flow for ChatGPT is identical to Claude Desktop - you'll authenticate with Token Layer and authorize the connection.
</Note>

***

## Cursor & Windsurf

Cursor and Windsurf are AI-powered code editors with MCP support:

### Configuration

<Steps>
  <Step title="Open MCP Settings">
    In Cursor/Windsurf, open settings and navigate to **MCP Servers** or **Connectors**
  </Step>

  <Step title="Add Server Configuration">
    Add a new MCP server with these details:

    ```json theme={null}
    {
      "name": "token-layer",
      "transport": "http",
      "url": "https://mcp-server.onthrust.com",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
    ```
  </Step>

  <Step title="Reload Editor">
    Restart Cursor/Windsurf to apply the configuration
  </Step>

  <Step title="Test Connection">
    Ask the AI: "What are the trending tokens on Token Layer?"
  </Step>
</Steps>

### Alternative: Config File

You can also add the MCP server via config file:

<CodeGroup>
  ```json Cursor (mcp-config.json) theme={null}
  {
    "mcpServers": {
      "token-layer": {
        "transport": "http",
        "url": "https://mcp-server.onthrust.com",
        "headers": {
          "Authorization": "Bearer YOUR_API_KEY"
        }
      }
    }
  }
  ```

  ```json Windsurf (mcp-config.json) theme={null}
  {
    "mcpServers": {
      "token-layer": {
        "transport": "http",
        "url": "https://mcp-server.onthrust.com",
        "headers": {
          "Authorization": "Bearer YOUR_API_KEY"
        }
      }
    }
  }
  ```
</CodeGroup>

<Warning>
  Replace `YOUR_API_KEY` with your actual API key. Never commit API keys to version control!
</Warning>

***

## Testing Your Connection

Once connected, try these commands to verify everything works:

<CodeGroup>
  ```text Token Discovery theme={null}
  "Show me the top 5 trending tokens on Token Layer"
  ```

  ```text Price Check theme={null}
  "What's the current price of token with symbol DOGE?"
  ```

  ```text Token Creation theme={null}
  "Help me create a test token on Base Sepolia"
  ```

  ```text Trading theme={null}
  "Get a quote for buying 50 USDC worth of token xyz"
  ```
</CodeGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication Failed">
    * Verify your API key is correct
    * Check that you copied the full key without extra spaces
    * Try generating a new API key from tokenlayer.network
  </Accordion>

  <Accordion title="Connection Timeout">
    * Ensure you have internet connectivity
    * Check if [https://mcp-server.onthrust.com](https://mcp-server.onthrust.com) is accessible
    * Try again in a few minutes (may be temporary server issue)
  </Accordion>

  <Accordion title="Tool Not Found">
    * Verify the MCP server is properly configured
    * Restart your AI assistant
    * Check the [Tools Reference](/mcp-tools) for available tool names
  </Accordion>

  <Accordion title="Transaction Failed">
    * Ensure you have sufficient balance for gas fees
    * Check that you're using the correct network (mainnet vs testnet)
    * Review transaction details before confirming
  </Accordion>
</AccordionGroup>

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Protect Your API Key" icon="shield-halved">
    Never share your API key or commit it to public repositories
  </Card>

  <Card title="Review Permissions" icon="list-check">
    Understand what actions the MCP server can perform on your behalf
  </Card>

  <Card title="Monitor Activity" icon="chart-line">
    Regularly check your transaction history on tokenlayer.network
  </Card>

  <Card title="Revoke Access" icon="ban">
    You can revoke API keys anytime from your account settings
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Explore MCP Tools" icon="wrench" href="/mcp-tools">
    Learn about all available tools and their capabilities
  </Card>

  <Card title="Example Prompts" icon="messages" href="/mcp-examples">
    Get inspired with ready-to-use prompt examples
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference">
    Dive deeper into the underlying API
  </Card>

  <Card title="Get Support" icon="life-ring" href="/mcp-server">
    Contact us for help
  </Card>
</CardGroup>
