Context42
MCP server for semantic search over your personal coding instructions.
What it does
Context42 indexes your markdown documentation and makes it searchable by AI assistants like Claude. Your coding standards, guidelines, and patterns become instantly accessible during development.
Installation
# Using pipx (recommended)
pipx install context42-io
# Using uv
uvx context42-io
# Using pip
pip install context42-io
Quick Start
# 1. Add your documentation
c42 add ~/my-coding-standards --name standards
# 2. Index the content
c42 index
# 3. Start the MCP server
c42 serve
Claude Desktop Integration
Add to your Claude Desktop configuration file:
| Platform | Path |
|---|---|
| Linux | ~/.config/claude/claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
{
"mcpServers": {
"context42": {
"command": "c42",
"args": ["serve"]
}
}
}
Restart Claude Desktop after adding the configuration.
CLI Commands
| Command | Description |
|---|---|
c42 add <path> --name <n> |
Add documentation source |
c42 add <path> --priority <0.1-1.0> |
Add with priority (higher = more important) |
c42 list |
List all sources |
c42 index |
Index pending sources |
c42 search <query> |
Search from CLI |
c42 status |
Show statistics |
c42 remove <n> |
Remove a source |
c42 set-priority <n> <value> |
Change source priority |
c42 serve |
Start MCP server |
Priority System
Set higher priority for your personal instructions so they take precedence over reference documentation:
# Your rules (high priority)
c42 add ~/my-standards --name standards --priority 1.0
# Reference docs (lower priority)
c42 add ~/library-docs --name docs --priority 0.5
Search results are weighted by priority, ensuring your preferences appear first.
Features
- 100% Offline - Runs locally after initial model download
- Priority System - Your rules take precedence over reference docs
- Fast Indexing - Progress bars with batch processing
- Idempotent - Safe to re-run indexing
Configuration
Environment variables (optional):
C42_EMBEDDING_MODEL="BAAI/bge-small-en-v1.5" # Default model
C42_CHUNK_SIZE=500 # Characters per chunk
C42_BATCH_SIZE=50 # Chunks per batch
C42_DATA_DIR="~/.local/share/context42" # Data directory
Advanced Configuration
For users who need faster model downloads or encounter rate limiting:
| Variable | Description |
|---|---|
HF_TOKEN |
Hugging Face token for faster downloads and higher rate limits |
# Optional: Set HuggingFace token for faster downloads
export HF_TOKEN="hf_your_token_here"
Get your token at: https://huggingface.co/settings/tokens
Data Storage
Context42 stores data in platform-specific locations:
| Platform | Path |
|---|---|
| Linux | ~/.local/share/context42/ |
| macOS | ~/Library/Application Support/context42/ |
| Windows | %LOCALAPPDATA%\context42\ |
License
MIT
Metadata
Release files for context42-io 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| context42_io-0.4.2.tar.gz | 148.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| context42_io-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 172.7 kB
Release files / context42_io-0.4.2.tar.gz
| Download URL | context42_io-0.4.2.tar.gz |
|---|---|
| Size | 148.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c7b9bb849487365bdb805cc9475e5fae0c6c4201e077218eb42112786169a41
|
|
BLAKE2b-256 checksum How to use checksums |
e1c7e9cbe3bafd5350fa31692a9e4576e88a3cbed4a520fb2a8154a02a4c33db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / context42_io-0.4.2-py3-none-any.whl
| Download URL | context42_io-0.4.2-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af6af6828fbcd4c6fa4c1db0234667547d46f6d9470601bc5c9cc81c482d7b26
|
|
BLAKE2b-256 checksum How to use checksums |
a60b4c00649899b237ab03b7a1071a5f101d01eafbcf43e65b6c291687c8b1a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|