Skip to content

Commit 9c80dfe

Browse files
authored
docs: add Kosli MCP server integration page (#359)
## What Adds a documentation page for the [Kosli MCP server](https://github.com/kosli-dev/mcp-server), which exposes the Kosli API to AI assistants over the Model Context Protocol. ## Changes - **`integrations/mcp_server.md`** (new) - install, configuration, how the three generic tools work, read-only example prompts, limitations. - **`config/navigation.json`** - added to the Integrations group. - **`understand_kosli/ai_docs_access.md`** - cross-link, so the docs MCP server and the API MCP server point at each other. One reads the documentation, the other reads your org's data. ## Updated against `v0.5.0` The preview page had drifted from the server: - Node floor raised from **v20 to v22**. - Added the beta warning and version-pinning guidance (`npx -y @kosli/mcp-server@0.5.0`). - Added a caution on `execute_write_action` - the client's approval prompt is the only checkpoint, and an assistant can select the wrong action, or the right action with the wrong parameters. - Fixed a broken link: the old page pointed at `/getting_started/service-accounts`, which does not exist. Now links `/user/personal_api_keys` for local use and `/administration/authentication/service_accounts` for automation. ## Beta treatment Uses `tag: "BETA"` in the front matter, matching the `client_reference/` pages, plus an inline `<Warning>`. Deliberately *not* reusing `snippets/cli-beta-notice.mdx` - it ends with "Please contact us to enable this feature for your organization", which is untrue here: the server is a public npm package with nothing to enable. ## Verification `mint broken-links` passes on everything touched here. It reports one **pre-existing** failure, left alone as out of scope: ``` tutorials/working_with_controls.mdx ⎿ /getting_started/service-accounts ``` That is the same bad path the old preview page carried. Happy to fix it in a follow-up.
1 parent e60029e commit 9c80dfe

3 files changed

Lines changed: 132 additions & 1 deletion

File tree

‎config/navigation.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@
177177
"integrations/ci_cd",
178178
"integrations/slack",
179179
"integrations/launchdarkly",
180-
"integrations/sonar"
180+
"integrations/sonar",
181+
"integrations/mcp_server"
181182
]
182183
}
183184
]

‎integrations/mcp_server.md‎

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: MCP server
3+
description: Connect AI assistants such as Claude Code and Claude Desktop to the Kosli API using the Model Context Protocol.
4+
tag: "BETA"
5+
---
6+
7+
The Kosli MCP server is a [Model Context Protocol](https://modelcontextprotocol.io) server that exposes the Kosli API to AI assistants. Once it is connected, you can ask questions like _"which environments are non-compliant, and why?"_ and the assistant calls the relevant Kosli endpoints to answer.
8+
9+
It is published from [`kosli-dev/mcp-server`](https://github.com/kosli-dev/mcp-server) and distributed as an npm package (`@kosli/mcp-server`) and as a `.mcpb` bundle for Claude Desktop.
10+
11+
<Warning>
12+
The Kosli MCP server is in beta. Tool names, parameters, and behavior may change between releases. Pin a version if you need stability: `npx -y @kosli/mcp-server@0.5.0`.
13+
</Warning>
14+
15+
<Note>
16+
This server reads the data in your Kosli organization. To let an AI assistant search this documentation instead, see [AI access to these docs](/understand_kosli/ai_docs_access). The two are complementary, and you can connect both.
17+
</Note>
18+
19+
## How it works
20+
21+
Rather than ship one tool per Kosli endpoint, the server generates a catalog of actions from Kosli's OpenAPI spec and exposes three generic tools:
22+
23+
| Tool | Purpose |
24+
|------|---------|
25+
| `search_actions` | Fuzzy-search the catalog for relevant actions by natural-language query. |
26+
| `execute_read_action` | Invoke any `GET` action by ID. Auto-allowed in MCP clients. |
27+
| `execute_write_action` | Invoke any `POST`, `PUT`, `PATCH`, or `DELETE` action by ID. Gated behind user approval. |
28+
29+
These are the tool names your client shows as the assistant works, and the name in the prompt when it asks you to approve a write.
30+
31+
<Warning>
32+
`execute_write_action` creates, modifies, and deletes real resources in your Kosli organization. MCP clients gate these calls behind an approval prompt, and that prompt is the only checkpoint before the call is made. An assistant may choose the wrong action, or the right action with the wrong parameters, so read the action ID and parameters before approving. Treat deletions and anything touching service accounts or API keys with particular care.
33+
</Warning>
34+
35+
## Prerequisites
36+
37+
- Node.js v22 or higher, for the `npx`-based install methods. You do not need it for the `.mcpb` bundle, because Claude Desktop ships its own Node runtime.
38+
- A Kosli API key. Use a [personal API key](/user/personal_api_keys) when you run the server on your own machine, or a [service account key](/administration/authentication/service_accounts) for automation.
39+
- An MCP-capable client, such as Claude Code or Claude Desktop.
40+
41+
## Install
42+
43+
<Tabs>
44+
<Tab title="Claude Code">
45+
Run this from your project directory, or add `--scope user` to install it globally:
46+
47+
```bash
48+
claude mcp add kosli \
49+
-e KOSLI_API_TOKEN=your-token \
50+
-e KOSLI_ORG=your-org \
51+
-- npx -y @kosli/mcp-server
52+
```
53+
</Tab>
54+
<Tab title="Claude Desktop (.mcpb)">
55+
Download the latest `.mcpb` file from the [releases page](https://github.com/kosli-dev/mcp-server/releases) and drag it into Claude Desktop, or double-click it to install. Claude Desktop prompts you for your API key and organization, and stores the secrets in your operating system keychain.
56+
57+
This is the recommended method for Claude Desktop.
58+
59+
<Note>
60+
Extensions installed from a file show an "unverified by Anthropic" warning and do not auto-update, so you need to download and reinstall new versions manually. Both limitations go away once the extension is listed in Anthropic's [Connectors Directory](https://claude.com/docs/connectors/building/submission).
61+
</Note>
62+
</Tab>
63+
<Tab title="Claude Desktop (manual)">
64+
Add the following to `claude_desktop_config.json`, which you can open from **Settings → Developer → Edit Config**:
65+
66+
```json
67+
{
68+
"mcpServers": {
69+
"kosli": {
70+
"command": "npx",
71+
"args": ["-y", "@kosli/mcp-server"],
72+
"env": {
73+
"KOSLI_API_TOKEN": "your-token",
74+
"KOSLI_ORG": "your-org"
75+
}
76+
}
77+
}
78+
}
79+
```
80+
81+
This method auto-updates through `npx` on each restart, but stores your API key in plain text.
82+
</Tab>
83+
<Tab title="Other MCP clients">
84+
The server communicates over stdio. Point any MCP-capable client at the package with `npx -y @kosli/mcp-server` and set the environment variables below.
85+
</Tab>
86+
</Tabs>
87+
88+
## Configuration
89+
90+
The server reads its configuration from environment variables.
91+
92+
| Variable | Required | Default | Notes |
93+
|----------|----------|---------|-------|
94+
| `KOSLI_API_TOKEN` | yes | - | `KOSLI_API_KEY` is accepted as a fallback. |
95+
| `KOSLI_ORG` | yes | - | Default org. Used as the `org` path parameter when an action does not supply one. |
96+
| `KOSLI_BASE_URL` | no | `https://app.kosli.com` | Use `https://app.us.kosli.com` for US, or your own single-tenant endpoint. |
97+
98+
## Example prompts
99+
100+
These prompts only read data, so they run without an approval step. Replace the environment, flow, and trail names with your own.
101+
102+
### Environments and compliance
103+
104+
- "Which of my environments are non-compliant, and why?"
105+
- "What is running in `prod-aws` right now?"
106+
- "Has anything changed in `prod-aws` since yesterday?"
107+
108+
The assistant answers these from [environment snapshots](/getting_started/environments), so it can report both the current state and the reasons an environment is not compliant.
109+
110+
### Audit and evidence
111+
112+
- "List every deployment to `prod-aws` in the last 30 days."
113+
- "What attestations are on trail `release-456` in flow `my-release`?"
114+
- "Which artifacts running in `prod-aws` have no security scan attestation?"
115+
116+
The last prompt takes several tool calls, because the assistant has to list what is running and then check the [attestations](/getting_started/attestations) on each artifact. Expect it to be slower than a single lookup, and check the artifact list it worked from before relying on the answer.
117+
118+
## Limitations
119+
120+
- The action catalog is generated from a snapshot of the OpenAPI spec. New endpoints become available when the catalog is regenerated and a new version of the package is published.
121+
- Ambiguous questions may take several `search_actions` calls before the assistant settles on the right action.
122+
- Responses are whatever the Kosli API returns. Large responses consume a lot of context, so ask for specific fields when you can.
123+
124+
## Feedback
125+
126+
The server is in beta and we want to hear how it works for you. Email [support@kosli.com](mailto:support@kosli.com) or open an issue in [`kosli-dev/mcp-server`](https://github.com/kosli-dev/mcp-server/issues).

‎understand_kosli/ai_docs_access.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ description: 'Use MCP servers, skill.md, and llms.txt to let AI tools read and s
55

66
Kosli documentation supports AI-friendly access through three mechanisms: an **MCP server** for semantic search, a **skill.md** endpoint that teaches AI assistants how the docs are organized, and **llms.txt** files that provide full documentation content. These let you query Kosli documentation directly from AI coding assistants like Cursor, Claude Code, Windsurf, VS Code with Copilot, and others.
77

8+
<Note>
9+
Everything on this page covers access to the documentation. To let an AI assistant query the data in your own Kosli organization, see the [Kosli MCP server](/integrations/mcp_server).
10+
</Note>
11+
812
## MCP server
913

1014
The Model Context Protocol (MCP) server lets AI tools search Kosli documentation semantically. Instead of copy-pasting docs into a chat window, you connect your AI assistant to the MCP endpoint and it can search the docs on its own.

0 commit comments

Comments
 (0)