# AI agents

> Connect Claude, Cursor or your own agent to QuantSet over MCP, or give a coding assistant the whole API as text.

Canonical URL: https://quantset.dev/docs/agents
Full LLM API Contract: https://api.quantset.dev/llms-full.txt

> ## For AI agents
> The QuantSet API is at https://api.quantset.dev. Send the key in the `X-API-Key` header. The sandbox key `mw_demo` needs no signup and reads the sample listings.
> No key yet? An agent can open an account on its own: https://api.quantset.dev/skill.md
> Connect an MCP client to https://api.quantset.dev/mcp. Client setup is at https://api.quantset.dev/agents.md.
> Start with https://api.quantset.dev/llms.txt or read the full reference at https://api.quantset.dev/llms-full.txt. The OpenAPI file is https://api.quantset.dev/openapi.json. Add `.md` to any docs URL to get that page as Markdown.

Give Claude, ChatGPT, Codex, Cursor or your own agent live market data. Connect the hosted MCP server in one step, or hand a coding assistant the whole API as a single text file.

          

## Set up an agent account

          

For an agent using REST, follow the [account setup walkthrough](/docs/integrations/agent-onboarding) to obtain a key, read a sample listing and request a checkout link when paid coverage is needed. Give a coding assistant the [operation index](https://api.quantset.dev/llms.txt) or the [OpenAPI schema](https://api.quantset.dev/openapi.json). For a chat client, use the [MCP connection instructions](#connect).

          

## Example tool call

          

This example shows the tool name and arguments for requesting NVIDIA’s five latest daily bars in an MCP client.
          
            
```
get_price_history { "ticker": "NVDA", "limit": 5}  (key: mw_demo)
```

          
          

The sandbox key lets an agent read sample listings. A personal key reads every covered listing and starts with 250 free credits. [See credit packs and plans](/pricing).

          

## Connect your agent

          

The server is at `https://api.quantset.dev/mcp`. There are two ways to sign in, and every client below supports at least one.
          

**Fastest way:** [create a free account](https://quantset.dev/signup). The console shows each setup below with your own key filled in, adds Cursor and VS Code in one click, and tells you the moment your agent connects.
          
            
- **Sign in with OAuth.** The client opens a QuantSet page where you paste your key once, or pick the sandbox. The client gets its own token, so the key never sits in a config file and you can cut the client off without changing the key.
            
- **Send a key.** The key goes in an `Authorization: Bearer` header. Use this for scripts, servers and clients that cannot open a browser.
          
          
            
              
| Client | Sign in with | Set up in |
              
                
| [Claude](#claude) | OAuth | Settings, Connectors |
                
| [Claude Code](#claude-code) | OAuth or key | One command |
                
| [ChatGPT](#chatgpt) | OAuth | Settings, developer mode |
                
| [Codex](#codex) | OAuth or key | One command |
                
| [Cursor](#cursor) | OAuth or key | `.cursor/mcp.json` |
                
| [VS Code](#vscode) | OAuth or key | `.vscode/mcp.json` |
                
| [Gemini CLI](#gemini) | Key | One command |
                
| [Windsurf](#windsurf) | Key | `mcp_config.json` |
                
| [Your own agent](#own-agent) | Key | Plain HTTP |
              
            
          

          

### Claude

          

Works in claude.ai and the desktop app.
          
            
- Open Settings, then Connectors, and choose Add custom connector.
            
- Enter `https://api.quantset.dev/mcp` as the server URL.
            
- On the QuantSet page that opens, paste your key or continue with the sandbox.
            
- In a new chat, turn the connector on from the tools menu and ask a question.
          

          

### Claude Code

          

Add the server, then type `/mcp` inside Claude Code and sign in from the browser.
          
            
```
claude mcp add --transport http quantset https://api.quantset.dev/mcp
```

          
          

To send a key instead, add it as a header. `claude mcp list` shows whether the server is connected.
          
            
```
claude mcp add --transport http quantset https://api.quantset.dev/mcp \
  --header "Authorization: Bearer mw_demo"
```

          

          

### ChatGPT

          

Custom connectors sit behind developer mode, and OpenAI moves these menus between releases.
          
            
- In Settings, open Apps or Connectors, then Advanced settings, and turn on Developer mode.
            
- Choose Create, enter `https://api.quantset.dev/mcp` as the server URL and pick OAuth.
            
- On the QuantSet page that opens, paste your key or continue with the sandbox.
            
- In a chat, add the connector as a source and ask a question.
          

          

### Codex

          

Add the server, then sign in from the browser. `codex mcp list` shows it once it is connected.
          
            
```
codex mcp add quantset --url https://api.quantset.dev/mcp
codex mcp login quantset
```

          
          

To send a key instead, name the environment variable that holds it.
          
            
```
export QUANTSET_API_KEY="mw_demo"
codex mcp add quantset --url https://api.quantset.dev/mcp --bearer-token-env-var QUANTSET_API_KEY
```

          

          

### Cursor

          

Add the server to `.cursor/mcp.json` in your project, or to the global file in your home folder. With only a URL, Cursor asks you to sign in. With the header, it uses the key.
          
            
```
{
  "mcpServers": {
    "quantset": {
      "url": "https://api.quantset.dev/mcp",
      "headers": {
        "Authorization": "Bearer mw_demo"
      }
    }
  }
}
```

          

          

### VS Code

          

Add the server to `.vscode/mcp.json`. Leave out `headers` to sign in from the browser instead.
          
            
```
{
  "servers": {
    "quantset": {
      "type": "http",
      "url": "https://api.quantset.dev/mcp",
      "headers": {
        "Authorization": "Bearer mw_demo"
      }
    }
  }
}
```

          

          

### Gemini CLI

          

One command adds the server for the current project. `gemini mcp list` shows it.
          
            
```
gemini mcp add --transport http quantset https://api.quantset.dev/mcp \
  --header "Authorization: Bearer mw_demo"
```

          

          

### Windsurf

          

Add the server to `~/.codeium/windsurf/mcp_config.json`, then refresh the server list in Cascade. Windsurf names the field `serverUrl`, not `url`.
          
            
```
{
  "mcpServers": {
    "quantset": {
      "serverUrl": "https://api.quantset.dev/mcp",
      "headers": {
        "Authorization": "Bearer mw_demo"
      }
    }
  }
}
```

          

          

### Your own agent

          

Any client that speaks MCP over HTTP works. The server keeps no session, so each call is one plain request. This lists the tools.
          
            
```
curl "https://api.quantset.dev/mcp" \
  -H "Authorization: Bearer mw_demo" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'
```

          

          

### Check that it works

          

Most clients load servers only when they start, so restart the client or open a new chat after adding QuantSet. Then ask for something the sandbox can answer, such as "What did NVIDIA close at yesterday, according to QuantSet?" A connected client answers with a date and a price and names the tool it called.

          

## What to ask

          

Once it is connected, ask in plain language. The agent picks the tools.
          
            
- Compare NVIDIA and Apple revenue growth over the last four fiscal years.
            
- Chart Bitcoin's daily close for the past 60 days and tell me the biggest one day move.
            
- What do analysts expect Microsoft to earn next year, and how has it done against estimates lately?
            
- When did Apple last raise its dividend, and by how much?
            
- Which US companies have a return on invested capital above 20 percent and a market cap over 50 billion dollars?
          
          

The first four work with the sandbox key. The last one searches the whole market, so it needs a full key.

          

## What the agent can do

          

Each read-only tool call counts as one request. List the tools in your client for their accepted parameters.
          
            
- `get_capabilities` — Get market coverage and status.
            
- `list_instruments` — Find market instruments.
            
- `get_quotes` — Get latest quotes.
            
- `get_price_history` — Get daily price history.
            
- `get_intraday_bars` — Get hourly price bars.
            
- `get_company_snapshot` — Get a company snapshot or its peers.
            
- `get_financial_statements` — Get financial statements.
            
- `get_fundamentals` — Get reported fundamentals.
            
- `get_estimates_and_earnings` — Get analyst estimates and earnings.
            
- `get_corporate_actions` — Get dividends, splits and shareholder returns.
            
- `get_sec_filings` — Get SEC facts and ownership disclosures.
            
- `get_etf_data` — Get fund profiles, holdings and exposures.
            
- `get_macro_and_fx` — Get economic indicators and exchange rates.
            
- `screen_stocks` — Screen stocks.
          

          

## Build with a coding assistant

          

Writing your integration with Claude Code, Cursor or Copilot? Give it the whole API as one text file and it writes correct calls the first time: every endpoint, parameter and example, plus the rules for keys, paging and errors.
          

[Open the full reference](https://api.quantset.dev/llms-full.txt)
          

Or paste a prompt like this one.
          
            
```
Read https://api.quantset.dev/llms-full.txt, then write a Python function that returns
daily closing prices for a list of US tickers from the QuantSet API.
Use the X-API-Key header, the sandbox key mw_demo, and handle paging and errors.
```

          
          

Every endpoint page also has a Copy for AI button that copies just that endpoint, ready to paste into a chat.

          

## If something fails

          
            
              
| What you see | What it means | What to do |
              
                
| 401 | The key is missing or mistyped. | Send it as `Authorization: Bearer` followed by the key. |
                
| No QuantSet tools in the chat | The client has not loaded the server yet. | Restart the client or open a new chat. If it signed in with OAuth, sign in again. |
                
| 403 does not grant access | This key does not include agent access. | Use a key from [your console](https://quantset.dev/account/keys). Every account key includes agent access. |
                
| Outside the sandbox | A sandbox key was asked for something outside the nine sample listings. | Use a personal key. Its free credits cover every listing. |
                
| 429 | The API has reached a request limit. | Wait for the number of seconds in `Retry-After`. |
                
| Does not accept a field | The agent sent a field the dataset does not have. | Nothing. The message lists the valid fields and the agent corrects itself. |

---

## QuantSet Ecosystem & Integrations (https://quantset.dev/integrations)

- **MCP Clients & 7 Skills:** `npx quantset init` & `npx skills add quantset/skills` (Claude, Claude Code, Cursor, ChatGPT, Codex, Hermes, OpenClaw, Block Goose, Cline, Docker MCP Toolkit — `https://api.quantset.dev/mcp`)
- **Python SDK & Agent Frameworks:** `pip install "quantset[pandas]"` · `from quantset.tools import build_agent_functions, langchain_tools, crewai_tools` (PydanticAI, LangGraph, LangChain, CrewAI, Agno, AutoGen, Google ADK, OpenAI Agents SDK)
- **TypeScript SDK & Vercel AI / Mastra:** `npm install quantset` · `import { createQuantsetTools } from "quantset/tools"` (Node 20+, Bun, Deno, Cloudflare Workers, Vercel Edge)
- **Spreadsheets & Workspaces:** Google Sheets (`=QUANTSET()` & `=IMPORTDATA()`), Microsoft Excel Power Query (`?format=csv`), Notion MCP & n8n/Make webhooks (`https://quantset.dev/docs/guides/google-sheets-excel-notion-stock-templates`)
- **Drop-In Migrations & Machine Payments:** FMP `/stable/*` & `/v3/*` adapter (`https://quantset.dev/docs/switch/fmp`), `yfinance` migration (`https://quantset.dev/docs/switch/yfinance`), autonomous signup (`https://api.quantset.dev/skill.md`), and `x402` Base USDC.
