# Local MCP Installation Guide

### Quick Start

#### Connecting Claude / Cursor

> ⚠️ **Prerequisites**: Node.js v18 or higher must be installed. You can download it [from nodejs.org](https://nodejs.org/en/download).

**Step 1: Locate the MCP Configuration File**

| App                          | Configuration File Path                                           |
| ---------------------------- | ----------------------------------------------------------------- |
| **Claude Desktop (Mac)**     | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| **Claude Desktop (Windows)** | `%APPDATA%\Claude\claude_desktop_config.json`                     |
| **Claude Code**              | `~/.claude/mcp.json` or project `.mcp.json`                       |
| **Cursor**                   | Project `.cursor/mcp.json`                                        |

**Step 2: Add Settings**

Add the following settings to your MCP configuration file:

```json
{
  "mcpServers": {
    "cryptoquant": {
      "command": "npx",
      "args": ["-y", "cryptoquant-mcp"]
    }
  }
}

```

**Step 3: Restart the App**

After saving the configuration file, completely close the app and restart it.

**Step 4: Verify Connection**

Call the `initialize()` tool to verify the connection. Done!

***

### Authentication Methods

#### Method A: Set Environment Variables (Recommended)

Add the API key to your environment variables in MCP settings:

```json
{
  "mcpServers": {
    "cryptoquant": {
      "command": "npx",
      "args": ["-y", "cryptoquant-mcp"],
      "env": {
        "CRYPTOQUANT_API_KEY": "your-api-key"
      }
    }
  }
}

```

#### Method B: Direct Parameter

You can also pass the API key directly when calling `initialize()`:

```
initialize(api_key="your-api-key")
```

The key is stored in `~/.cryptoquant/credentials` and reused in subsequent sessions.

**API Key Issuance**: <https://cryptoquant.com/settings/api>

#### Managing Credentials

When account switching or re-authentication is required:

```
# reset session
reset_session(clear_stored=true)

# Re-authenticate with new key
initialize(api_key="new-api-key")
```

Additionally, when managing API keys directly via LLM, session initialization occurs automatically.

***

### MCP Tool List

CryptoQuant MCP Server provides the following tools:

| Tool                 | Description                                         |
| -------------------- | --------------------------------------------------- |
| `initialize`         | Start session with API key, return plan information |
| `discover_endpoints` | Explore over 245 endpoints                          |
| `get_endpoint_info`  | Retrieve detailed endpoint parameter information    |
| `query_data`         | Query API data                                      |
| `describe_metric`    | Metric Description and Threshold Lookup             |
| `list_assets`        | Retrieve list of supported assets                   |
| `reset_session`      | Reset Session (Logout)                              |

***

### Setting Up a Local Development Environment

Setting up a local development environment for developers:

```bash
git clone https://github.com/CryptoQuantOfficial/cryptoquant-mcp.git
cd cryptoquant-mcp
npm install && npm run build

```

***

### Requirements

| Components | Requirements                                                                                                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Node.js    | v18+                                                                                                                                   |
| API Access | <p><a href="https://cryptoquant.com/settings/api">CryptoQuant API Key</a><br>- You can obtain an API key by accessing the website!</p> |

***

### Troubleshooting

#### When Connection Fails

1. Verify Node.js v18 or higher is installed
2. Verify the configuration file path is correct
3. Check for JSON syntax errors
4. Ensure the app has been fully restarted

#### API Key Issues

1. Verify the API key is valid [on the settings page](https://cryptoquant.com/settings/api)
2. Execute `initialize()` again after calling `reset_session(clear_stored=true)`
3. If using environment variables, verify they are set correctly
