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

# Quickstart - 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).

<Info>
  The public Narev MCP server runs at `https://mcp.narev.ai`. No API key required.
</Info>

<CardGroup cols={3}>
  <Card title="Real-time LLM pricing" icon="dollar-sign">
    Check current prices for any model, compare providers, and calculate exact costs before running a workload.
  </Card>

  <Card title="Search current docs" icon="magnifying-glass">
    Ask questions about billing integrations, benchmarking, API usage, and concepts.
  </Card>

  <Card title="Reduce hallucinations" icon="shield-check">
    Ground answers in live pricing data and the docs your team maintains in this repository.
  </Card>
</CardGroup>

## Available MCP functions

The Narev MCP server exposes six tools across two 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. |
| `calculate_cost` | Calculates inference cost given token counts (prompt, completion, cache, reasoning). | 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. |

<Tip>
  A good agent workflow is: check live prices first, then search docs for integration details, then make changes grounded in current data.
</Tip>

## 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.
</Warning>

## Connect your agent

<Steps>
  <Step title="Add the Narev MCP server">
    Configure your MCP client with this remote HTTP endpoint:

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

    <Tabs>
      <Tab title="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.
      </Tab>

      <Tab title="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.
      </Tab>

      <Tab title="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.
      </Tab>

      <Tab title="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.
      </Tab>

      <Tab title="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"
              }
            }
          }'
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="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:

    <Prompt description="Check current GPT-4o pricing." actions={["copy", "cursor"]}>
      What’s the current price for gpt-4o?
    </Prompt>

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

    <Prompt description="Search docs for Polar billing integration." actions={["copy", "cursor"]}>
      Search Narev Docs for how to connect Polar billing.
    </Prompt>
  </Step>

  <Step title="Use pricing data and docs during implementation">
    Ask your agent to check live prices or consult Narev Docs before changing billing, benchmarking, or API code.

    **Pricing prompts:**

    <Prompt description="Look up Claude Sonnet 4.6 input and output token prices." actions={["copy", "cursor"]}>
      What's the current price for claude-sonnet-4-6 input and output tokens?
    </Prompt>

    <Prompt description="Compare GPT-4o and Claude Opus 4 at 1M input tokens." actions={["copy", "cursor"]}>
      Compare the cost of GPT-4o vs Claude Opus 4 for 1 million input tokens.
    </Prompt>

    <Prompt description="Calculate cost for a specific gpt-4o call." actions={["copy", "cursor"]}>
      Calculate the cost of a call to gpt-4o with 2000 prompt tokens and 500 completion tokens.
    </Prompt>

    **Docs prompts:**

    <Prompt description="Find the Next.js billing integration pattern in Narev Docs." actions={["copy", "cursor"]}>
      Use Narev Docs to find the recommended Next.js billing integration pattern, then inspect the app and suggest the smallest change.
    </Prompt>

    <Prompt description="Look up custom quality metrics API details." actions={["copy", "cursor"]}>
      Search Narev Docs for custom quality metrics and show the request body for submitting a metric.
    </Prompt>

    <Prompt description="Read Narev SDK price resolver docs." actions={["copy", "cursor"]}>
      Read the Narev SDK docs for price resolvers and explain when to use the NAREV\_API\_KEY.
    </Prompt>
  </Step>
</Steps>

## 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.
* **Cost calculation**: Exact inference cost given prompt tokens, completion tokens, cache tokens, and reasoning tokens.
* **Narev Cloud billing**: Framework adapters, billing platforms, Customer Tagging, and usage-based billing concepts.
* **Narev SDK**: Provider middleware, destinations, price resolvers, and package reference pages.
* **Benchmarking**: Benchmark creation, variants, data sources, integrations, and result analysis.
* **API usage**: Pricing lookup, model cost calculation, chat completions, and custom quality metrics.
* **Narev Self-Hosted**: Infrastructure cost mapping and FOCUS format docs when the search index includes those pages.

## Troubleshooting

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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 Narev Cloud API reference for the current provider and model coverage.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="AI billing quickstart" icon="bolt" href="/quickstart">
    Set up Narev Cloud, the Narev SDK, Customer Tagging, and Polar billing.
  </Card>

  <Card title="Next.js billing integration" icon="triangle" href="/platform/billing/integrations/frameworks/nextjs">
    Add metered AI billing to a Next.js App Router app.
  </Card>

  <Card title="Narev Cloud API reference" icon="code" href="/platform/api-reference/overview">
    Review pricing, app completions, and custom metric endpoints.
  </Card>

  <Card title="Benchmarking quickstart" icon="chart-line" href="/platform/quickstart/benchmark">
    Compare model quality and cost with Narev Cloud benchmarks.
  </Card>
</CardGroup>
