---
name: agent-onboarding
description: Connect to the Kapa platform MCP server through the Kapa plugin or a connector, see where the user's project stands, and set it up for them by ingesting a first source, testing the index, and deploying it.
url: https://docs.kapa.ai/agent-onboarding/SKILL.md
---

# Set up Kapa

Kapa is an ingestion and retrieval system for unstructured knowledge. It
ingests a team's knowledge sources into one knowledge base, keeps it in sync,
and serves it to agents through an MCP server or a retrieval API, or to people
through Prebuilt Agents such as a Website Widget or a Slack Bot.

The user asked you either to connect to Kapa or to set up their Kapa
project. Both start the same way: you install the Kapa plugin, which connects
you to the Kapa platform MCP server and adds the Kapa skills. From then on you
can call the whole Kapa platform through that server's tools, and the skills
tell you how to set up each kind of source. Then you look at the project and
tell the user where it stands. If they asked only to connect, you report and
stop there. If they asked for a setup, you ingest a first source, test the
index, deploy it, and report. Work through the parts below in that order.

Terms used in this file:

- A **project** holds one knowledge base: its sources, its index, and the
  integrations that serve it. Everything you set up lives in one project.
- A **source** is one place Kapa ingests from, such as a documentation site
  or a GitHub repository. Ingesting a source builds its content into the
  project's index and keeps it in sync.
- The **Kapa platform MCP server**, at `https://mcp.kapa.ai/mcp`, exposes the
  Kapa platform as tools: list projects, create and configure sources, start
  ingests, search the index, create integrations, read analytics. It acts as
  the signed-in user, with their Kapa permissions.
- The **Kapa plugin** bundles that server with the `kapa-setup-*` skills,
  one per source type, each carrying the exact call sequence. Without the
  skills you still have the tools, but only their descriptions to go on.
- A project's own **hosted MCP server**, at `<slug>.mcp.kapa.ai`, only
  searches that project's index. It is something you create for the user in
  part 3.5, not something you set up through.

## How to run

Run every step you can yourself. Stop only for steps that need the user:
signing in, choosing a project and a source, giving credentials, confirming
an ingest, and actions in another product. For each of those, give the user
the exact command, link, or value, then wait for their answer. If a step is
blocked, note why and carry on with the steps that do not depend on it.

If you are a chat assistant with no shell, such as ChatGPT or Claude, the
user was asked to connect Kapa before pasting this prompt, so start with
"Reuse a working connection" in part 1 like every other client.

What the user asked for decides where you stop. "Connect me" means you stop
after part 2, with the connection working and the user told where their
project stands and what they can ask for. "Set up my project" means you
continue through part 3. When the request is unclear, ask.

Sending this same prompt again later is safe: part 1 finds the existing
connection, part 2 finds where the project stands, and you pick up where you
stopped.

## Rules

- **Credentials belong to the user.** Ask the user for every token a source
  needs. Never invent one, and never use a credential the user gave you for
  another purpose. The Kapa API key in part 3.5 is the only one you create.
- **Ingesting spends the user's quota.** Confirm with the user before any
  call that starts an ingest. Part 3.3 says which calls do.
- **Ask what to ingest, do not decide it.** Show the user which projects,
  spaces, labels, or channels a source can read and let them pick. Taking
  everything is a valid choice, so do not filter on the user's behalf without
  saying so.
- **Keep confirmation on.** Do not change your client's approval settings so
  Kapa tools run without the user confirming. The server acts with the user's
  real Kapa permissions.
- **When a source ingests nothing**, it is usually a permission the user has
  not granted yet, not a configuration error. Tell the user which permission
  to check.

## 1. Connect

Connecting needs no API key: no tool takes a Kapa credential as an argument.
The server signs the user in through the browser on first use.

### Reuse a working connection

Look for the Kapa platform server among the servers you can call. Identify
it by its URL, `https://mcp.kapa.ai/mcp`, when your client shows it, or by its
tools: it has `list_projects` together with `search_kapa_docs`. Other servers
also expose a `list_projects` tool, so the name of that tool alone is not
enough, and the server's display name is not either. A server at
`<slug>.mcp.kapa.ai` is one project's own search server: it cannot set
anything up, and it is not a copy of the platform server, so leave it in
place.

- If `list_projects` is there, call it. If it succeeds, the connection works.
  If it fails with an authentication error, go to "Sign in and report
  readiness". Do not install a second copy.
- If a Kapa server is listed but shows only a sign-in or authentication tool,
  it is installed but not signed in. Go to "Sign in and report readiness".
- If a platform server is listed but fails for a reason other than sign-in,
  retry once. A server error or a rate limit passes on its own; reinstalling
  does not help. If it still fails, show the user the error and ask whether to
  replace the entry: in Claude, edit or remove it under **Settings** >
  **Connectors**; in a coding agent, remove its entry from the configuration.
  Then install the plugin below.
- If no Kapa server is listed, install the plugin below.

A chat assistant cannot install the plugin: where this list says to install
it, go to "Chat assistants" instead.

Once the connection works, check that the `kapa-setup` skill and the
`kapa-setup-*` skills in part 3.2 are available. If you are a coding agent and
they are not, install the plugin for your harness as described below, so you
get the call sequences rather than only the tool list. Keep one Kapa server:
where the install adds its own server entry next to the working one, remove
the one that was added by hand; where it only adds a server entry of the
same kind, skip that step and add only the skills. If `list_projects`
succeeded and you installed nothing, go to part 2. Otherwise go to "Sign in
and report readiness".

### Install the Kapa plugin

Install the plugin for the harness you are running in.

- **Claude Code.** Run these in a shell:

  ```bash
  claude plugin marketplace add kapa-ai/kapa-plugin
  claude plugin install kapa@kapa
  ```

  If you cannot run shell commands, ask the user to run these inside Claude
  Code instead:

  ```
  /plugin marketplace add kapa-ai/kapa-plugin
  /plugin install kapa@kapa
  ```

- **Codex.** Run this in a shell. It installs Kapa from the plugin directory
  that ChatGPT and Codex share, so the plugin receives updates:

  ```bash
  codex plugin add kapa@openai-curated-remote
  ```

  If you cannot run shell commands, ask the user to run `/plugins` inside
  Codex, search for **Kapa**, and install it. Kapa is listed there even when
  a plugin search tool in your session returns nothing.

- **Cursor.** Ask the user to run `/add-plugin kapa` in Cursor's agent chat,
  or to install the plugin from https://cursor.com/marketplace/kapa.
- **Gemini CLI.** Run this in a shell, then install the skills from
  https://github.com/kapa-ai/kapa-plugin:

  ```bash
  gemini mcp add kapa https://mcp.kapa.ai/mcp --transport http
  ```

- **opencode.** Add the server to the user's `opencode.json`, then copy the
  `skills/` directory of https://github.com/kapa-ai/kapa-plugin to wherever
  opencode reads skills from:

  ```json
  {
    "$schema": "https://opencode.ai/config.json",
    "mcp": {
      "kapa": {
        "type": "remote",
        "url": "https://mcp.kapa.ai/mcp",
        "enabled": true
      }
    }
  }
  ```

- **Any other MCP client.** Add the server to the client's configuration,
  then copy the `skills/` directory of https://github.com/kapa-ai/kapa-plugin
  to wherever that client reads skills from:

  ```json
  { "mcpServers": { "kapa": { "url": "https://mcp.kapa.ai/mcp" } } }
  ```

If a command fails because your sandbox blocks it, or you cannot run shell
commands, give the user the same commands to run in their own terminal, then
continue once they confirm.

Before editing a configuration file, read it and add the `kapa` entry next to
the existing servers. Do not replace other settings. Prefer the client's
user-level configuration over a file inside a repository. Field names differ
between clients, so follow the client's MCP documentation if it does not use
`url`. If you do not know where your client reads skills from, ask the user
rather than guessing.

After installing, check that the `kapa-setup-*` skills are listed.

### Chat assistants

A chat assistant cannot install the plugin itself, so hand the user the step.

- **ChatGPT.** Ask the user to add Kapa from the ChatGPT plugin directory,
  https://chatgpt.com/plugins/plugin_asdk_app_6ac3d7b5fe88819198d51c023f1e8e96,
  then to turn it on in this conversation.
- **Claude.** Ask the user to open **Settings** > **Connectors**, click
  **Add custom connector**, name it `Kapa`, set the server URL to
  `https://mcp.kapa.ai/mcp`, click **Add**, then **Connect** and complete the
  Kapa sign-in in the browser window that opens. On a Team or Enterprise plan
  an organization owner adds the connector under **Admin settings** >
  **Connectors** first, and members then connect it from their own settings.
  If a connector for `https://mcp.kapa.ai/mcp` is already listed, ask the
  user to reconnect or remove it instead of adding a second one; a connector
  for a project's search server is a different thing and stays. Finally, ask
  the user to turn Kapa on in this conversation.

If the user cannot add it now, report the connection as pending with the link
and the remaining step. Once connected, check whether the `kapa-setup-*`
skills are available: the ChatGPT plugin bundles them, a Claude connector
does not. Without them, this file carries the whole flow, and the tool
descriptions carry the arguments for each call.

### Sign in and report readiness

If you installed nothing in this session, skip the reload and call
`list_projects`.

A plugin installed from a shell is not loaded in the session that is already
open. Where the harness can load it in place, ask for that, so the user keeps
this conversation:

- **Claude Code:** ask the user to run `/reload-plugins`. If it reports the
  reload as pending, `/reload-plugins --force`.
- **Gemini CLI:** ask the user to run `/mcp reload`.
- **Cursor:** if the Kapa tools do not appear, ask the user to run
  **Developer: Reload Window** from the command palette.
- **Codex, opencode, and any other client:** there is no reload command. Ask
  the user to start a new session and send this same prompt again there.

In a chat assistant, the user may also need to turn Kapa on for the
conversation.

The first call to the Kapa server asks the user to sign in. If `list_projects`
fails with an authentication error, ask the user to sign in to the Kapa server
(in Claude Code, through `/mcp`; other clients prompt for it or offer a
reconnect), then wait for them to confirm before retrying.

Before that first sign-in, ask whether the user already has a Kapa account.
If not, send them to https://app.kapa.ai/auth/signup and ask them to confirm
when they are done. Signing up creates their team and its first project, so
the sign-in above works afterwards. A user who came from the Kapa dashboard
has an account, but the Kapa server still asks them to sign in once.

Report the connection and the sign-in as two separate statuses, for example
"connected, sign-in pending". A pending sign-in does not undo the connection,
and a connected server does not prove this session has its tools.

## 2. Choose the project and see where it stands

### 2.1 Choose the project

Call `list_projects`. It takes no arguments and returns the signed-in user,
their team, and every project in that team, with the user's permissions on
each. Show the user the account and team it returned.

- **One project:** use it.
- **Several projects:** ask the user which one to work on. Do not pick for
  them.
- **No projects:** tell the user which account and team are signed in, and
  ask whether that is the account they use for Kapa. If it is not, ask them
  to sign in to the Kapa server with the right account. If it is, ask them to
  create a project in the Kapa dashboard at https://app.kapa.ai under
  **Settings** > **Projects**, then call `list_projects` again.

Keep the project id and pass it to every later call.

If a later call fails with a permission error, the user lacks that permission
on this project. Tell them which call failed and ask them to choose another
project or to ask a team administrator.

### 2.2 See where the project stands

Call `list_sources` and `list_integrations` with the project id. Each source
reports its state in `incremental_status`, an error in `incremental_error`
with `is_incremental_error_user_actionable`, pages waiting for approval in
`ready_for_review`, and its content in `deployed_markdown_items`. Kapa creates
some integrations itself: ignore the `INTERNAL_ASSISTANT`, `PLAYGROUND`, and
`PLATFORM_MCP` types, which say nothing about what the user deployed. From
that, work out which setup step comes next:

| The project has | Next step |
| :-- | :-- |
| No sources | Ingest a first source, part 3.1 |
| A source with status `not_configured` | Finish its configuration with its skill, part 3.2 |
| A source with status `initial_ingest` or `updating` | Wait for it, part 3.3 |
| A source with status `error` | If the error is user-actionable, show it and ask the user to fix it, usually a permission; otherwise tell the user and check again later |
| A source with `ready_for_review` | Approve its pages with `list_pages_for_review` and `approve_pages_for_review`, part 3.3 |
| Sources with content and no integration of another type | Test the index and deploy it, parts 3.4 and 3.5 |
| Sources with content and an integration of another type | The setup is done |

Content in the index does not prove it answers well: that takes a test query,
part 3.4, and a project is only known to work once one has passed in this
session. Tell the user what the project holds and which step comes next, in
plain words. When the setup is done, offer the things the tools can do from
here: add another source, check what is ingested, run a test query, or read
the analytics with `get_project_activity`, `get_top_questions`, and
`get_coverage_gaps`.

If the user asked only to connect, report as described in part 4 and stop.
Carry out the next step only if they ask for it. Otherwise go to part 3 and
start at the step the table points to.

## 3. Set up

Start at the step part 2.2 pointed to. The steps before it are done already.

### 3.1 Choose what to ingest

You listed the project's sources in part 2.2. If a source already covers what
the user wants, offer to continue or fix it with that source's skill instead
of creating a second one.

Ask the user, do not pick for them. Kapa can ingest a documentation website, a
GitHub repository, a knowledge base (Zendesk Help Center, Confluence, Notion),
a support history (Zendesk tickets, Jira, Jira Service Management), a
community (Slack, Discord, Discourse), reference material (an OpenAPI spec, a
YouTube channel, Google Drive, files in S3), or question and answer pairs the
user writes themselves.

Most projects start with a documentation site. Suggest that if the user is
unsure. If you are working in a repository, look for its documentation URL,
for example in the README or the documentation site configuration, and offer
it. Still let the user decide.

### 3.2 Configure the source with its skill

Each skill carries the exact call order, the fields that matter, and the
things that commonly go wrong:

| The user wants to ingest | Skill |
| :-- | :-- |
| A documentation website | kapa-setup-web-crawl |
| GitHub documentation or code files | kapa-setup-github-files |
| GitHub issues | kapa-setup-github-issues |
| GitHub discussions | kapa-setup-github-discussions |
| GitHub pull requests | kapa-setup-github-pull-requests |
| Zendesk Help Center | kapa-setup-zendesk-helpcenter |
| Zendesk tickets | kapa-setup-zendesk-tickets |
| Confluence | kapa-setup-confluence |
| Jira | kapa-setup-jira |
| Jira Service Management | kapa-setup-jira-service-management |
| Notion | kapa-setup-notion |
| Slack | kapa-setup-slack |
| Discord | kapa-setup-discord |
| Discourse | kapa-setup-discourse |
| An OpenAPI spec | kapa-setup-openapi |
| A YouTube channel | kapa-setup-youtube |
| Google Drive | kapa-setup-google-drive |
| Files in S3 | kapa-setup-s3 |
| Answers the user writes themselves | kapa-setup-custom-qa |

If you cannot load a skill, the tool descriptions carry the same arguments:
every source is `create_*_source` for an id, then a configuration call:
`set_<type>_config` for most sources, or `connect_<type>` followed by
`configure_<type>` for Zendesk, Salesforce, and Google Drive. Every source has
a validate tool and most have discovery tools; use them before saving, because
a wrong credential otherwise shows up as a source that silently ingests
nothing. Use `search_kapa_docs` when unsure how a Kapa feature works, rather
than guessing.

### 3.3 Wait for the source to ingest

Ingesting spends the user's quota. For every source except a web crawl,
saving the configuration starts the ingest, so before that call tell the user
what the source will ingest and wait for them to confirm. There is nothing
else to call afterwards.

A **web crawl** does nothing until it is started. Preview it first: call
`preview_crawl`, then `get_crawl_status`, then `list_preview_pages`, and show
the user the extracted text of a few pages. If the text is navigation rather
than article content, use `inspect_content_selector` and
`set_content_selector` until it is right. Then confirm with the user and call
`start_crawl`, or `start_crawl_with_review` if they want to approve pages
before they are ingested. Do not leave a crawl configured but never started.
A crawl started with review waits for approval: call `list_pages_for_review`,
show the user the pages, and pass the ones they want to
`approve_pages_for_review`.

Either way, ingesting takes time. Call `list_sources` with `project_id` and
show the user what the project holds and the ingestion status each source
reports.

### 3.4 Test the index with a few queries

Wait until the source reports content before this. Check `list_sources` again
from time to time, not in a tight loop. If the source still has no content
after a few checks, tell the user the index test is pending, carry on with
part 3.5, and come back to it before you report.

Ask the user for a question their content should answer, or suggest one from
what was ingested, and call `search_project_knowledge` with the project id.
Show the user what comes back.

If the answer is thin or wrong, say so rather than declaring success. For a
web crawl, that usually means the crawl kept navigation rather than article
text. For other sources, the filters were usually too narrow or the account
could not read part of the content. Offer to fix it with the skill for that
source, and confirm before ingesting again.

### 3.5 Deploy the index

Deploying connects the index to the places where it gets used. There are two
ways. Ask the user which they want. More than one is fine, and none for now
is fine.

**Prebuilt Agents** deploy out of the box, with no code:

- A **Website Widget**, the chat bubble on a documentation site:
  `create_widget_integration`. Pass `enabled_domains` to limit where it can be
  embedded. At least one domain is required, so ask the user for the domains.
  The embed snippet is on the dashboard's integrations page. If you are
  working in the repository of the site that will host it, offer to add the
  snippet there.
- A **Slack Bot**: `create_slack_bot_integration` with the user's workspace
  and channel ids. Then a workspace administrator installs the Kapa Slack app,
  invites it to the channel, and runs `/kapa-enable-channel <integration id>`
  there. It answers nothing until then, and you cannot enable it for the user.
- A **Discord Bot**, the same shape: `create_discord_bot_integration`, then a
  server administrator adds the Kapa app and sends
  `!kapa_enable_channel <integration id>` in the channel. Ask the user for the
  server and channel ids; Discord only shows them once Developer Mode is on,
  under User Settings then Advanced.
- **The user's own MCP server**, so their agents can query their content:
  `create_mcp_integration`. It is served at `<url_slug>.mcp.kapa.ai`, so ask
  the user what slug they want and how callers should authenticate.
- A **Support Form Deflector**, which answers before the user's customers file
  a ticket: `create_support_form_deflector_integration`. It needs
  `enabled_domains` with at least one domain that hosts the form.

**Building on Kapa** means calling the retrieval API directly and putting a
custom experience in front of it. For that, do both of these:

1. `create_api_integration`, which is how these queries show up as their own
   caller in analytics rather than mixed in with the widget's.
2. `create_api_key`. It comes back once, in `private_api_key`, and cannot be
   read again, so show it to the user and tell them to store it somewhere
   safe. Keep it in an environment variable such as `KAPA_API_KEY`, not in a
   command you display or in a file that is committed.

Then show the user a call that works, and run it yourself if you can run
shell commands:

```bash
curl -X POST "https://api.kapa.ai/query/v1/projects/<project_id>/retrieval/" \
  -H "X-API-KEY: $KAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "a question the content answers", "integration_id": "<id>"}'
```

It answers with the matching chunks and their source URLs, and no generated
text: retrieval returns what the content says and leaves the answering to
whatever the user puts in front of it. `top_k`, `max_chars`, and `use_pruning`
are optional.

Point the user at
https://docs.kapa.ai/api/reference/query-v-1-projects-chat-create for the
chat endpoint if they want generated answers rather than chunks.

If the user is building their own agent, follow
https://docs.kapa.ai/getting-started/connect-an-ai-agent.md instead: it
creates a hosted MCP server over the project and hands its search tool to the
agent in one API call. If you are working in that agent's codebase, offer to
wire the tool in there.

## 4. Report what is done

Report only what you checked in this session, one line each. After a setup:

```text
Kapa setup
Connection: <working | sign-in pending | blocked: reason>
Skills: <installed | not available in this client>
Project: <name and id>
Source: <type, status from list_sources>
Index test: <passed | weak: reason | pending ingest>
Deployed: <integration and id | none yet>
Your next steps: <each step only the user can do, with its command or link>
```

When the user asked only to connect:

```text
Kapa connection
Connection: <working | sign-in pending | blocked: reason>
Skills: <installed | not available in this client>
Signed in as: <user and team from list_projects>
Project: <name, what it holds, and the next step from part 2.2>
Your next steps: <each step only the user can do, with its command or link>
```

Then tell the user what they can ask for next. If anything is pending, tell
them they can send the same prompt again later to continue. If they want a
guided first setup, point them to
https://docs.kapa.ai/getting-started/set-up-with-a-coding-agent and stop
after the report.
