Integrations

Cursor MCP Server Setup: Search Your Documentation From the Editor

The Kopik team7 min read

Adding documentation search to Cursor takes one configuration file: declare a remote MCP server in `.cursor/mcp.json`, pass an API key in an `Authorization` header, and Cursor's agent can query your documentation and cite its sources mid-task. This guide gives the exact JSON, explains the three tools you get, suggests prompts that behave predictably and lists the usual reasons a server fails to connect.

The problem MCP solves inside Cursor

Cursor indexes your repository well. What it cannot see is the knowledge that sits outside the code: the internal style guide, the integration manual from a supplier, the HMRC notice your invoicing module has to respect. Developers usually bridge that gap by pasting pages into the chat, which is tedious, eats context and goes stale.

Searching documentation through a tool also changes how answers can be checked. Instead of a fluent paragraph you have to trust, the agent receives numbered passages and can quote them back to you, so a reviewer sees where each claim comes from. For a regulated codebase, that audit trail is often worth more than the time saved.

The Model Context Protocol is an open standard for connecting AI clients to external tools. A documentation server exposes search as a tool; Cursor's agent calls it when it needs facts, reads the passages that come back and works from them. Behind the tool sits a retrieval pipeline, which is exactly what RAG as a service provides without you running any infrastructure.

Before you begin: a short checklist

  • Cursor, a current release with MCP support.
  • A base to query. Browse the catalogue of knowledge bases, or create your own base from your documentation (PDF, Word, text or Markdown; creation is free). Kopik extracts, chunks and indexes the files for hybrid search.
  • An API key from your Kopik dashboard, beginning with `kpk_`. The free `list_bases` tool is the only one that works without it.
  • Five minutes and permission to add a file to the project.

Writing the .cursor/mcp.json file

At the root of your project, create a `.cursor` directory containing a file called `mcp.json`. Its content is a single object: `{ "mcpServers": { "kopik": { "url": "https://kopik.io/api/mcp", "headers": { "Authorization": "Bearer kpk_…" } } } }`. Replace `kpk_…` with your full key. Save the file, then open Cursor's MCP settings: the server should appear with its tools.

A few details are worth understanding rather than copying blindly:

  • The transport is Streamable HTTP and stateless. There is no local process to install or keep running; Cursor simply sends requests to the URL.
  • The name `kopik` is yours to choose. It is only a label in Cursor's interface.
  • The header is mandatory for paid tools. `Bearer`, one space, then the key.
  • A global file also exists. If you want the server in every project, put the same content in the `mcp.json` file of the `.cursor` folder in your home directory.

One project, one base

The default URL opens the entire catalogue, and the agent names a base on each call. For a project tied to a single documentation set, use the base's own URL instead: `https://kopik.io/api/mcp?base=your-base-slug`, copied from the base page. The `base` argument then vanishes from the tools, prompts become shorter and the agent cannot drift to an unrelated base. This works for private bases too, with the owner's key.

Secrets and version control

Do not commit a project `mcp.json` that contains a live key. List it in `.gitignore`, or keep the server in your global file. Under UK GDPR, the same reasoning applies to the documents themselves: decide deliberately what goes into a base, keep anything internal private, and record the processing as you would for any other supplier.

The three tools Cursor will see

Kopik MCP tools at a glance

ToolInputsOutputPrice
`list_bases``topic`, `query` (optional)Matching public basesFree
`ask_base``base`, `question`, `maxPriceCents` (optional)Drafted answer and numbered source passagesThe base's per-question price
`search_base``base`, `question`, `maxPriceCents` (optional)Passages onlySame as `ask_base`

`maxPriceCents` is a safety cap: if the base costs more than the figure you set, the call is refused and nothing is charged. Questions to your own bases are free within reasonable use (around 200 a day); other bases are billed from prepaid credits at the price their creator set.

Prompts that get consistent results

Cursor's agent chooses when to use a tool, so the clearer the instruction, the more predictable the call. These patterns work well:

  1. "Run list_bases with the query 'VAT' and suggest the base best suited to questions on the domestic reverse charge."
  2. "Ask the base uk-vat-guide-hmrc when the domestic reverse charge applies to construction services, and quote the passages you used."
  3. "Use search_base on our-platform-handbook for 'webhook signature verification', then implement verifySignature in this file and reference the passage numbers in a comment."
  4. "Call ask_base on our-platform-handbook with maxPriceCents 0 and summarise how we version public endpoints." (A cap of 0 is fine for your own free bases.)
  5. "Before changing this migration, check our-platform-handbook for the rules on renaming database columns."

ask_base or search_base?

Use `ask_base` when you want a readable answer to check. Use `search_base` when the agent is about to write code: it receives the raw passages and reasons over them in your context, for the same price.

When the connection fails: troubleshooting

Diagnosing a Cursor MCP server

What you seeProbable causeWhat to do
No server in the MCP settingsFile in the wrong place or `mcpServers` misspeltCheck the path `.cursor/mcp.json` and the top-level key, then reload the window
Server flagged in errorInvalid JSON (trailing comma, curly quotes pasted from a document)Run the file through a JSON validator
Only `list_bases` succeedsKey missing, mistyped or revokedCheck the `Bearer kpk_…` header; create a new key if needed
Base not foundWrong slug, or private base with another account's keyCopy the slug from the base page
Refused, nothing charged`maxPriceCents` below the base's priceRaise the cap or choose another base
Rate limit reachedToo many callsLimits are 20 questions a minute and 1,000 a day per user, 120 requests a minute per IP

If the agent replies without consulting the server at all, name the tool and the base in the prompt, or pin the server to a single base. For scripted use, JSON-RPC batches are limited to 10 requests.

A note on prompt injection

Any tool that feeds documents into an agent can carry hostile text. Kopik wraps base content in kopik-untrusted tags so the client can treat it as data rather than instructions. Keep Cursor's per-call approval switched on while you get used to the setup, especially in sessions where the agent can also edit files or run terminal commands.

On cost, API and MCP calls are always billed at the base's price per question, from prepaid credits; the free questions offered on the website do not apply to MCP. Your own bases stay free within reasonable use. Before rolling the setup out to a whole team, agree on three things: which bases the project may query, a default `maxPriceCents` written into your team's agent instructions, and who owns the API key. A shared key is convenient, but individual keys make it far easier to revoke access when someone leaves and to see who is spending what.

Connect Cursor in a few minutes

The developer page has the MCP URL, every tool with its arguments and the REST API, plus setup notes for Cursor and other clients.

Frequently asked questions

Is the Kopik MCP server free to use in Cursor?

Listing bases with list_bases is free and needs no key. Questions to your own bases are free within reasonable use. Questions to other bases are charged at each base's price from prepaid credits; free website questions do not apply to MCP.

Does the configuration work in other editors and assistants?

Yes. Most MCP clients accept the same mcpServers format with a URL and headers, and the server also works with Claude Code and ChatGPT. Only the file location differs from one client to another.

Can I restrict Cursor to one documentation base?

Yes. Use https://kopik.io/api/mcp?base=your-base-slug as the URL. The tools then target that base only and no longer take a base argument.

Why does Cursor ignore my mcp.json file?

Usually because the file is not at .cursor/mcp.json in the project root, the JSON is invalid, or the top-level key is not mcpServers. Fix it and reload Cursor or toggle the server in its MCP settings.

What documents can I turn into a searchable base?

PDF, Word, plain text and Markdown files. Kopik extracts and indexes them automatically, and answers cite the passages they rely on.

Get the Kopik newsletter

New knowledge bases, RAG guides and product news. One email every week or two, unsubscribe in one click.

By subscribing you agree to receive our newsletter. We never share your address.