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

> ## Agent Instructions
> These docs cover the Darvas financial data API, its MCP server, data API and Darvas Pro+ webhooks, and Pine Script custom indicators for Darvas charts.
> https://docs.darvas.app/llms.txt lists every indexed page with a summary, and https://docs.darvas.app/llms-full.txt holds them in one file. Add .md to any page URL to read that page as Markdown. The lookup lists of tickers, types and series are named at https://docs.darvas.app/ai-agents.
> The docs MCP server https://docs.darvas.app/mcp searches and reads these docs. It needs no key.
> Call the REST API at https://api.darvas.app/v1. Send the API key, which starts with dvk_, in the X-API-KEY header or as Authorization: Bearer. The OpenAPI 3.1 spec of all 168 operations is https://docs.darvas.app/openapi.yaml.
> Name a company by ticker or cik. A share class takes a dot or a dash, so BRK.B and BRK-B name the same shares. Dates are YYYY-MM-DD.
> A list answer holds one page. Request its next_page_url as it is until the answer has none. limit counts rows across all pages.
> Errors are JSON with a stable error code and a message: 400 VALIDATION_ERROR, 401 UNAUTHORIZED, 403 PLAN_REQUIRED, 404 NOT_FOUND, 429 RATE_LIMITED or QUOTA_EXCEEDED, 500 INTERNAL_ERROR and 503 UNAVAILABLE. On a 429, wait the seconds in Retry-After. 1 credit = 1 successful call: a 2xx answer with data costs one credit however many rows it holds (at most 1,000 a page), and empty answers, errors and FINRA /short-volume cost 0 credits.
> The Financial Data MCP server is https://api.darvas.app/mcp (Streamable HTTP, protocol 2025-11-25, the same API key in X-API-KEY or as a Bearer token). tools/list answers 8 flagship tools plus search_data_tools and call_data_tool by default; ?mode=full lists all 164 tools and ?toolsets=sec,crypto,macro lists domains. Every tool is callable by name, takes response_format (json, compact or tsv) and fields, and a list answer's cursor value goes in the cursor argument. The darvas://catalog/* resources cost 0 credits. Setup for each client is at https://docs.darvas.app/mcp-server.
> The data API covers SEC filers and their filings, statements, XBRL facts, debt maturities, ownership and earnings, US stock prices, technicals and FINRA short volume, macro series and a global economic calendar.
> Its crypto data covers prices, indices, order books, order flow, volume profiles, derivatives, options, liquidations, spot ETF flows and a screener across 9 exchanges. It also covers DeFi protocols, stablecoins, yields and DEX pairs, and Polymarket, Kalshi and OKX prediction markets. https://docs.darvas.app/market-coverage gives the history and update time of each dataset.
> https://docs.darvas.app/ai-agents names the endpoint and the MCP tool that answer each kind of question about these datasets.
> Custom indicators for Darvas charts are Pine Script v5 or v6 indicator() or strategy() scripts. Darvas rewrites Pine v1 to v4 to v5 and runs no other indicator language. Start at https://docs.darvas.app/pine-script/introduction.
> https://docs.darvas.app/pine-script/support lists the Pine Script that Darvas runs. https://docs.darvas.app/pine-script/request-security covers request.security() and request.financial(), and https://docs.darvas.app/pine-script/limits lists the run limits.
> Darvas Pro+ webhooks send a signed POST for alarm fires and pauses, scheduled answers, economic calendar alerts, ETF flow updates, ended connections and the data API events. https://docs.darvas.app/pro/webhooks lists every event, its object and how to verify the Darvas-Signature header.

# Financial Data MCP Server for AI Agents

> Connect Claude Code, Codex, Cursor, VS Code, Windsurf or Devin to api.darvas.app/mcp for 164 financial, SEC EDGAR, macro, crypto and DeFi tools.

The data API is also an MCP server, so an agent such as Claude Code, Codex, Cursor or your own can call it as tools. It has 164 tools, one for every read and search endpoint of the REST API; the 4 webhook operations stay REST only. A tool is named after its operation in snake case, such as `list_income_statements` or `search_documents`. It takes the endpoint's query parameters, path parameters such as `request_id`, or JSON body fields for `POST` endpoints, and answers what the endpoint answers.

| Setting | Value |
| - | - |
| URL | `https://api.darvas.app/mcp` |
| Transport | Streamable HTTP: one JSON-RPC 2.0 message per `POST`, one JSON answer, no sessions |
| Authentication | Your API key in `X-API-KEY`, or `Authorization: Bearer` |
| Protocol versions | `2025-11-25`, `2025-06-18`, `2025-03-26` |
| Server | `darvas-data`, version 2.0.0 |
| Tools listed | 10 by default, all 164 with `?mode=full` |

`https://darvas.app/api/data/v1/mcp` is the earlier URL of the same server and keeps working.

## Which Darvas MCP server to use

| Server | URL | Sign-in | Use it for |
| - | - | - | - |
| Data API | `https://api.darvas.app/mcp` | API key in a header | Coding and data agents that answer with financial data: Claude Code, Codex, Cursor, VS Code, Windsurf, Devin |
| Docs search | `https://docs.darvas.app/mcp` | None | Agents that search and read these docs. See [AI agents](https://docs.darvas.app/ai-agents.md). |
| Darvas account | `https://darvas.app/mcp` | Darvas account, OAuth 2.1 | Apps that connect by sign-in instead of a header, such as Claude and ChatGPT. Reads your Darvas account, alerts, and charts read-only for `0` credits on every plan (Free `15` RPM, Pro `60` RPM, Max `180` RPM, Ultra `360` RPM). |

## Tool lists

`tools/list` answers 10 tools by default, so a short list keeps the agent's context small: 8 flagship tools plus `search_data_tools` and `call_data_tool`. Every one of the 164 tools stays callable by name in `tools/call`, whatever the list shows.

| URL | `tools/list` answers |
| - | - |
| `https://api.darvas.app/mcp` or `?mode=progressive` | `get_company_dossier`, `compare_financial_peers`, `get_price_snapshot`, `get_financial_metrics_snapshot`, `search_documents`, `get_crypto_market_context`, `get_crypto_derivatives_snapshot`, `list_economic_calendar`, `search_data_tools` and `call_data_tool` |
| `?mode=full` | All 164 tools |
| `?toolsets=crypto,macro` | The tools of the domains named |

The domains are `equities`, `financials`, `filings`, `ownership`, `crypto`, `defi`, `macro`, `prediction` and `tokenized`. `toolsets` also takes the aliases `sec` (filings, financials, equities and ownership), `stocks` (equities and financials), `company` (equities, financials and filings), `derivatives` (crypto) and `all`. When both are sent, `toolsets` wins over `mode`. A client can also send `mode` or `toolsets` as `tools/list` params.

`search_data_tools` finds tools by `query` keywords, by `domain`, or by up to 6 exact `names`, and answers ranked matches with their input schemas within an 8 KB budget; `limit` takes 1 to 25. `call_data_tool` runs any tool by `name` with its `arguments`, for clients that call only the tools they listed.

## Response shaping

Two extra arguments cut the tokens an answer costs, on any tool and on `call_data_tool`:

| Argument | Values |
| - | - |
| `response_format` | `json` (the default), `compact`, which drops null and empty values, or `tsv`, which answers the rows as tab-separated text |
| `fields` | Up to 100 field names to keep, such as `["report_period", "revenue", "net_income"]` |

`result.structuredContent` holds the JSON answer. `result.content[0].text` holds the same JSON when it is 1 KiB or less, and a one-line summary of the rows, pages and credits when it is longer. With `tsv`, `content[0].text` holds the table and there is no `structuredContent`. `result._meta` carries `credits_used`, `quota_remaining` and `rate_limit_per_minute` when the endpoint sends them.

```json theme={null}
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_income_statements","arguments":{"ticker":"NVDA","period":"annual","limit":4,"response_format":"tsv","fields":["report_period","revenue","net_income"]}}}
```

## Errors an agent can fix

`result.isError` is `true` when a call failed, and the answer says how to fix it:

* An unknown tool name answers `did_you_mean` with the closest tool names.
* Arguments that do not match the tool's input schema answer up to 6 issues, each with the field and, where one is close, a `did_you_mean` value.
* An endpoint error answers the REST error JSON with `retryable`, `true` for `429` and `5xx`, and hints such as a closer ticker, series, exchange or screener metric.

## Catalog resources

Four resources hold reference tables an agent can read with `resources/read` and their `uri`. They cost 0 credits. `resources/templates/list` answers an empty list.

| URI | What it holds |
| - | - |
| `darvas://catalog/tools` | Every tool grouped by domain, with the flagship tools and the toolset aliases |
| `darvas://catalog/macro-series` | Central bank codes, Treasury yield curve tenors, and the CPI and PCE, labor, GDP and GPU rental series IDs |
| `darvas://catalog/crypto-metrics` | Crypto screener metric IDs, categories, operators, timeframes, universes and market types |
| `darvas://catalog/exchanges` | Crypto candle and order flow exchanges, equity markets, prediction market venues and tokenized stock venues |

## Analyst prompts

`prompts/list` answers six prompt templates, and `prompts/get` fills one with its arguments. Each tells the agent which tools to call and in what order.

| Prompt | Arguments | What it plans |
| - | - | - |
| `stock_deep_dive` | `ticker`, optional `peers` | A fundamental, valuation, peer, ownership and SEC filing review of a company |
| `crypto_trade_setup` | `ticker`, optional `exchange` | Multi-venue context, order flow, volume profile, derivatives skew, liquidation levels and macro catalysts |
| `earnings_preview` | `ticker` | Past earnings, KPIs, management guidance, non-GAAP adjustments and insider activity before a report |
| `insider_whale_scan` | optional `ticker` and `min_value` | Form 4 trades, Form 144 notices, 13F positions, 13D activists, short volume and fails to deliver |
| `macro_regime_check` | optional `horizon` | Central bank rates, yield curve spreads, inflation, labor, GDP, the economic calendar and crypto ETF flows |
| `defi_yield_audit` | optional `chain` and `protocol` | Protocol TVL, base and reward APY, stablecoin flows and DEX liquidity |

## Credits and rate limits

* Every message, `initialize`, `ping`, `tools/list`, `tools/call`, `resources/*` and `prompts/*` alike, counts as one request against your account's per-minute [rate limit](https://docs.darvas.app/authentication.md#rate-limits-concurrency-and-headers) (`1,200` RPM on Pro, `3,600` RPM on Max, `6,000` RPM on Ultra). A message over the per-minute limit answers HTTP `429` with JSON-RPC error `-32000` and `Retry-After`.
* In-flight concurrency limits apply across REST and Data MCP (`4` concurrent on Pro, `10` on Max, `20` on Ultra). Exceeding your concurrency cap returns HTTP `429` with `CONCURRENCY_LIMIT` and `Retry-After: 1`; temporary platform-wide saturation returns HTTP `503` with `BUSY` and `Retry-After: 1`.
* Billing is call-based: **`1 credit = 1 successful call`** (up to `1,000` rows per page, with no endpoint multipliers), matching REST. Empty responses, errors, FINRA `/short-volume`, `tools/list`, `search_data_tools`, resources, prompts, and own-account MCP at `https://darvas.app/mcp` cost **`0` credits**.
* A `tools/call` answer carries the endpoint's `X-RateLimit-*`, `X-Quota-*`, `X-Credits-Used` and `Retry-After` headers.
* 44 tools take a `cursor`. Pass only the `cursor` value of an answer's `next_page_url`, such as `new URL(next_page_url).searchParams.get("cursor")`, never the whole URL. See [Pagination](https://docs.darvas.app/pagination.md#pagination-on-the-mcp-server).

## Transport rules

| Request | Answer |
| - | - |
| `GET` | `405` with `Allow: POST`; the server opens no stream |
| A `Content-Type` other than `application/json` | `415` |
| A body over 64 KiB (65,536 bytes) | `413` |
| A missing, unknown or revoked key | `401` with `UNAUTHORIZED` |
| A notification, a message without `id` such as `notifications/initialized` | `202` with no body |
| A batch or a body that is not one JSON-RPC 2.0 request | JSON-RPC error `-32600` |

The server keeps no session, so a client can send `tools/list` or `tools/call` without `initialize` first.

## Claude Code

Export the key first, then add the server:

```bash theme={null}
export DARVAS_API_KEY=dvk_...
claude mcp add --transport http --scope user darvas https://api.darvas.app/mcp --header "X-API-KEY: $DARVAS_API_KEY"
claude mcp list
```

The shell puts the key's value into the command, and Claude Code stores it in `~/.claude.json`. With `DARVAS_API_KEY` unset, the header is saved empty and every call answers `401`. `--scope user` adds the server to every project; `claude mcp list` shows whether it connects.

To share the server through a project's `.mcp.json` without the key, let Claude Code read it from each user's environment:

```json theme={null}
{
  "mcpServers": {
    "darvas": {
      "type": "http",
      "url": "https://api.darvas.app/mcp",
      "headers": { "X-API-KEY": "${DARVAS_API_KEY}" }
    }
  }
}
```

## Codex

Add the server to `~/.codex/config.toml`, or to `.codex/config.toml` in a project you trust. Codex reads the key from the `DARVAS_API_KEY` environment variable.

```toml theme={null}
[mcp_servers.darvas]
url = "https://api.darvas.app/mcp"
env_http_headers = { "X-API-KEY" = "DARVAS_API_KEY" }
```

To send the key as a Bearer token instead, replace `env_http_headers` with `bearer_token_env_var = "DARVAS_API_KEY"`. To list all 164 tools up front, use `url = "https://api.darvas.app/mcp?mode=full"`.

## Cursor

Add the server to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in a project. `${env:DARVAS_API_KEY}` reads the key from your environment.

```json theme={null}
{
  "mcpServers": {
    "darvas": {
      "url": "https://api.darvas.app/mcp",
      "headers": { "X-API-KEY": "${env:DARVAS_API_KEY}" }
    }
  }
}
```

## VS Code

GitHub Copilot in VS Code reads `~/.copilot/mcp-config.json` for every workspace, or `.mcp.json` at the workspace root. `${DARVAS_API_KEY}` reads the key from your environment, and `"tools": ["*"]` makes every tool available.

```json theme={null}
{
  "mcpServers": {
    "darvas": {
      "type": "http",
      "url": "https://api.darvas.app/mcp",
      "headers": { "X-API-KEY": "${DARVAS_API_KEY}" },
      "tools": ["*"]
    }
  }
}
```

> [accordion] Older setups in .vscode/mcp.json
>
> `.vscode/mcp.json` uses a top-level `servers` key, and VS Code's docs mark it deprecated for new configurations. An existing file can ask for the key through an input prompt:
>
> ```json theme={null}
> {
>   "inputs": [
>     { "type": "promptString", "id": "darvas-api-key", "description": "Darvas API key", "password": true }
>   ],
>   "servers": {
>     "darvas": {
>       "type": "http",
>       "url": "https://api.darvas.app/mcp",
>       "headers": { "X-API-KEY": "${input:darvas-api-key}" }
>     }
>   }
> }
> ```

## Windsurf and Devin Desktop

Windsurf is now Devin Desktop. Its Cascade agent reads `~/.config/devin/mcp_config.json` on macOS and Linux, or `%AppData%/devin/mcp_config.json` on Windows; **Open MCP config file** opens it. A remote server takes its URL as `serverUrl`, and `${env:DARVAS_API_KEY}` reads the key from your environment.

```json theme={null}
{
  "mcpServers": {
    "darvas": {
      "serverUrl": "https://api.darvas.app/mcp",
      "headers": { "X-API-KEY": "${env:DARVAS_API_KEY}" }
    }
  }
}
```

## Devin CLI

Devin CLI reads `~/.config/devin/mcp_config.json` for every project, `.devin/mcp_config.json` in a project, and `.devin/mcp_config.local.json`, a local file kept out of git. Its docs promise no variables in `headers`, so write the key itself in the user file or the local file. Never commit a file that holds the key.

```json theme={null}
{
  "mcpServers": {
    "darvas": {
      "url": "https://api.darvas.app/mcp",
      "transport": "http",
      "headers": { "X-API-KEY": "dvk_..." }
    }
  }
}
```

## Any client over HTTP

Each request is one JSON-RPC 2.0 message in a `POST`.

```bash theme={null}
curl "https://api.darvas.app/mcp?mode=full" \
  -H "X-API-KEY: $DARVAS_API_KEY" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

curl https://api.darvas.app/mcp \
  -H "X-API-KEY: $DARVAS_API_KEY" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_income_statements","arguments":{"ticker":"NVDA","period":"annual","limit":2}}}'
```

## Python

```python theme={null}
import os

import requests


def call_tool(name, arguments):
    response = requests.post(
        "https://api.darvas.app/mcp",
        headers={"X-API-KEY": os.environ["DARVAS_API_KEY"]},
        json={"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": name, "arguments": arguments}},
    )
    response.raise_for_status()
    body = response.json()
    if "error" in body:
        raise RuntimeError(body["error"]["message"])
    if body["result"].get("isError"):
        raise RuntimeError(body["result"]["content"][0]["text"])
    return body["result"]["structuredContent"]


statements = call_tool("list_income_statements", {"ticker": "NVDA", "period": "annual", "limit": 2})
print(statements["income_statements"][0]["revenue"])
```

With `response_format: "tsv"`, read `body["result"]["content"][0]["text"]` instead of `structuredContent`.

## TypeScript

This example uses the MCP TypeScript SDK, `@modelcontextprotocol/sdk`.

```typescript theme={null}
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(new URL("https://api.darvas.app/mcp"), {
  requestInit: { headers: { "X-API-KEY": process.env.DARVAS_API_KEY ?? "" } },
});
const client = new Client({ name: "my-agent", version: "1.0.0" });
await client.connect(transport);

const { tools } = await client.listTools();
console.log(tools.length, "tools listed"); // 10 by default, 164 with ?mode=full
const answer = await client.callTool({
  name: "list_income_statements",
  arguments: { ticker: "NVDA", period: "annual", limit: 2, response_format: "compact" },
});
console.log(answer.structuredContent);
await client.close();
```


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