Skip to main content
Glama
karel1980

Koog Documentation MCP Server

by karel1980
README.md
# Koog Documentation MCP Server

A Model Context Protocol (MCP) server that provides vector-based RAG search capabilities over Koog documentation using ChromaDB.

## Setup

1. Create and activate virtual environment:
```bash
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

3. Clone the koog git repository and remember the path of your working copy.

4. Add to your Q CLI MCP configuration:
```bash
q config mcp add koog-docs python3 koog-mcp-server.py [koog-repo-path]
```

If you omit koog-repo-path, it will default to '../koog'

Or manually add to your MCP config file:
```json
{
  "mcpServers": {
    "koog-docs": {
      "command": "python3",
      "args": ["koog-mcp-server.py"],
      "cwd": "/path/to/this/directory"
    }
  }
}
```

## Database Initialization

The vector database will be automatically created and populated on first use:
- ChromaDB creates a persistent database in `./chroma_db/`
- All markdown files from `../koog/docs/docs` are processed and indexed
- Documents are chunked for optimal retrieval
- Vector embeddings are generated using ChromaDB's default model

**Note**: First startup may take a few moments while the documentation is indexed.

## Usage

Once configured, you can ask questions about Koog in Q CLI:

- "How do I create a basic agent in Koog?"
- "What are the different types of tools available?"
- "How does memory work in Koog agents?"
- "Show me examples of structured output"

The server will search through all Koog documentation files and return relevant sections with context.

## Features

- Vector-based semantic search using ChromaDB
- Automatic document chunking for better retrieval
- Persistent vector database with embeddings
- Searches all markdown files in the Koog docs directory
- Returns relevant sections with similarity scores
- Extracts document titles and file paths for reference