Skip to main content
Glama
README.md
# Context MCP

<!-- mcp-name: io.github.arthurhoch/context-mcp -->

[![Latest release](https://img.shields.io/github/v/release/arthurhoch/context-mcp)](https://github.com/arthurhoch/context-mcp/releases/latest)
[![CI](https://github.com/arthurhoch/context-mcp/actions/workflows/ci.yaml/badge.svg?branch=main&event=push)](https://github.com/arthurhoch/context-mcp/actions/workflows/ci.yaml?query=branch%3Amain)
[![License](https://img.shields.io/github/license/arthurhoch/context-mcp)](LICENSE)
[![MCP Registry](https://img.shields.io/badge/MCP_Registry-context--mcp-blue)](https://registry.modelcontextprotocol.io/?q=io.github.arthurhoch%2Fcontext-mcp)

[![M8ven Score](https://m8ven.ai/badge/mcp/arthurhoch-context-mcp-jdvfxv?v=5db06a82aa8317971885dca1e97e6ad3)](https://m8ven.ai/mcp/arthurhoch-context-mcp-jdvfxv?s=readme)

Context MCP is a Rust server that gives coding agents searchable project memory.
Find an earlier investigation by error, symptom, or filename, open the evidence,
and resume from the last verified result. Keep private preferences and engineering
standards in a personal profile that follows you between computers.

- Search project files, shared knowledge, and explicitly related projects.
- Record a versioned investigation with excerpts and SHA-256 evidence hashes.
  Export its timeline and evidence to Markdown from the CLI.
- Load business rules and coordinate work across Codex and Cursor. A private
  profile can also supply coding preferences, architecture by language, and
  minimum project requirements.
- Run locally over stdio or self-host behind HTTPS with one revocable bearer
  token per device. SQLite stores data on the host you choose.

## Install with an agent

Paste this into a coding agent with terminal access.

```text
Install Context MCP for my MCP client. Detect my operating system and CPU.
Download the matching archive and SHA256SUMS from
https://github.com/arthurhoch/context-mcp/releases/latest.
Verify the archive checksum and extract it to a permanent location.
Use "context-mcp demo <new-directory>" to create a synthetic catalog.
Run "context-mcp --config <demo>/catalog.toml validate" and index pw-fixture,
geral, and pw-utilitarios with that catalog. Register the stdio launcher with
absolute paths using "context-mcp --config <demo>/catalog.toml serve".
Preserve my existing MCP entries and catalogs. After the client reconnects,
look up PW-MOEDA-042 in pw-fixture and open its verified evidence.
```

## Download and run

The release archives include the executable, documentation, and configuration
examples. Rust is needed only when building from source.

| System | x64 (Intel/AMD) | ARM64 (Apple Silicon/ARM) |
| --- | --- | --- |
| macOS | [Download](https://github.com/arthurhoch/context-mcp/releases/latest/download/context-mcp-macos-x64.tar.gz) | [Download](https://github.com/arthurhoch/context-mcp/releases/latest/download/context-mcp-macos-arm64.tar.gz) |
| Linux | [Download](https://github.com/arthurhoch/context-mcp/releases/latest/download/context-mcp-linux-x64.tar.gz) | [Download](https://github.com/arthurhoch/context-mcp/releases/latest/download/context-mcp-linux-arm64.tar.gz) |
| Windows | [Download](https://github.com/arthurhoch/context-mcp/releases/latest/download/context-mcp-windows-x64.zip) | [Download](https://github.com/arthurhoch/context-mcp/releases/latest/download/context-mcp-windows-arm64.zip) |

Choose a platform-specific `.mcpb` asset if your client supports MCP bundles.
The bundle launches the server over stdio and prompts for a catalog TOML.
See the [download verification guide](docs/releases.md#verify-a-download) for
checksums and GitHub build attestations.

### Try the demo

Run this from an extracted macOS or Linux archive.

```sh
bin="$PWD/context-mcp"
demo="$(mktemp -d)/context-demo"
"$bin" demo "$demo"
"$bin" --config "$demo/catalog.toml" validate
"$bin" --config "$demo/catalog.toml" index pw-fixture
"$bin" --config "$demo/catalog.toml" index geral
"$bin" --config "$demo/catalog.toml" index pw-utilitarios
```

On Windows, use `context-mcp.exe` and pass a new directory as the demo
destination. The demo produces a catalog, a synthetic investigation, and
`investigacao.md`. After connecting a client, ask it to find `PW-MOEDA-042`
in `pw-fixture` and open the evidence. It should find that providing a fixture
`RecipientId` made the simulated operation succeed. The demo uses synthetic
files and logs.

To export an investigation, use its UUID from the demo output or
`search_context`.

```sh
"$bin" --config "$demo/catalog.toml" export pw-fixture INVESTIGATION_UUID > investigation.md
```

## Connect your MCP client

### Codex

With the paths from the demo above, register the launcher and open a new chat.

```sh
codex mcp add context-mcp -- "$bin" --config "$demo/catalog.toml" serve
codex mcp list
```

### Cursor

Merge this entry into `~/.cursor/mcp.json` for all workspaces or
`.cursor/mcp.json` for one workspace. Use absolute paths to your binary and catalog.

```json
{
  "mcpServers": {
    "context-mcp": {
      "command": "/absolute/path/context-mcp",
      "args": ["--config", "/absolute/path/context-demo/catalog.toml", "serve"]
    }
  }
}
```

### GitHub Copilot in VS Code

Use the [Copilot setup guide](docs/copilot.md) for local stdio or for a
self-hosted server authenticated with an environment variable.

## Self-host and enable personal memory

Run `serve-http` on loopback behind your HTTPS reverse proxy. Publish
`/mcp`, `/agent-context`, and `/personal-memory` through the proxy and give
each computer its own token. See the [VPS and client setup guide](docs/proxy.md).

Create a profile on the server and issue device tokens linked to it.
Personal entries stay in a separate SQLite database. A preference or rule
can apply everywhere, or be scoped to a language or project. A new profile
includes editable readability, architecture, and verification defaults.
Use the [personal memory guide](docs/memoria-pessoal.md) to install the
user-level hooks for Codex and Cursor.

Codex loads personal memory on prompt submission. Cursor loads it
asynchronously when a chat opens. The personal memory CLI can read or update
the profile from either client when the device token is available.

## MCP tools

| Tool | Purpose |
| --- | --- |
| `list_projects` | Discover project IDs and their available sources. |
| `search_context` | Search files, saved investigation entries, and configured shared context. |
| `open_reference` | Read a reference with its origin, version, and evidence. |
| `record_context` | Save a durable finding, decision, or verification with evidence. |

Pass the exact `project_id` for project operations. See the
[MCP contract](docs/mcp.md) for arguments, search scope, and pagination.

## Build from source

From the repository root, use rustup with the pinned toolchain and a C
compiler for the bundled SQLite library.

```sh
cargo build --release --locked
target/release/context-mcp --version
```

[Documentation](docs/README.md) · [Changelog](CHANGELOG.md) · [Privacy](PRIVACY.md) · [Security](https://github.com/arthurhoch/context-mcp/security/policy)