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

# MCP for agents

> Connect Cursor, Claude, VS Code, or any MCP-compatible agent to the Narev MCP server for real-time LLM pricing and current AI billing docs.

## Give agents real-time pricing and current docs

Use the Narev MCP server to let AI agents access live LLM pricing data and search this documentation while they work. Instead of relying on web search or stale model knowledge, your agent can check real-time prices across providers and query current Narev docs through Model Context Protocol (MCP).

> [!NOTE]
>
> The public Narev MCP server runs at `https://mcp.narev.ai`. No API key required.

> **Real-time LLM pricing**
>
> Check current prices for any model, compare providers, and calculate exact costs before running a workload.

> **Search current docs**
>
> Ask questions about billing integrations, API usage, and pricing concepts.

> **Reduce hallucinations**
>
> Ground answers in live pricing data and the docs your team maintains in this repository.

## Available tools

The Narev MCP server exposes nine tools across three categories.

### Pricing tools

| Tool | What it does | Use it for |
| - | - | - |
| `list_providers` | Returns all supported AI providers. | Discovering which providers Narev tracks. |
| `list_models` | Returns available models, optionally filtered by provider. | Browsing models before checking prices. |
| `get_prices` | Returns current pricing for models with optional filtering and sorting. | Comparing prices across models or providers. |
| `list_gateways` | Returns supported AI gateways (for example OpenRouter and Kilo). | Discovering which gateways Narev tracks. |
| `get_gateway_prices` | Returns gateway model pricing with optional filtering and sorting. | Comparing OpenRouter or Kilo rates for a model. |
| `calculate_cost` | Calculates inference cost given token counts (prompt, completion, cache, reasoning, web search). | Estimating spend before running a workload. |

### Docs tools

| Tool | What it does | Use it for |
| - | - | - |
| `search_narev_docs` | Searches indexed Narev Docs pages and returns relevant snippets, titles, and links. | Finding the right guide or API page from a natural-language question. |
| `query_docs_filesystem_narev_docs` | Reads and navigates the docs as a virtual filesystem with shell-style commands. | Fetching full page content, browsing docs structure, or reading specific sections. |

### Feedback tools

| Tool | What it does | Use it for |
| - | - | - |
| `submit_feedback` | Reports a docs issue (incorrect, outdated, confusing, incomplete, or broken example). | Flagging a documentation problem for the docs team. Not for product support. |

> [!TIP]
>
> A good agent workflow is: check live provider or gateway prices first, then search docs for integration details, then make changes grounded in current data.

## Before you start

You need:

* An MCP-compatible client, such as Cursor, Claude Code, Claude Desktop, or VS Code.
* Network access to `https://mcp.narev.ai`.
* No API key - the server is public.

> [!WARNING]
>
> Don't send secrets or private customer data in MCP prompts. The public endpoint is for pricing queries and documentation retrieval only.

## Connect your agent

**1. Add the Narev MCP server**

Configure your MCP client with this remote HTTP endpoint:

```text theme={null}
https://mcp.narev.ai
```

**Cursor**

Add this server in **Settings → MCP**, or add it to your MCP configuration:

```json ~/.cursor/mcp.json theme={null}
{
  "mcpServers": {
    "narev-docs": {
      "url": "https://mcp.narev.ai"
    }
  }
}
```

Restart MCP servers from Cursor settings after saving the file.

**Claude Code**

Add the hosted MCP server with HTTP transport:

```bash theme={null}
claude mcp add --transport http narev-docs https://mcp.narev.ai
```

Run `claude mcp list` to confirm `narev-docs` is connected.

**Claude Desktop**

Add a remote MCP server entry named `narev-docs` in Claude Desktop settings.

If your Claude Desktop version uses a JSON config, use:

```json theme={null}
{
  "mcpServers": {
    "narev-docs": {
      "url": "https://mcp.narev.ai"
    }
  }
}
```

Restart Claude Desktop after saving the configuration.

**VS Code**

Use the MCP server UI, or add a remote server entry to your MCP configuration:

```json theme={null}
{
  "servers": {
    "narev-docs": {
      "url": "https://mcp.narev.ai",
      "type": "http"
    }
  }
}
```

Use **MCP: List Servers** from the Command Palette to verify the connection.

**Manual JSON-RPC**

You can initialize the server directly over HTTP:

```bash theme={null}
curl -X POST https://mcp.narev.ai \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-03-26",
      "capabilities": {},
      "clientInfo": {
        "name": "narev-docs-client",
        "version": "1.0.0"
      }
    }
  }'
```

**2. Verify the tools are available**

Open your client’s MCP tools list and confirm that the Narev MCP server exposes pricing tools and documentation tools.

Ask a test question such as:

Check current GPT-4o pricing.

What’s the current price for gpt-4o?

The agent should return pricing data for GPT-4o from OpenAI. You can also test the docs tools:

Search docs for Polar billing integration.

Search Narev Docs for how to connect Polar billing.

**3. Use pricing data and docs during implementation**

Ask your agent to check live prices or consult Narev Docs before changing billing or API code.

**Pricing prompts:**

Look up Claude Sonnet 4.6 input and output token prices.

What's the current price for claude-sonnet-4-6 input and output tokens?

Compare GPT-4o and Claude Opus 4 at 1M input tokens.

Compare the cost of GPT-4o vs Claude Opus 4 for 1 million input tokens.

Calculate cost for a specific gpt-4o call.

Calculate the cost of a call to gpt-4o with 2000 prompt tokens and 500 completion tokens.

Compare OpenRouter gateway pricing for gpt-4o.

What's the current OpenRouter price for gpt-4o?

**Docs prompts:**

Find the Node.js billing integration pattern in Narev Docs.

Use Narev Docs to find the recommended Node.js billing integration pattern, then inspect the app and suggest the smallest change.

Read AI-billing price resolver docs.

Read the AI-billing docs for price resolvers and explain how to use public pricing without an API key.

## What agents can do with MCP

After connection, agents can look up live pricing data and retrieve documentation for common Narev workflows:

* **LLM pricing**: current prices for any model across all supported providers, with filtering and sorting.
* **Gateway pricing**: current OpenRouter and Kilo rates via `list_gateways` and `get_gateway_prices`.
* **Cost calculation**: exact inference cost given prompt tokens, completion tokens, cache tokens, reasoning tokens, and web search count.
* **AI-billing**: provider middleware, destinations, price resolvers, and package reference pages.
* **API usage**: provider and model discovery, pricing lookup, and model cost calculation.
* **Varne v0**: versioned infrastructure cost and FOCUS format documentation. Varne v1 is in development.
* **Docs feedback**: report incorrect or outdated docs pages with `submit_feedback`.

## Troubleshooting

> **The MCP server returns Method not allowed**
>
> Open `https://mcp.narev.ai` through an MCP client, not a browser GET request. The endpoint expects MCP JSON-RPC calls over HTTP.

> **The client cannot connect**
>
> Confirm the server URL is exactly `https://mcp.narev.ai`. Then restart your MCP client or reload MCP servers from the client settings.

> **Search results miss a page**
>
> Mintlify indexes pages that the `docs.json` navigation includes by default. Confirm the page is public and appears in the docs navigation.

> **The agent gives a generic answer**
>
> Ask the agent to search Narev Docs first, then read the most relevant page before answering. This nudges the agent to use MCP instead of its built-in knowledge.

> **A model is missing from pricing results**
>
> Use `list_models` to see all tracked models. If a model is not listed, it may not yet be indexed by Narev. Check the Pricing API reference for the current provider and model coverage.

## Continue with a guide

> **[AI billing quickstart](https://www.narev.ai/docs/ai-billing/quickstart.md)**
>
> Capture usage with AI-billing, then configure Customer Tagging and a billing destination.

> **[Node.js billing integration](https://www.narev.ai/docs/ai-billing/integrations/frameworks/nodejs.md)**
>
> Add metered AI billing to any Node.js server running the Vercel AI SDK.

> **[Pricing API reference](https://www.narev.ai/docs/pricing-api/reference/overview.md)**
>
> List providers, models, and prices. Calculate cost for a trace.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.