Local MCP server that gives Claude Code semantic search over Ottu code repos and docs.
Runs on macOS, Linux, and Windows.
- Python 3.10+
- Ollama with
nomic-embed-textmodel pulled - GitHub CLI (
gh) — used to clone Ottu repos over HTTPS/SSO git-lfs(only needed if you'll ship pre-built embeddings to teammates)- Ottu repos cloned locally (see "Add your repos" below)
macOS (Homebrew):
brew install ollama git-lfs ghLinux (Debian/Ubuntu):
# Ollama
curl -fsSL https://ollama.com/install.sh | sh
# git-lfs + gh
sudo apt update && sudo apt install -y git-lfs ghWindows (winget, PowerShell):
winget install Ollama.Ollama
winget install GitHub.GitLFS
winget install GitHub.cliThen on any OS:
ollama pull nomic-embed-text
git lfs install
gh auth login # once, so `gh repo clone` worksClone this repo wherever you like (referred to as <mcp-root> below), then:
macOS / Linux / WSL:
cd <mcp-root>
bash setup.shWindows (PowerShell):
cd <mcp-root>
powershell -ExecutionPolicy Bypass -File .\setup.ps1Pick a workspace directory (referred to as <workspace> below) and clone the repos you want indexed. Example:
macOS / Linux:
mkdir -p ~/ottu-workspace
cd ~/ottu-workspace
gh repo clone ottuco/checkout_sdk
gh repo clone ottuco/connect-sdk
gh repo clone ottuco/onsite_playground
gh repo clone ottuco/docs
# …add any others you care aboutWindows (PowerShell):
mkdir $HOME\ottu-workspace
cd $HOME\ottu-workspace
gh repo clone ottuco/checkout_sdk
gh repo clone ottuco/connect-sdk
gh repo clone ottuco/onsite_playground
gh repo clone ottuco/docsThen open indexer/config.py and point it at your workspace:
OTTU_WORKSPACE→ absolute path to the directory you cloned intoREPOS→ one entry per code repo (name, path, collection_name)DOCS_SITES→ one entry per Docusaurus/docs repo
Only repos listed in config.py are indexed — remove entries you don't need, or append new ones.
macOS / Linux:
source venv/bin/activate
python cli.py doctor # verify repos, Ollama, LFS
python cli.py index # code + docs + internal files
python cli.py stats # chunk counts per collection
python cli.py search "3DS tokenization"Windows (PowerShell):
.\venv\Scripts\Activate.ps1
python cli.py doctor
python cli.py index
python cli.py stats
python cli.py search "3DS tokenization"Create <workspace>/.mcp.json (project-scoped):
macOS / Linux:
{
"mcpServers": {
"ottu-knowledge": {
"type": "stdio",
"command": "<mcp-root>/venv/bin/python",
"args": ["<mcp-root>/server.py"]
}
}
}Windows:
{
"mcpServers": {
"ottu-knowledge": {
"type": "stdio",
"command": "<mcp-root>\\venv\\Scripts\\python.exe",
"args": ["<mcp-root>\\server.py"]
}
}
}Replace <mcp-root> with the absolute path where you cloned OttuKnowledgeMCP.
Restart Claude Code. /mcp should show ottu-knowledge with 4 tools.
Approve the server on first prompt — Claude Code asks for trust when it sees a new .mcp.json. You can also opt in globally via enableAllProjectMcpServers: true in your user ~/.claude.json.
Edit indexer/config.py:
- New code repo → append to
REPOSlist - New docs site → append to
DOCS_SITES - New internal
.md/.docx/.xlsx→ drop indocs_local/and append its path toMARKDOWN_FILES
Then python cli.py index-code <name> (or index-docs, index-markdown).
| Command | Purpose |
|---|---|
python cli.py doctor |
Pre-flight: repos present, Ollama OK, LFS status |
python cli.py index |
Index code + docs + internal |
python cli.py index-code [repo] |
Code only (optionally one repo) |
python cli.py index-docs |
Docs sites only |
python cli.py index-markdown |
Internal .md/.docx/.xlsx |
python cli.py reindex |
Drop everything and rebuild |
python cli.py stats |
Chunk counts |
python cli.py search "query" [--repo X] [--docs] |
Semantic search |
python cli.py freshness |
Stale vs fresh per source |
git add chroma_db
git commit -m "Update embeddings"
git push # uploads chroma_db via LFSTeammates: git lfs pull after cloning.
- Ollama not reachable: run
ollama serve(Linux/Windows) or restart the menu-bar app (macOS). - Model missing:
ollama pull nomic-embed-text. - Repo not found:
python cli.py doctorprints which paths are missing — fixOTTU_WORKSPACE/REPOSinindexer/config.py. - Tiny
chroma_db/chroma.sqlite3:git lfs pull. - Windows:
Activate.ps1blocked: run PowerShell as admin once:Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.