> For the complete documentation index, see [llms.txt](https://userguide.cryptoquant.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://userguide.cryptoquant.com/api/mcp-server-beta/local-mcp-installation-guide.md). Agents can also search and read this documentation through its [MCP server](https://userguide.cryptoquant.com/~gitbook/mcp).

# 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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://userguide.cryptoquant.com/api/mcp-server-beta/local-mcp-installation-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
