Context Harness

v1.0.0Knowledge & Memorystable

Local-first context ingestion and retrieval for AI tools. SQLite + embeddings + MCP server for Cursor & Claude.

claudecursorembeddingslocal-aimcp
Share:
37
Stars
0
Downloads
0
Weekly
0/5

What is Context Harness?

Context Harness is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to local-first context ingestion and retrieval for ai tools. sqlite + embeddings + mcp server for cursor & claude.

Local-first context ingestion and retrieval for AI tools. SQLite + embeddings + MCP server for Cursor & Claude.

This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Local-first context ingestion and retrieval for AI tools. SQ

Use Cases

Local context ingestion
Embedding-based retrieval
RAG implementation
parallax-labs

Maintainer

LicenseAGPL-3.0
Languagerust
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx context-harness

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Context Harness

Context Harness is a local-first context ingestion and retrieval system that indexes your files, Git repositories, and S3 buckets into a SQLite database with vector embeddings, then exposes a Model Context Protocol server so Cursor and Claude can semantically search your stored context. It supports hybrid keyword/semantic search with configurable weighting and multiple embedding providers including OpenAI, Ollama, and local models. Developers use it to give AI assistants persistent, searchable knowledge of their codebases and documentation without sending data to a third-party cloud index.

Prerequisites

  • A pre-built Context Harness binary for your OS (macOS, Linux, or Windows) or Rust toolchain to build from source
  • OpenAI API key (if using OpenAI embeddings) set as OPENAI_API_KEY, or a local Ollama instance
  • AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) if using the S3 connector
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Install the Context Harness binary

Download and install the pre-built binary for your platform. For macOS Apple Silicon run the curl command below. For other platforms, substitute the appropriate release artifact from the GitHub releases page.

curl -L https://github.com/parallax-labs/context-harness/releases/latest/download/ctx-macos-aarch64.tar.gz | tar xz
sudo mv ctx /usr/local/bin/
2

Create a ctx.toml configuration file

In your project root, create a ctx.toml file that configures your embedding provider, retrieval settings, and connectors. The example below uses OpenAI embeddings and indexes the current directory.

[embedding]
provider = "openai"
model = "text-embedding-3-small"
dims = 1536

[retrieval]
hybrid_alpha = 0.5

[server]
bind = "127.0.0.1:7331"

[[connectors.filesystem]]
root = "."
include_globs = ["**/*.md", "**/*.ts", "**/*.py", "**/*.rs"]
3

Set required environment variables

Export your OpenAI API key before running Context Harness. If you are using the S3 connector, also export your AWS credentials.

export OPENAI_API_KEY=sk-...
4

Ingest and embed your content

Run sync to ingest documents from your configured connectors, then embed any pending documents to build the vector index.

ctx sync filesystem
ctx embed pending
5

Start the MCP server

Launch the MCP HTTP server so your AI client can connect to it and perform semantic search queries.

ctx serve mcp
6

Configure your MCP client

Add Context Harness to your Claude Desktop or Cursor configuration pointing at the running HTTP MCP endpoint.

Context Harness Examples

Client configuration

Add this to your claude_desktop_config.json to connect Claude Desktop to the running Context Harness MCP server.

{
  "mcpServers": {
    "context-harness": {
      "command": "ctx",
      "args": ["serve", "mcp"],
      "env": {
        "OPENAI_API_KEY": "sk-your-key-here"
      }
    }
  }
}

Prompts to try

Once connected, use these prompts to search your indexed context from Claude.

- "Search my codebase for all authentication-related functions and summarize how they work"
- "Find all markdown documentation about the API endpoints"
- "What files handle database migrations in this project?"
- "Show me code related to error handling patterns"

Troubleshooting Context Harness

ctx serve mcp exits immediately or refuses connections

Check that the bind address in ctx.toml (default 127.0.0.1:7331) is not already in use. Also confirm that ctx embed pending has completed before starting the server.

Embedding fails with authentication error

Ensure OPENAI_API_KEY is exported in the same shell session where you run ctx commands, or set it in your shell profile. For Ollama, verify the Ollama daemon is running locally.

Search returns no results after sync

Run ctx embed pending to generate embeddings for newly synced documents. Sync only ingests the raw content; embeddings must be generated separately before search works.

Frequently Asked Questions about Context Harness

What is Context Harness?

Context Harness is a Model Context Protocol (MCP) server that local-first context ingestion and retrieval for ai tools. sqlite + embeddings + mcp server for cursor & claude. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Context Harness?

Follow the installation instructions on the Context Harness GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Context Harness?

Context Harness works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Context Harness free to use?

Yes, Context Harness is open source and available under the AGPL-3.0 license. You can use it freely in both personal and commercial projects.

Browse More Knowledge & Memory MCP Servers

Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "context-harness": { "command": "npx", "args": ["-y", "context-harness"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Context Harness?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides