# KIP MCP server

> Provides a cognitive state protocol for agent memory using knowledge graphs to enable memory persistence, evolution, and explainable interaction.

- Repository: https://github.com/ldclabs/KIP
- Page: https://hostedmcp.org/servers/ldclabs/kip
- Transport: stdio
- Stars: 92
- License: MIT
- Latest version: 1.0.1

## Install

### Claude Code

```sh
claude mcp add --env 'KIP_BACKEND_URL=<KIP_BACKEND_URL>' --env 'KIP_API_KEY=<YOUR_KIP_API_KEY>' kip -- npx -y @ldclabs/kip-mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "kip": {
      "command": "npx",
      "args": [
        "-y",
        "@ldclabs/kip-mcp-server"
      ],
      "env": {
        "KIP_BACKEND_URL": "<KIP_BACKEND_URL>",
        "KIP_API_KEY": "<YOUR_KIP_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "kip": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ldclabs/kip-mcp-server"
      ],
      "env": {
        "KIP_BACKEND_URL": "<KIP_BACKEND_URL>",
        "KIP_API_KEY": "<YOUR_KIP_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"kip","type":"stdio","command":"npx","args":["-y","@ldclabs/kip-mcp-server"],"env":{"KIP_BACKEND_URL":"<KIP_BACKEND_URL>","KIP_API_KEY":"<YOUR_KIP_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "kip": {
      "command": "npx",
      "args": [
        "-y",
        "@ldclabs/kip-mcp-server"
      ],
      "env": {
        "KIP_BACKEND_URL": "<KIP_BACKEND_URL>",
        "KIP_API_KEY": "<YOUR_KIP_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add kip --env 'KIP_BACKEND_URL=<KIP_BACKEND_URL>' --env 'KIP_API_KEY=<YOUR_KIP_API_KEY>' -- npx -y @ldclabs/kip-mcp-server
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.kip]
command = "npx"
args = ["-y", "@ldclabs/kip-mcp-server"]

[mcp_servers.kip.env]
KIP_BACKEND_URL = "<KIP_BACKEND_URL>"
KIP_API_KEY = "<YOUR_KIP_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'KIP_BACKEND_URL=<KIP_BACKEND_URL>' -e 'KIP_API_KEY=<YOUR_KIP_API_KEY>' kip npx -- -y @ldclabs/kip-mcp-server
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "kip": {
      "command": "npx",
      "args": [
        "-y",
        "@ldclabs/kip-mcp-server"
      ],
      "env": {
        "KIP_BACKEND_URL": "<KIP_BACKEND_URL>",
        "KIP_API_KEY": "<YOUR_KIP_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `KIP_BACKEND_URL` | yes | no | HTTP URL for the KIP backend endpoint |
| `KIP_API_KEY` | no | yes | Your API key for the service |

## Tools (2)

- `execute_kip`: Execute KIP (Knowledge Interaction Protocol) commands against a Cognitive Nexus backend. IMPORTANT: KIP is new and typically NOT present in the model's training data. Before using this tool for anything non-trivial (especially writes), you MUST load KIP usage instructions. Do one of the following first: - Use the prompt: kip_bootstrap (recommended) - Or fetch the resources: kip://docs/Instructions.md and (optionally) kip://docs/KIP.md Input shape: - Provide exactly one of: 'command' (single multi-line string) OR 'commands' (batch). - Use 'dry_run: true' to validate without executing. Schema grounding (do not guess): - Types are UpperCamelCase; predicates/attributes are snake_case (case-sensitive). - If unsure about schema/types/predicates, discover first via META: DESCRIBE / SEARCH. Safe parameterization: - Prefer 'parameters' over string interpolation. - Placeholders start with ':' and MUST occupy a complete JSON value token. Update semantics: - SET ATTRIBUTES overwrites each specified key (arrays/objects are replaced, not merged). - SET PROPOSITIONS is additive (creates/updates links). Safety: - Never store secrets/credentials or one-time tokens in KIP.
- `list_logs`: List log entries from the KIP backend (if supported). Use this to debug failed executions or inspect recent activity. (read-only)

## FAQ

### What is the main purpose of KIP 2.0?

KIP 2.0 is a Cognitive State Protocol designed for agent memory, focusing on separating meaning, belief, and authority to ensure truth-neutral propositions.

### Can I use KIP with existing v1 deployments?

Yes, v1 is frozen for historical reference and migration, and archived MCP servers and Skills implement v1 interfaces.
