# ken [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/townsendmerino/ken  
**GitHub Stars:** 34  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ken

## Description
Fast hybrid code search for agents. Pure Go, drop-in MCP-compatible with semble.

## Tools
Capabilities this server exposes over MCP:

- **search**
- **find_related**

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/townsendmerino/ken), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
brew install --cask townsendmerino/tap/ken
```

2. Install:

```sh
scoop bucket add townsendmerino https://github.com/townsendmerino/scoop-bucket
```

3. Install:

```sh
scoop install ken
```

4. Install:

```sh
go install github.com/townsendmerino/ken/cmd/ken@latest
```

5. Install:

```sh
go install github.com/townsendmerino/ken/cmd/ken-mcp@latest
```

6. Add to Claude Code:

```sh
claude mcp add ken -s user -- /absolute/path/to/ken-mcp
```

## Documentation

## What ken does

ken provides local code retrieval for coding agents through the Model Context Protocol. Its two core MCP tools are `search`, which finds repository content for a query, and `find_related`, which retrieves related code. Both use the same argument shapes and markdown output format as MinishLab’s semble server, allowing an existing semble-oriented MCP configuration to switch to the `ken-mcp` executable.

The search pipeline supports three modes: hybrid, BM25-only, and semantic. Hybrid combines lexical matching with Model2Vec embeddings, reciprocal-rank fusion, and a code-aware reranker. The default model is a 16-million-parameter Model2Vec model that runs inside the process on the CPU.

## How it works

`ken-mcp` indexes a local repository and watches it for changes. The MCP process keeps running, applies a two-second debounce to updates, and reindexes changed content so an agent can retrieve files it has just modified. Repository discovery respects nested `.gitignore` files using per-directory Git-style matching.

The server is distributed as a single static Go binary and does not depend on cgo, Python, a hosted embedding API, or a vector database. The model is fetched automatically on first use by default, or can be downloaded explicitly with `ken download-model`. Until the model is available, model-dependent modes serve BM25 results; the CLI can also be placed explicitly in BM25 mode.

## Setup and configuration

Install the `ken` and `ken-mcp` binaries with Homebrew on macOS and Linux, Scoop on Windows, or Go 1.26+ using the package paths documented by the project. Configure an MCP client with the absolute path to `ken-mcp`. Claude Code, Cursor, VS Code, and Codex examples are provided using local subprocess transport.

For a pre-indexed repository, set `KEN_MCP_DEFAULT_REPO`; this allows tool calls to omit the repository argument. `KEN_MCP_MODE` selects `hybrid`, `bm25`, or `semantic`, while `KEN_MCP_MODEL_DIR` points to a Model2Vec snapshot. `KEN_MCP_AUTO_FETCH=0` disables automatic model retrieval.

The default transport is stdio and keeps the repository local to the client process. Streamable HTTP can serve multiple agents from a centralized machine by setting `KEN_MCP_TRANSPORT=http`. HTTP deployments require `KEN_MCP_AUTH_TOKEN_FILE`, should use `KEN_MCP_DEFAULT_REPO`, and can set `KEN_MCP_ADDR` and `KEN_MCP_RATE_LIMIT`. TLS must be terminated by a reverse proxy; `ken-mcp` does not provide TLS itself.

## Tools and capabilities

- `search` for lexical, semantic, or hybrid repository retrieval.
- `find_related` for locating code related to an existing result or concept.
- Automatic repository watching and reindexing in MCP mode.
- CPU-only Model2Vec inference with no external service credentials.
- CLI commands for searching, indexing, downloading the model, and checking setup with `ken doctor`.
- Optional lower-memory watched dense storage through `KEN_ANN=flat-i8`.

## Limitations and notes

ken is designed for finding the code chunk that answers a question, not for exhaustive enumeration. Refactors, pre-rename audits, and other completeness-sensitive tasks may still be better served by grep. Without the embedding model, retrieval falls back to BM25 and does not use the default hybrid path.

HTTP mode exposes the service to a network and therefore requires authentication. It rejects startup without a token, rejects sampled database values when `KEN_DB_SAMPLE_ROWS` is greater than zero, and applies per-client-IP rate limiting by default. Local stdio mode is unaffected by these HTTP-specific guards.

_Full upstream README: https://allmcps.com/mcp/ken/readme_

