Skip to main content

one-context-mcp

One local MCP server that gives Claude, Cline, Codex, and other AI tools the same project memory.

one-context-mcp stops the repeated setup explanation every time you switch AI tools. It stores project context locally in a small SQLite database and exposes it through MCP tools that every connected assistant can read and update.

  • PyPI package: one-ctx
  • Main CLI command: one-context
  • Alternate CLI commands: ctx, one-ctx
  • GitHub repo: m4vic/one-context-mcp
  • Default merge mode: local rules only, no model and no API key

Quick Install

Add this to Claude Desktop, Cline, Codex, or any MCP client:

{
  "mcpServers": {
    "one-context": {
      "command": "uvx",
      "args": ["--from", "one-ctx", "one-context", "stdio"]
    }
  }
}

Then fully restart the MCP client.

Full setup instructions are in INSTALLATION_GUIDE.md.


Why It Exists

Every coding assistant has its own short-term context. When you move from Claude to Cline, from Cline to Codex, or from one IDE session to another, you usually explain the same project again:

This is a FastAPI backend, PostgreSQL is the database, src/main.py is the entry point, we just changed auth, and next we need rate limiting.

one-context-mcp makes that explanation persistent and shared.


Architecture

graph TD
    classDef rootNode fill:#0d1117,stroke:#58a6ff,stroke-width:3px,color:#c9d1d9,font-size:16px,font-weight:bold;
    classDef aiNode fill:#161b22,stroke:#3fb950,stroke-width:2px,color:#c9d1d9,font-size:14px;
    classDef bucketNode fill:#21262d,stroke:#8b949e,stroke-dasharray: 5 5,color:#c9d1d9;
    classDef localNode fill:#1f2937,stroke:#f59e0b,stroke-width:2px,color:#f9fafb;

    A([one-context MCP Server]):::rootNode
    DB[(Local SQLite DB)]:::localNode

    C1[Claude Desktop]:::aiNode
    C2[Cline / VS Code]:::aiNode
    C3[Codex]:::aiNode
    C4[Other MCP Clients]:::aiNode

    B1[(WHAT\nProject scope)]:::bucketNode
    B2[(DONE\nHistory and decisions)]:::bucketNode
    B3[(NOW\nCurrent work)]:::bucketNode
    B4[(MAP\nImportant files)]:::bucketNode
    B5[(NOTES\nUser messages)]:::bucketNode

    C1 <-->|ctx_get / ctx_update| A
    C2 <-->|ctx_get / ctx_update| A
    C3 <-->|ctx_get / ctx_update| A
    C4 <-->|MCP tools| A

    A --- DB
    DB --- B1
    DB --- B2
    DB --- B3
    DB --- B4
    DB --- B5

Everything is local by default. No account, no cloud service, no vector database, and no LLM API call is required.


First Use

Use a stable project name. For example, use asrt every time you refer to the ASRT project.

Ask your assistant:

Use one-context. Link project asrt to F:\ASRT, then load context.

At the end of a work session:

Update one-context for project asrt with what we changed, what is done, what is next, and important files.

You do not edit MCP config when switching work folders. Link each project once with ctx_link(project, repo_path).


What Gets Stored

Bucket Purpose Example
WHAT Project identity, stack, architecture, constraints FastAPI backend with PostgreSQL and async SQLAlchemy
DONE Completed work, decisions, solved issues JWT auth implemented, UUID user IDs chosen
NOW Current task and next steps Working on rate limiting middleware
MAP Important files and what they do src/auth.py - auth middleware
BUGS Known bugs, open or fixed Race condition in concurrent writes - fixed
NOTES User-authored project messages Remember to keep ASRT context strict

MAP entries are normalized and deduplicated. When a project is linked to a repo_path, file tracking is scoped to that repo so context from different projects does not get mixed.


MCP Tools

Tool Purpose
ctx_get(project) Load WHAT, DONE, NOW, MAP, repo path, and git info
ctx_strict_get(project, repo_path) Load context only when the current workspace path matches the linked project
ctx_update(project, session_summary, tool_name) Merge a session summary into project context
ctx_map(project, files, replace) Register important files manually
ctx_note(project, message, author, merge) Store a user-authored note for one project
ctx_history(project, limit) Show recent updates and user notes for one project
ctx_link(project, repo_path) Create/link a project to a workspace root for strict file scoping
ctx_resolve(repo_path) Reverse lookup: which project is linked to this folder (works from subfolders too)
ctx_bug(project, description?, bug_id?, status?) Add a bug, mark one fixed, or list a project's bugs
ctx_export(project?, format?) Export context as JSON (re-importable) or Markdown; omit project for all
ctx_import(data, mode?) Restore/merge context from a ctx_export JSON
ctx_search(query) Search all projects, update history, user notes, and bugs
ctx_reset(project) Clear one project's context, history, notes, and bugs
ctx_list() List tracked projects with their linked folders

ctx_get also accepts view: "brief" to return only the recent slice of DONE when the calling session is low on context.


CLI Reference

ctx status [project]          # View current context or list projects
ctx init <project> --path .   # Create/link project to repo path
ctx search <query>            # Search across projects and history
ctx export <project> -o f.json   # Backup one project (--all for everything, --format md for readable)
ctx import f.json             # Restore/merge an exported backup
ctx reset <project>           # Clear a project's context
ctx delete <project>          # Permanently delete a project
ctx list                      # List all projects
ctx serve --port 7337         # Start HTTP/SSE server (localhost only by default)
ctx stdio                     # Start stdio MCP server

Backup & Portability

Your entire context lives in one SQLite file (~/.ctx/ctx.db). To back it up, commit it to a repo, or move machines:

ctx export myproject -o context-backup.json   # per-project backup
ctx export --all -o all-context.json          # everything
ctx import context-backup.json                # merge into existing (safe, idempotent)
ctx import context-backup.json --mode replace # overwrite buckets

Any MCP client can do the same via the ctx_export / ctx_import tools.


Security

  • stdio mode (the default setup) has no network surface.
  • ctx serve binds localhost only by default (changed in 0.4.0; previously 0.0.0.0).
  • To expose HTTP mode on a network, set a token first: CTX_AUTH_TOKEN=<secret> ctx serve --host 0.0.0.0. Clients must then send Authorization: Bearer <secret>. Without the token the server warns loudly.
  • With auth enabled, /health hides the tool list and CORS is restricted to localhost origins.

Documentation


License

MIT


Built to end context amnesia across AI tools.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

one_ctx-0.4.0.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

one_ctx-0.4.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file one_ctx-0.4.0.tar.gz.

File metadata

  • Download URL: one_ctx-0.4.0.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for one_ctx-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f2f37a7d57c8b81758cdb550d3c9040f3c8ffb6f224ea25cd3f3f17b3fa91796
MD5 4a916457af085d00a73265ad3ebc7d0a
BLAKE2b-256 ecdd49caa13f04439e443d8751eefdeeb5c93a6644e31066c7df87f94650ef84

See more details on using hashes here.

File details

Details for the file one_ctx-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: one_ctx-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for one_ctx-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 610a5af31fd84672f5f684534d92a8c1a07ac57f9f751ac97f2a927736fa75e6
MD5 68ba8954ab09827e89e7ff64edeb59ff
BLAKE2b-256 d4ec1874d43888e4c835346f45ba0aed2eccd0975f7f97b5e5b56eb90a65ec89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page