Skip to content

Instantly share code, notes, and snippets.

@giehlman
Created January 23, 2026 16:12
Show Gist options
  • Select an option

  • Save giehlman/6930fd2f772304df165d02d1ddcf0e86 to your computer and use it in GitHub Desktop.

Select an option

Save giehlman/6930fd2f772304df165d02d1ddcf0e86 to your computer and use it in GitHub Desktop.

KnowledgeCP Installation Guide for Claude

For Claude: Follow these instructions exactly to set up KnowledgeCP for the user.

IMPORTANT: First detect the user's operating system and use the appropriate commands below.


Step 1: Detect Operating System

Determine the user's OS from your environment info (platform field) and use the appropriate commands in the following steps.


Step 2: Check if already installed

macOS / Linux (Bash)

claude mcp list | grep -i knowledgecp

Windows (PowerShell)

claude mcp list | Select-String -Pattern "knowledgecp"

If "knowledgecp" appears in the output, skip to Step 4. Otherwise continue with Step 3.


Step 3: Install MCP Server

This command works on all platforms:

claude mcp add -s user -t sse knowledgecp "https://knowledgecp-mcp-server-production.up.railway.app/sse"

Step 4: Configure CLAUDE.md

File Locations

OS Path
macOS ~/.claude/CLAUDE.md
Linux ~/.claude/CLAUDE.md
Windows %USERPROFILE%\.claude\CLAUDE.md

Create directory if needed

macOS / Linux (Bash)

mkdir -p ~/.claude

Windows (PowerShell)

New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude"

Check if KnowledgeCP block already exists

Read the existing CLAUDE.md and check if it already contains ## KnowledgeCP Integration.

If the block already exists, skip to Step 5.

Append to CLAUDE.md

If the block does not exist, append the following content. Do not overwrite existing content!

Content to append:

## KnowledgeCP Integration

When the user types "conn kcp", "connect knowledgecp", or similar connection phrases:

1. **Check connection**: Run `kb_sync_status()` to verify the MCP connection is active
2. **Load pinned entries**: Run `kb_get_pinned()` to load important context (terminology, project rules, guidelines)
3. **Confirm**: Tell the user that KnowledgeCP is connected and summarize what context was loaded

### Available Tools

- `kb_list()` - List entries in a workspace
- `kb_read(key)` - Read a single entry by key
- `kb_search(query)` - Search across all workspaces
- `kb_remember(key, content)` - Save new knowledge
- `kb_whoami()` - Show current user and workspaces

### Usage Notes

- Use KnowledgeCP to persistently save insights, decisions, and context
- Pinned entries contain team knowledge that should inform your work
- When working on a project, check if relevant knowledge exists with `kb_search()`

Step 5: Notify User

Tell the user:

KnowledgeCP has been set up!

Next steps:

  1. Restart Claude to activate the MCP server
  2. After restart, type conn kcp to connect
  3. On first connect: Click the OAuth link that appears to authenticate
  4. Done! Your knowledge base context will be loaded

For every future session: Just type conn kcp at the start to load your context.

Alternative authentication: Type /mcp and click "Reauthenticate" next to knowledgecp


Troubleshooting

MCP Server not connected after restart

Check if knowledgecp is in the list:

claude mcp list

If "knowledgecp" does not appear, repeat Step 3.

OAuth link does not appear

The OAuth flow is triggered when Claude calls any kb_* tool. To manually trigger it:

  1. Type /mcp in Claude
  2. Find "knowledgecp" in the list
  3. Click "Reauthenticate"

Reinstall if issues persist

claude mcp remove knowledgecp
claude mcp add -s user -t sse knowledgecp "https://knowledgecp-mcp-server-production.up.railway.app/sse"

Verify everything works

After restart and authentication, type conn kcp. Claude should:

  1. Run kb_sync_status()
  2. Run kb_get_pinned()
  3. Confirm connection and list loaded context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment