Skip to main content

Knowledge Item (KI) management MCP server for AI-assisted development

Project description

ki-manager — Knowledge Item MCP Server

AI-powered knowledge management for software projects.
Install once, use across all your projects.


What is ki-manager?

ki-manager is an MCP (Model Context Protocol) server that turns any project into a self-documenting codebase for AI agents (Claude, Antigravity, Cursor, Windsurf, etc.).

It provides:

  • Knowledge Items (KI) — structured Markdown snapshots of each module, stored in .ki-base/knowledge/
  • Coverage Audit — measures how well your KI base covers your actual code
  • Dependency Analysis — auto-updates "Related KIs" by analyzing imports
  • Git Snapshots — versioned knowledge state (git_checkpoint, git_restore)
  • Scaffolding — one command creates the complete .ki-base/ structure in any project

Installation

Option A: uv tool install (recommended)

  1. Install ki-manager globally via uv:

    uv tool install ki-manager
    
  2. Add to your IDE MCP configuration (mcp_config.json):

    {
      "mcpServers": {
        "ki-manager": {
          "command": "ki-manager"
        }
      }
    }
    

    Note for Windows / ADI Antigravity: If ki-manager is not found in PATH by your IDE, specify the full path to the executable:

    • Windows: "C:\\Users\\<username>\\.local\\bin\\ki-manager.exe"
    • Linux/macOS: "/home/<username>/.local/bin/ki-manager"

Option B: pip / uv pip

pip install ki-manager
# or
uv pip install ki-manager

Option C: Smithery (Claude Desktop / Cursor / Windsurf GUI)

Search for ki-manager in your IDE's MCP marketplace and click Install.

Option D: Local development

If you cloned the repository and are developing locally, point your IDE to the .venv Python directly:

{
  "mcpServers": {
    "ki-manager": {
      "command": "/absolute/path/to/repo/.venv/bin/python",
      "args": ["-m", "ki_manager.server"]
    }
  }
}

On Windows:

{
  "mcpServers": {
    "ki-manager": {
      "command": "C:\\path\\to\\repo\\.venv\\Scripts\\python.exe",
      "args": ["-m", "ki_manager.server"]
    }
  }
}

Quickstart

1. Add the MCP server to your IDE

Pick one of the options above and add it to your MCP config.

2. Initialize a project

In your IDE chat, call the ki_init_project tool:

ki_init_project(project_path="/absolute/path/to/your-project")

This creates:

your-project/
└── .ki-base/
    ├── config.json          ← machine-specific (auto-added to .gitignore)
    ├── ki_config.json       ← project settings (commit to git)
    ├── doc_config.json      ← file→KI map (commit to git)
    ├── AGENTS.md            ← agent instructions (commit to git)
    ├── DIR_INDEX.md         ← directory index (commit to git)
    └── knowledge/
        └── _OVERVIEW.ki.md  ← starter Knowledge Item

3. Start documenting

Use the available tools or slash commands:

Tool / Command Action
audit_coverage Find documentation gaps
generate_dir_index Build directory index
sync_agents_md Sync KI table in AGENTS.md
git_checkpoint Save knowledge snapshot to git
/expand-knowledge Iteratively fill gaps (Antigravity)
/sync-knowledge Full sync workflow (Antigravity)
/create-adr Record architectural decision

What Goes Into Git?

Path Git Notes
.ki-base/knowledge/*.ki.md Project knowledge
.ki-base/doc_config.json Module manifest
.ki-base/ki_config.json Project settings
.ki-base/AGENTS.md Agent instructions
.ki-base/DIR_INDEX.md Directory index
.ki-base/config.json Machine-specific paths
.ki-base/doc_state.json Hash cache

Security

The MCP server operates in a sandbox:

  • All file access is restricted to the .ki-base/ directory
  • Executable files (.py, .exe, .sh, etc.) cannot be modified via MCP
  • Critical config files are protected from direct overwrite

Project Structure (this repo)

ki-manager/
├── pyproject.toml            ← pip / uvx package config
├── smithery.yaml             ← Smithery MCP marketplace config
├── src/ki_manager/
│   ├── server.py             ← MCP server entry point
│   ├── tools/
│   │   └── scaffold.py       ← ki_init_project implementation
│   └── scripts/              ← bundled analysis scripts
│       ├── ki_utils.py       ← shared utilities
│       ├── audit_coverage.py
│       ├── sync_agents_md.py
│       ├── generate_dir_index.py
│       ├── ki_dependency_analyzer.py
│       └── ...
├── knowledge/                ← KI documentation of this repo itself
└── decisions/                ← Architecture Decision Records

Troubleshooting

MCP server hangs on initialization (never connects)

Using uvx directly in mcpServers configuration is known to cause hangs or stdio pipe drops in ADI Antigravity and Windows environments due to ephemeral environment creation delays and process wrapping.

Solution: Install via uv tool install ki-manager and specify ki-manager or its absolute executable path in mcpServers.

Step 1 — Check logs:
Server logs are written to ~/.ki_base/logs/. Open the latest file and look for REQ: lines. If there are no REQ: lines at all, stdin is not being piped correctly by the IDE.

Step 2 — Specify exact executable path:
If your IDE cannot find ki-manager in system PATH:

{
  "mcpServers": {
    "ki-manager": {
      "command": "C:\\Users\\<username>\\.local\\bin\\ki-manager.exe"
    }
  }
}

Step 3 — Reinstall / Upgrade tool:
To upgrade to the latest PyPI version when using uv tool:

uv tool install --reinstall ki-manager

Server is running but no tools appear

Check that ki_status is visible in the IDE. If it shows No project active for current workspace, the server is working correctly — it just needs a project to be initialized (ki_init_project) or the IDE is not passing rootUri in the MCP handshake.

[Errno 22] Invalid argument in logs

This error was present in versions < 2.0.11 on Windows when wrapping sys.stdout with a codecs encoder. Upgrade to >= 2.0.11 to fix it:

uv tool install --reinstall ki-manager

License

MIT — free to use, copy, and adapt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ki_manager-2.0.28.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ki_manager-2.0.28-py3-none-any.whl (52.4 kB view details)

Uploaded Python 3

File details

Details for the file ki_manager-2.0.28.tar.gz.

File metadata

  • Download URL: ki_manager-2.0.28.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ki_manager-2.0.28.tar.gz
Algorithm Hash digest
SHA256 c45aa381e77c0659d3eaf0e38a0381df0215b03d66678bcf82ae9790fbf294c2
MD5 702fb48c831ed95342cd67e1b0171362
BLAKE2b-256 47d1738c5f290fd9af629e2020776553771da200304f92e1e0383294d6959ffd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ki_manager-2.0.28.tar.gz:

Publisher: publish.yml on Laeryid/KI-base

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ki_manager-2.0.28-py3-none-any.whl.

File metadata

  • Download URL: ki_manager-2.0.28-py3-none-any.whl
  • Upload date:
  • Size: 52.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ki_manager-2.0.28-py3-none-any.whl
Algorithm Hash digest
SHA256 ae4dba2812a4e7ecd9d73a00b7705162a3de46124e120d80e28d32c482b507b3
MD5 a2bb9633898179111289dc4129cac8ef
BLAKE2b-256 7658d10cfea96b3d53e10259cb8bd7f5cc1dd7577c1675f4e6f3bb0bf6d4527a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ki_manager-2.0.28-py3-none-any.whl:

Publisher: publish.yml on Laeryid/KI-base

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page