Integrations

How to Connect Claude, Cursor or ChatGPT to a Knowledge Base

The Kopik team9 min read

You can connect Claude, Cursor or ChatGPT to a knowledge base in two ways: add an MCP server so the assistant can call a search tool directly inside the chat, or wire a REST API tool with an API key for more custom integrations. Both paths let your agent answer questions with citations pulled from your own documents instead of guessing from training data. This guide walks through each option step by step.

Why connect an AI agent to a knowledge base at all

Claude, Cursor and ChatGPT are capable at reasoning and writing, but they have no idea what is inside your internal PDFs, your product manuals or your compliance documents unless you paste that text into the chat every time. A knowledge base solves that by indexing your documents once (extraction, chunking, hybrid search) and exposing a query endpoint the assistant can call on demand. Instead of copy-pasting, the model asks a question, gets back the most relevant passages with citations, and writes its answer grounded in those passages.

This pattern is exactly what retrieval-augmented generation is built for, and the Model Context Protocol (MCP) is the standard that makes it easy to plug a knowledge base into an MCP-compatible client like Claude or Cursor without writing custom glue code.

Two ways to connect: MCP server vs. REST API tool

Before you set anything up, decide which integration path fits your workflow.

MCP server vs. REST API

MCP serverREST API with API key
Best forClaude Desktop, Cursor, other MCP clientsCustom apps, backend scripts, ChatGPT custom GPTs/Actions
Setup effortAdd a config entry, doneGenerate a key, write an HTTP call
AuthenticationAPI key stored in the MCP configAPI key in request header
OutputTool call result shown inline in chatJSON response you parse yourself
FlexibilityFixed to what the MCP tool exposesFull control over prompts, formatting, retries

If you already live inside Claude Desktop or Cursor, the MCP route takes minutes. If you are building a ChatGPT custom GPT, an internal tool, or a script that batches questions, the REST API gives you more control. Kopik supports both: every knowledge base on the catalogue or created privately can be queried through an MCP server or a REST API.

Connecting Claude to a knowledge base via MCP

Claude Desktop reads a configuration file that lists the MCP servers it should start when the app launches. Each server definition points to a command and passes any required environment variables, such as an API key.

  1. Create or open an existing knowledge base. If you don't have one yet, upload your documents at create a knowledge base: PDF, Word, text or Markdown all work.
  2. Generate an API key for that base from your dashboard. Keep it private if the base itself is private; public bases still need a key to track usage and billing.
  3. Open Claude's MCP configuration (on Claude Desktop this is a JSON file under the app's settings) and add an entry pointing to the Kopik MCP server with your API key as an environment variable.
  4. Restart Claude Desktop. The new tool should appear in the tool list for that conversation.
  5. Ask a question naturally, for example: "Using my onboarding-docs knowledge base, what is our PTO carryover policy?" Claude will call the tool, retrieve passages, and answer with citations.

The exact JSON snippet and server name are detailed in the developer documentation, and a full walkthrough with screenshots lives in how to give Claude access to your company documents. Once configured, you don't need to repeat the setup per conversation, Claude keeps the tool available across sessions.

Name your bases clearly

If you connect more than one knowledge base to the same MCP client, give each one a descriptive name (like "hr-policies" or "product-specs-2026"). Claude and Cursor will pick the right tool faster when the name hints at the content.

Connecting Cursor to a knowledge base via MCP

Cursor supports MCP servers the same way Claude Desktop does, which makes it useful for developers who want their coding assistant to answer questions from internal API documentation, architecture decision records, or a vendor's technical manual without leaving the editor.

  1. Open Cursor's settings and find the MCP servers section.
  2. Add a new server entry with the command and API key for your Kopik knowledge base, following the same format shown in the developer docs.
  3. Save and reload the MCP connection. Cursor will list the tool as available for the current workspace.
  4. In the chat panel, reference the tool explicitly if needed, for example: "Search the infra-runbooks base for how we rotate database credentials."
  5. Review the cited passages Cursor returns before applying any suggested code change, especially for security-sensitive procedures.

A dedicated tutorial with configuration screenshots is available at add documentation search to Cursor with MCP. The same base can be shared across a team: everyone points their own Cursor installation at the same API key (or individual keys if you want per-user usage tracking).

Connecting ChatGPT to a knowledge base

ChatGPT does not yet support MCP the same way Claude and Cursor do, but you can still connect it to a knowledge base through its Actions/custom tools mechanism (available on custom GPTs and in some API-driven workflows) or by calling the REST API directly from a script that feeds results back into the conversation.

  1. Generate an API key from your Kopik dashboard for the knowledge base you want ChatGPT to use.
  2. Create a custom GPT (or use the API) and define an action that calls the knowledge base's question endpoint, passing the user's query as a parameter.
  3. Set the authentication method to API key and paste your key into the action's configuration.
  4. Test with a sample question. The response will include the generated answer plus the source passages used, which you can display back to the user or keep as an internal reference.
  5. If you need
  6. mode (raw passages instead of a generated answer), switch the endpoint parameter accordingly, useful when you want ChatGPT itself to write the final answer from retrieved text.

Because ChatGPT's action format expects an OpenAPI schema, the developer documentation includes a ready-to-import schema you can paste directly into the custom GPT builder, which saves you from writing it by hand.

Authentication and key management basics

Whichever client you connect, the underlying authentication model is the same: an API key tied to one knowledge base (or your account) that controls access and meters usage.

  • Private bases: only you and whoever holds your API keys can query them. Rotate keys if a teammate leaves or a key leaks.
  • Public bases: listed in the catalogue, anyone can query them per question, and the creator earns 70% of what's paid, but you still need a key (even a free-tier one) to query programmatically.
  • Separate keys per integration: use one key for Claude, another for Cursor, another for a ChatGPT action. If something misbehaves, you can revoke a single key without breaking every connection.
  • Environment variables, not hardcoded strings: store keys in your MCP config's environment section or in a secrets manager, never commit them to a shared repository.

Asking questions that return sourced answers

Once the tool is connected, the quality of answers depends partly on how you ask. A few habits make a real difference.

  1. Be specific about scope: "According to the 2026 employee handbook, how many sick days do part-time employees get?" retrieves more precisely than a vague "what are the benefits?"
  2. Ask for sources explicitly if your client doesn't show them by default: "Answer and cite the exact passage."
  3. Follow up inside the same thread: most clients keep the tool available, so you can ask a clarifying question without reconfiguring anything.
  4. Cross-check anything that will inform a decision with real consequences (legal, medical, financial). Retrieval reduces hallucination but doesn't eliminate the need for human review, see how to verify an AI answer's sources for a quick checklist.

Under the hood, the mechanics are the same regardless of which assistant you're using: your question gets embedded, matched against indexed chunks using hybrid full-text and semantic search, and the top passages are either returned directly (passages mode) or fed to a model that writes a grounded answer with citations. If you want the deeper mechanics, how RAG works step by step walks through the whole pipeline from upload to answer.

Choosing between a website search, API or MCP

Not every use case needs an AI agent integration. If you're the only person asking occasional questions, querying directly on the Kopik website is simpler than setting up a connection. MCP and API access make sense when:

  • You want the knowledge base available inside a tool you already use daily (Claude, Cursor, a custom app).
  • Multiple people or automated workflows need to query the same base repeatedly.
  • You're building a product feature (a support bot, an internal search tool) that needs programmatic access with your own UI.

If you're still deciding where to find other MCP servers to pair with your knowledge base (for example, combining document search with a ticketing system or a code repository tool), this directory of MCP servers is a good starting point.

Connect your first knowledge base

Upload your documents, generate an API key, and wire it into Claude, Cursor or a custom ChatGPT action in one sitting.

Troubleshooting common connection issues

  • Tool not showing up in Claude or Cursor: confirm the MCP config file was saved in the right location and that you restarted the app, not just reloaded the chat window.
  • 401 or 403 errors: the API key is missing, expired, or scoped to a different base. Regenerate the key from your dashboard and update the config.
  • Answers ignore your documents: double-check you're pointing at the correct base name, especially if you manage several, and confirm the documents finished indexing (large PDFs can take a minute).
  • ChatGPT action fails validation: the OpenAPI schema likely doesn't match the endpoint exactly. Re-import the schema from the developer docs rather than editing it by hand.

Most connection problems trace back to a mismatched key, an unsaved config, or asking the wrong knowledge base for information it doesn't contain. Working through that short list resolves the majority of cases before you need to dig further.

Frequently asked questions

Can I connect more than one knowledge base to the same Claude or Cursor setup?

Yes. Add each base as a separate MCP server entry with its own API key and a descriptive name so the assistant can tell which tool to call for a given question.

Does ChatGPT support MCP the same way Claude and Cursor do?

Not natively as of this writing. ChatGPT connects to external tools through custom GPT actions or direct API calls, which require importing an OpenAPI schema rather than a simple MCP config entry.

Do I need a public knowledge base to use it with Claude or Cursor?

No. Private knowledge bases work the same way through MCP or the API, only you and whoever holds your API key can query them, and nothing is listed in the public catalogue.

What happens if the assistant can't find an answer in the documents?

A well-built retrieval tool should say it found no relevant passage rather than inventing one. If your assistant keeps answering from general knowledge instead, check that it's actually calling the knowledge base tool and that the documents cover the topic.

Is querying through MCP or the API billed differently than using the website?

The underlying usage is metered the same way, per question against prepaid credits or a subscription gauge, regardless of whether you ask on the website, through the API, or via an MCP client.

Can I restrict which documents an agent can see within a knowledge base?

Access control currently applies at the knowledge base level rather than per document, so if you need to separate confidential and general content, split them into two bases with different API keys.

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.

Connect Claude, Cursor or ChatGPT to a Knowledge Base