Initial public release
Three local MCP servers for coding agents, designed for Claude Code and OpenCode: - context-web-search: SearXNG-backed web search and URL fetch - context-docs: semantic search over curated llms.txt docs - context-repomix: pack local or remote repos into AI context Defaults are local-first: SearXNG binds to 127.0.0.1, no hosted API keys are required, and Repomix mounts only the current project read-only.
This commit is contained in:
55
docs/assistants.md
Normal file
55
docs/assistants.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Assistant Setup
|
||||
|
||||
Context Kit supports any assistant that can run local stdio MCP servers. The
|
||||
included snippets cover Claude Code and OpenCode.
|
||||
|
||||
## Claude Code
|
||||
|
||||
Print a project `.mcp.json` snippet:
|
||||
|
||||
```sh
|
||||
bin/context-kit install claude
|
||||
```
|
||||
|
||||
The default snippet uses `context-kit` on `PATH`, which is appropriate for
|
||||
committed project config. For private user-only config, you can print absolute
|
||||
paths with:
|
||||
|
||||
```sh
|
||||
bin/context-kit install claude --absolute
|
||||
```
|
||||
|
||||
Claude Code also supports adding stdio servers through its CLI. Use absolute
|
||||
paths if `context-kit` is not on your `PATH`.
|
||||
|
||||
After configuration, open Claude Code and run:
|
||||
|
||||
```text
|
||||
/mcp
|
||||
```
|
||||
|
||||
You should see:
|
||||
|
||||
- `context-web-search`
|
||||
- `context-docs`
|
||||
- `context-repomix`
|
||||
|
||||
## OpenCode
|
||||
|
||||
Print an `opencode.json` MCP snippet:
|
||||
|
||||
```sh
|
||||
bin/context-kit install opencode
|
||||
```
|
||||
|
||||
Merge the printed `mcp` block into your OpenCode config and restart OpenCode.
|
||||
OpenCode reads config at startup.
|
||||
|
||||
Use `bin/context-kit install opencode --absolute` only for private machine-local
|
||||
config that will not be committed.
|
||||
|
||||
## Suggested Agent Instructions
|
||||
|
||||
Use the snippets in `snippets/CLAUDE.md` and `snippets/AGENTS.md` as a starting
|
||||
point. They remind agents to use docs search before guessing API details and to
|
||||
treat fetched web pages as untrusted input.
|
||||
49
docs/configuration.md
Normal file
49
docs/configuration.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Configuration
|
||||
|
||||
Configuration is via environment variables or a `.env` file in the repository
|
||||
root. Start from `.env.example`.
|
||||
|
||||
Explicit environment variables win over `.env` values. The `.env` parser accepts
|
||||
simple `KEY=VALUE` lines for `CONTEXT_KIT_*` variables only; it does not execute
|
||||
shell code.
|
||||
|
||||
## Core Variables
|
||||
|
||||
| Variable | Default | Purpose |
|
||||
|---|---|---|
|
||||
| `CONTEXT_KIT_DATA_DIR` | `$HOME/.local/share/context-kit` | Persistent docs indexes and model cache |
|
||||
| `CONTEXT_KIT_COMPOSE_PROJECT` | `context-kit` | Docker Compose project and network prefix |
|
||||
| `CONTEXT_KIT_SEARXNG_PORT` | `8099` | Localhost SearXNG port |
|
||||
| `CONTEXT_KIT_DOCS_TTL` | `7d` | Docs re-fetch cadence |
|
||||
| `CONTEXT_KIT_DOCS_SOURCES` | `config/sources.default.txt` | Space-separated source profile files |
|
||||
| `CONTEXT_KIT_DOCS_MAX_GET_BYTES` | `75000` | Max bytes returned by docs retrieval |
|
||||
| `CONTEXT_KIT_DOCS_EMBED_MODEL` | `BAAI/bge-small-en-v1.5` | SentenceTransformers embedding model |
|
||||
|
||||
## TTL Guidance
|
||||
|
||||
`7d` is the default because most reference docs do not need daily re-embedding.
|
||||
|
||||
Use shorter TTLs for fast-moving APIs:
|
||||
|
||||
```sh
|
||||
CONTEXT_KIT_DOCS_TTL=72h bin/context-kit docs
|
||||
```
|
||||
|
||||
Use longer TTLs for stable specs:
|
||||
|
||||
```sh
|
||||
CONTEXT_KIT_DOCS_TTL=30d bin/context-kit docs
|
||||
```
|
||||
|
||||
When freshness matters for one task, prefer a manual refresh through the docs
|
||||
MCP tool instead of lowering the global TTL for every session.
|
||||
|
||||
## Source Profiles
|
||||
|
||||
The docs MCP accepts one or more source files:
|
||||
|
||||
```sh
|
||||
CONTEXT_KIT_DOCS_SOURCES="config/sources.default.txt config/sources.js.txt"
|
||||
```
|
||||
|
||||
Each source file is plain text. Blank lines and `#` comments are ignored.
|
||||
35
docs/security.md
Normal file
35
docs/security.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Security
|
||||
|
||||
Context Kit is designed to be safe by default for local development.
|
||||
|
||||
## Defaults
|
||||
|
||||
- SearXNG is bound to `127.0.0.1` only.
|
||||
- No hosted API keys are required.
|
||||
- Repomix mounts only the current project read-only.
|
||||
- Docs indexing stores data under `$HOME/.local/share/context-kit` unless you
|
||||
override it.
|
||||
- No code-editing MCP server is enabled by default.
|
||||
|
||||
## Fetched Web Content
|
||||
|
||||
Search results and fetched pages are untrusted input. A page can contain prompt
|
||||
injection instructions. Assistants should summarize and cite fetched content, not
|
||||
obey instructions embedded in it.
|
||||
|
||||
## Docs Indexing
|
||||
|
||||
Only index sources you trust enough to retrieve into an agent conversation. More
|
||||
sources are not always better. Large or noisy docs can make retrieval slower and
|
||||
less precise.
|
||||
|
||||
## Code-Editing MCP Servers
|
||||
|
||||
Context Kit's default MCP servers either read remote content or mount the
|
||||
current project read-only. If you add code-editing MCP servers later, review
|
||||
their mount paths and permissions separately.
|
||||
|
||||
## Public Exposure
|
||||
|
||||
Do not expose SearXNG or MCP servers to the public internet without a separate
|
||||
review. The default setup is for localhost development.
|
||||
42
docs/troubleshooting.md
Normal file
42
docs/troubleshooting.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Troubleshooting
|
||||
|
||||
## Run Doctor
|
||||
|
||||
```sh
|
||||
bin/context-kit doctor
|
||||
```
|
||||
|
||||
This checks Docker, Compose, images, the Docker network, SearXNG health, and
|
||||
docs source configuration.
|
||||
|
||||
## SearXNG Is Not Responding
|
||||
|
||||
Start it:
|
||||
|
||||
```sh
|
||||
bin/context-kit start
|
||||
```
|
||||
|
||||
Then check:
|
||||
|
||||
```sh
|
||||
curl 'http://127.0.0.1:8099/search?q=test&format=json'
|
||||
```
|
||||
|
||||
If you changed `CONTEXT_KIT_SEARXNG_PORT`, use that port instead.
|
||||
|
||||
## MCP Image Missing
|
||||
|
||||
Build default images:
|
||||
|
||||
```sh
|
||||
bin/context-kit build
|
||||
```
|
||||
|
||||
## Docs Indexing Is Slow
|
||||
|
||||
The first run downloads an embedding model and embeds every configured docs
|
||||
section. Keep default sources small, and add profiles only when you need them.
|
||||
|
||||
Cloudflare and other large docs sets can take significantly longer than the
|
||||
default source profile.
|
||||
Reference in New Issue
Block a user