Connect your assistant
Two ways to run the KiviDB MCP server, and the only thing that decides which is how the client wants to reach it.
Two ways to run the KiviDB MCP server, and the only thing that decides which is how the client wants to reach it.
As a subprocess (stdio). The client starts the server itself and talks over its pipes. Your API key stays on your machine. This is how Claude Desktop, Claude Code, the Gemini CLI, Cursor and VS Code work.
As an HTTPS service. The client is given a URL. This is how ChatGPT
connectors work, and it is what the Claude and ChatGPT directories require for a
published listing. We run one at https://mcp.kividb.io/mcp: you sign in with
your KiviDB account instead of pasting a key.
The tools are identical either way.
Claude Desktop
Settings → Developer → Edit Config, then:
{
"mcpServers": {
"kividb": {
"command": "npx",
"args": ["-y", "@kividbio/mcp-server"],
"env": { "KIVIDB_API_KEY": "kvdb_live_..." }
}
}
}
Restart Claude Desktop. KiviDB appears in the tools menu.
Claude Code
claude mcp add kividb --env KIVIDB_API_KEY=kvdb_live_... -- npx -y @kividbio/mcp-server
Gemini CLI
In ~/.gemini/settings.json:
{
"mcpServers": {
"kividb": {
"command": "npx",
"args": ["-y", "@kividbio/mcp-server"],
"env": { "KIVIDB_API_KEY": "kvdb_live_..." }
}
}
}
Cursor
In .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every
project:
{
"mcpServers": {
"kividb": {
"command": "npx",
"args": ["-y", "@kividbio/mcp-server"],
"env": { "KIVIDB_API_KEY": "kvdb_live_..." }
}
}
}
VS Code
In .vscode/mcp.json. VS Code can prompt for the key rather than storing it in
the file, which is worth doing if the repository is shared:
{
"inputs": [
{
"type": "promptString",
"id": "kividb-key",
"description": "KiviDB API key",
"password": true
}
],
"servers": {
"kividb": {
"command": "npx",
"args": ["-y", "@kividbio/mcp-server"],
"env": { "KIVIDB_API_KEY": "${input:kividb-key}" }
}
}
}
ChatGPT, and other clients that want a URL
The simplest way is our hosted server. Give your client this URL:
https://mcp.kividb.io/mcp
Choose OAuth when the client asks how to authenticate. It opens KiviDB's sign-in page, and you approve the connection. There is no key to paste, mint or store: the assistant acts as you, with the role you hold in each of your organizations, and nothing more.
In ChatGPT, add it as an app with developer mode on, under Settings → Apps. In Claude, add it as a custom connector under Settings → Connectors.
Every assistant you connect this way is listed in the console under Settings → Connections. Disconnecting one there stops it immediately.
Running your own
If you would rather host the server yourself, run it in HTTP mode:
KIVIDB_API_KEY=kvdb_live_... npx -y @kividbio/mcp-server --http --port 8787
Then add it in ChatGPT under Settings → Connectors → Add custom connector, pointing at your HTTPS URL.
Two things matter here:
Put it behind TLS. The key is a bearer credential and travels in a header.
A request may carry its own key. Send Authorization: Bearer <key> and the
server acts as that key for that request alone. One deployment can then serve a
whole team without anybody sharing a key. The key in the environment is only the
fallback for requests that send none — leave it unset if every caller brings
their own.
GET /healthz answers {"ok":true} for load balancers.
Which key to use
Mint a separate key per assistant, named for it. Two reasons: the console shows each key's last use, so you can see which assistant is actually doing anything; and revoking one does not disturb the others.
Give it the smallest role that does the job — member covers everything except
minting keys and billing.
Environment
| Variable | Meaning |
|---|---|
KIVIDB_API_KEY | Required for stdio. The fallback for HTTP when a request sends no bearer token. |
KIVIDB_API_ENDPOINT | Defaults to https://api.kividb.io. |
PORT | HTTP mode only. Defaults to 8787. |
If it does not appear
The client shows no KiviDB tools. The server writes its startup line to
stderr; most clients keep an MCP log. A missing KIVIDB_API_KEY is reported
there rather than silently.
Every tool returns "not authorised". The key was revoked, or it is from a
different environment. Keys carry their environment in the prefix: kvdb_live_
against production, and anything else will not authenticate there.
A tool returns "that API key's role does not allow this". The role is the limit, and that message names it. Mint a key with a higher role, or ask an owner to.