> ## Agent Instructions
>
> Base URL: https://api.anysite.io
> Authentication: send the `access-token` header. Do NOT use `Authorization: Bearer`.
> Full endpoint catalog: https://app.anysite.io/docs
# MCP server

What the Anysite MCP server is, its URL, how clients authenticate, which tools it exposes and how usage is limited.

Goal: understand what the Anysite MCP server gives an AI client, and how that client connects and is metered.

The Anysite MCP server lets an AI client (Claude, Cursor, ChatGPT, n8n and any other MCP client) fetch live
structured data from every Anysite source through a small set of tools. The client looks up what a source
offers with `discover`, fetches data with `execute`, and then pages, filters, merges and exports the result
on the server, without pulling the whole dataset into the conversation.

## Server URL

```text
https://mcp.anysite.io/mcp
```

The server speaks MCP over Streamable HTTP. Your personal connection details — the URL with your key, the
Claude Code command, the Cursor install button and the JSON config — are built for you on the MCP page of
the dashboard; [Connect a client](/docs/mcp/connect) walks through each client.

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp (Open MCP integration).

## Authentication

Every call to the server needs a bearer credential. There are three ways to supply it:

| Mode | What the client is given | Use it for |
|---|---|---|
| OAuth (recommended) | The bare URL `https://mcp.anysite.io/mcp`. The client registers itself, opens an Anysite consent page in the browser, and receives its own token. | Clients with a "custom connector" flow: Claude, ChatGPT, Grok. |
| Direct URL | The URL with your key appended as `?api_key=…`. | Clients that only accept a URL: n8n, Make, Clay, Claude Code. |
| Authorization header | The bare URL plus the header `Authorization: Bearer <key>`. | Clients configured with a JSON file: Cursor, Claude Desktop, Claude Code. |

The Direct URL contains your key. Anyone who has it can spend your plan's usage, so treat it like the key itself.

**OAuth consent.** The consent page lists what the client will be allowed to do (use Anysite MCP tools,
read your account email and profile, use credits from your active plan) and asks which plan to use under
**Use credits from**. If you have an MCP plan it is preselected and marked **Recommended**. **Deny** sends
the client back without access. An OAuth connection is valid for 30 days; after that the client asks you to
authorize again.

**No active plan.** Authorization fails with `Active subscription required. Please subscribe first.` and the
dashboard sends you to finish setup. A request without any credential gets `401` with
`Authentication required. Include Authorization: Bearer <token> header.`

**MCP plan keys** work only through the MCP server. The same key sent to the REST API is rejected with `403`
(see [Authentication](/docs/authentication)).

## Tools

### General tools

| Tool | Purpose |
|---|---|
| `discover(source, category)` | List the endpoints of a source category with their parameters and hints. Costs no credits. |
| `execute(source, category, endpoint, params)` | Fetch data from an endpoint. Returns the first 10 items, the total and a `cache_key`. Costs credits. |
| `get_page(cache_key, offset, limit)` | Load more items of a cached result. Free. |
| `query_cache(cache_key, conditions, sort_by, aggregate, group_by)` | Filter, sort and aggregate a cached result on the server. Free. |
| `merge_data(cache_keys, dedupe_by)` | Combine several cached results into one new `cache_key`. Free. |
| `export_data(cache_key, output_format, list_unpack)` | Save a full cached result as a downloadable `json`, `csv`, `jsonl` or `xlsx` file. |
| `search_requests(source, category, endpoint, query, since, until)` | Find your earlier `execute` calls and their `cache_key`s. |

How to use the free tools on fetched data: [Data analysis](/docs/mcp/data-analysis).

The list of sources is not fixed in the server: it is loaded from the Anysite API, so new endpoints become
available to `discover` and `execute` without reconnecting. Browse them in the [API reference](/docs/api).
A few API endpoints are not available through MCP: LinkedIn account management, Sales Navigator user search
(`/api/linkedin/sn_search/users`), company employees (`/api/linkedin/company/employees`) and the account
`/token/*` endpoints.

### CRM tools

Shown only after you enable the CRM integration in your profile. Details: [CRM tools](/docs/mcp/crm).

| Tool | Purpose |
|---|---|
| `crm_list_connections` | List your CRM connections and their status. |
| `crm_connect(provider)` | Start connecting HubSpot or Pipedrive; returns a link to authorize in the browser. |
| `crm_connect_status(pending_id)` | Check whether a connection started with `crm_connect` is active. |
| `crm_get_schema` | Read contact and company properties, lists and protected fields. |
| `crm_query_records` | Read records by list, ids, emails or free-text search. |
| `crm_upsert_contacts` | Write contacts matched by email, record id or LinkedIn URL. |
| `crm_upsert_companies` | Write companies matched by domain or record id. |
| `crm_undo(run_id)` | Restore the values a write run changed. |

## Limits and usage

- `execute` is the only general tool that spends usage; `discover`, `get_page`, `query_cache` and `merge_data`
  work on data you already have and cost nothing.
- **Credit plans** pay for each `execute` call from the plan's credits, like a REST API call.
- **MCP plans** meter usage in a 5-hour window and a weekly window; LinkedIn endpoints can have their own
  5-hour and weekly windows. Your current usage of each window is shown as a percentage on the MCP page.
- When a window is used up, `execute` returns status `429` with the message
  `You've reached your 5-hour usage limit. Wait for it to reset or upgrade your plan …` (or the weekly /
  LinkedIn variant). Wait for the window to reset or change your plan.

> ACTION FOR THE HUMAN: open https://app.anysite.io/mcp (See MCP usage).

How plans, credits and windows fit together: [Plans and credits](/docs/plans-and-credits). Every API status
`execute` can pass through: [Errors and limits](/docs/errors-and-limits).

## Verify

After connecting, ask the client: `What tools do you have from Anysite?` It lists the general tools above,
plus the `crm_*` tools if the CRM integration is enabled.
