Integrations

Connect Claude, Cursor or ChatGPT to a Knowledge Base

The Kopik team9 min read

You connect Claude, Cursor or ChatGPT to a knowledge base in three stages: pick or build a knowledge base that already indexes your documents, add it as a tool using either an MCP server (Claude, Cursor) or a REST API with an API key (ChatGPT and most custom agents), then authenticate and start asking questions that return cited passages instead of guesses. The whole process typically takes under ten minutes once the base exists.

Why bother connecting an agent, instead of pasting documents in?

Pasting a PDF into a chat window works for a single question about a short file. It falls apart the moment you have fifty policy documents, a product manual that changes monthly, or a contract library that several colleagues need to query. Context windows are finite, pasted text loses structure, and you cannot trace an answer back to the exact clause it came from. A connected knowledge base solves all three problems at once: documents are chunked and indexed once, every query runs hybrid search (full-text plus semantic keyword expansion) across the whole set, and answers arrive with citations pointing at the source passage.

This is also the practical difference between a chatbot that sounds confident and one you can actually rely on for work. If you want the background on why grounding matters, our guide on reducing AI hallucinations covers the mechanism in more depth.

Three ways to query a knowledge base

Whichever platform hosts your knowledge base, there are usually three access routes. Understanding which one fits Claude, Cursor or ChatGPT saves time before you start wiring anything up.

Connection methods compared

MethodBest forTypical clientSetup effort
Website chatQuick manual lookups, no integrationBrowserNone
REST API with API keyCustom apps, ChatGPT tools, scripts, backend servicesChatGPT, your own codeLow, needs a key and an endpoint
MCP serverLetting an AI assistant call the knowledge base as a tool during a conversationClaude, Cursor, other MCP clientsLow to medium, one-time configuration

REST API with API keys

An API key is the simplest way to let any application, including a ChatGPT custom GPT or an internal tool, send a question and receive an answer with citations or raw passages. On Kopik, every base (public or private) exposes an endpoint once you generate a key from your dashboard, and the developer documentation lists the request format, authentication header and the two response modes: grounded answers with citations, or passages only if you want to do your own synthesis.

MCP servers for Claude, Cursor and other clients

The Model Context Protocol (MCP) is an open standard that lets an AI assistant discover and call external tools during a conversation, without you writing custom integration code for every assistant. If a knowledge base exposes an MCP server, Claude or Cursor can call it mid-conversation exactly as it would call a code search or a web browser. We cover the standard itself in The Model Context Protocol (MCP) Explained, and how to pick trustworthy servers in our MCP directory guide.

MCP or API: which should you pick first?

If you mainly chat with Claude or work inside Cursor, start with MCP: it feels native and the assistant decides when to query the base. If you are building a custom tool, a ChatGPT GPT, or a backend workflow, the REST API gives you more control over how results are displayed and billed.

Step-by-step: connecting Claude to a knowledge base via MCP

  1. Create or pick a knowledge base. Anyone can upload PDFs, Word files, text or Markdown and have them chunked and indexed automatically at /dashboard/bases/new, or browse ready-made ones in the catalogue if someone has already published what you need.
  2. Generate the MCP connection details for that base from your account settings (typically a server URL and a key scoped to that base).
  3. In Claude's settings, add a new MCP server using those details. Most desktop clients ask for a name, the server address and any required authentication token.
  4. Restart or reload the client so it picks up the new tool.
  5. Ask Claude a question naturally, for example 'What does our onboarding policy say about probation periods?'. Claude recognises the tool is relevant, calls the knowledge base, and returns an answer with the source passage attached.

For a fuller walkthrough including private bases and team access, see How to Give Claude Access to Your Company Documents.

Step-by-step: connecting Cursor via MCP

Cursor is an editor, so the use case is slightly different: developers usually want to query internal documentation, API specs or runbooks without leaving the codebase.

  1. Open Cursor's MCP settings (usually under a dedicated 'Tools' or 'MCP Servers' section of preferences).
  2. Add the knowledge base as a new server, pasting the connection URL and key generated from the base's dashboard.
  3. Save and confirm the tool appears as available in the assistant panel.
  4. Reference it from a prompt, for instance 'Check the documentation base for how pagination is handled in our API, then update this function accordingly.'
  5. Cursor calls the base mid-task and cites the passage it used, so you can verify the answer before trusting the generated code change.

We go into more detail, including troubleshooting common connection errors, in Cursor MCP Server Setup: Search Your Documentation From the Editor.

Step-by-step: connecting ChatGPT with a tool or API

ChatGPT's custom GPTs and the underlying API support tool calling via HTTP actions, which maps directly onto a REST API key integration rather than MCP.

  1. Generate an API key for your knowledge base from the dashboard.
  2. In the GPT builder (or your own API integration), define an action pointing at the knowledge base's question endpoint, passing the key as a bearer token or header as documented.
  3. Describe the action clearly so the model knows when to call it, for example 'Use this action to answer any question about our product manuals.'
  4. Test with a question you know the answer to, checking that the returned citation matches the right document and page or section.
  5. Publish or deploy once answers are reliably grounded.

The exact header names, rate limits and response schema are documented on the developers page, which is worth keeping open in a second tab while you configure the action.

Checking sources and citations in agent answers

Connecting a tool is only half the job. Once Claude, Cursor or ChatGPT can call your knowledge base, you still need a habit of checking the citation before acting on the answer, particularly for anything touching policy, pricing, safety or compliance. A grounded answer should point to a specific passage, not just a document title. If a client or colleague ever questions an AI-generated answer, being able to show the exact source line is what makes the process defensible. Our guide on Document Q&A With Citations: How to Check an AI Answer sets out a short checklist worth applying to agent answers as well as direct website queries.

It is also worth asking the base in 'passages only' mode occasionally rather than the synthesised answer, especially during setup, so you can confirm the chunking and retrieval are surfacing the right material before you trust the generated summary.

Costs, credits and authentication

Most knowledge base platforms charge per question rather than per document stored, which matters once an agent starts calling the base automatically inside a longer conversation or coding session. On Kopik, pricing runs on prepaid credits per question, or a chat subscription at €12 a month with a usage gauge, and if you query a public base someone else created, the price per question is set by that creator, who keeps 70% of what you pay. Private bases are only reachable by the owner and their own API keys or MCP credentials, so connecting Claude or Cursor to a private base does not expose it to anyone else.

  • Rotate API keys periodically, especially if a key was shared in a script or a shared Cursor configuration file.
  • Scope keys to a single base where possible rather than using an account-wide key for every integration.
  • Keep an eye on the usage gauge or credit balance if an assistant is calling the base automatically during long sessions, since repeated tool calls can add up faster than manual browsing.

Start small before wiring up an agent

Before connecting Claude or Cursor, ask a handful of test questions directly on the knowledge base's website chat. It is the fastest way to confirm chunking and retrieval quality without debugging an MCP connection at the same time.

Choosing between building your own base or using an existing one

If the documents you need already exist as a public knowledge base (industry regulations, a well-known reference manual, a published standard), it is often faster to subscribe per question from the catalogue than to upload and index them yourself. If the material is internal, proprietary or sensitive, building a private base takes only as long as uploading the files at /dashboard/bases/new, after which the same MCP or API connection steps above apply unchanged.

Ready to connect an agent to your documents?

Create a knowledge base in minutes, generate an API key or MCP connection, and start getting cited answers inside Claude, Cursor or ChatGPT.

Common pitfalls to avoid

  • Forgetting to restart the client after adding an MCP server, which leaves the tool invisible to the assistant.
  • Using an account-wide API key in a shared Cursor configuration file that ends up in version control.
  • Expecting the assistant to call the knowledge base automatically for every question, when in practice you usually need to name the tool or the topic explicitly in the prompt.
  • Skipping the citation check and trusting a synthesised answer on a high-stakes topic without opening the source passage.
  • Connecting a base with poorly structured documents and blaming the assistant when retrieval quality is actually a chunking problem; see our guide on Chunking Strategies for RAG if answers feel vague or off-topic.

Once the connection is live, treat it the same way you would treat a new colleague with access to your files: useful immediately, but worth double-checking until you have a feel for where it is strong and where it still needs a human glance at the source.

Frequently asked questions

What is MCP and why does it matter for connecting Claude or Cursor?

MCP (Model Context Protocol) is an open standard that lets an AI assistant discover and call external tools, such as a knowledge base, during a conversation. It means you configure the connection once rather than writing custom integration code for every assistant you use.

Can I connect ChatGPT to a knowledge base without MCP?

Yes. ChatGPT's custom GPTs and the API support tool calling through HTTP actions, which works directly with a REST API key from most knowledge base platforms. MCP support varies by client, so the API route is currently the more universal option for ChatGPT.

Do I need to pay per question when an agent queries my knowledge base?

Usually yes, whether the question comes from a human typing on the website or an assistant calling it through MCP or the API. Pricing models vary: some platforms use prepaid credits per question, others offer a flat monthly subscription with a usage gauge.

How do I know the AI answer is actually based on my documents and not made up?

Check that the response includes a citation pointing to a specific passage, not just a document name. Querying in passages-only mode occasionally is also a good way to confirm the retrieval itself is accurate before trusting a synthesised answer.

Can I keep my knowledge base private while still using it from Claude or Cursor?

Yes. A private base is only reachable by the owner and their own API keys or MCP connection details. Connecting it to Claude or Cursor does not make it public or searchable by anyone else.

Which is better for a small team: API keys or MCP?

If your team mainly works inside Claude or Cursor and wants the assistant to decide when to consult the documents, MCP feels more natural. If you are building a custom tool, dashboard or ChatGPT action, a REST API key gives you more control over formatting and access logging.

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.