Skip to main content

Context-management gateway + MCP server that brings the ACM techniques (trimming, summarisation, image-recall, memory) into any IDE

Project description

ACM Extension — context management for any IDE

This folder is self-contained. It turns the context-management engine that already powers the website (in ../backend) into something usable from VSCode, Cursor, Antigravity, Claude Code, and Windsurf — without changing a single line of the website's code.

It reaches the IDEs through three surfaces (see ../EXTENSION_PLAN.md for the why):

Folder Surface What it is
acm_gateway/ Gateway A local OpenAI/Anthropic-compatible proxy. The IDE talks to it as if it were the AI; it applies every technique on the wire, then forwards to the real provider. Full feature parity.
acm_mcp/ MCP An MCP server exposing remember / recall / compact / set_profile tools. Works in every MCP-capable IDE.
adapters/ Hooks + config Per-IDE glue: Claude Code hooks, Cursor mcp.json, VSCode notes.
acm_engine/ Thin bridge that imports the techniques from ../backend so there is one source of truth.

How it reuses the website's engine

acm_engine/ puts ../backend on sys.path and re-exports the pure technique functions (trim_tool_results, summarise_old_messages, sliding_window_trim, evict_stale_images, annotate_cache_breakpoints) plus the Profile schema. Nothing in ../backend is edited. The website and the extension share the same code; fix a bug once, both benefit.

Quick start (gateway)

cd extension
uv venv --python 3.11
source .venv/bin/activate
uv pip install -e .

# point it at any OpenAI-compatible upstream (OpenRouter shown)
export ACM_UPSTREAM_BASE_URL=https://openrouter.ai/api/v1
export ACM_UPSTREAM_API_KEY=sk-or-v1-...

acm-gateway            # serves http://127.0.0.1:8807

Then tell the IDE the AI lives at http://127.0.0.1:8807/v1 (Cursor: custom OpenAI base URL; Claude Code: ANTHROPIC_BASE_URL).

Config

A single config/acm.config.example.json holds the active profile (which techniques are on). Copy it to config/acm.config.json and edit, or set ACM_CONFIG to its path. The schema is the website's Profile model — same presets (minimal, long_chat, power_research, cheap_long, visual_recall).

Status

  • Gateway — runnable. OpenAI (/v1/chat/completions) and Anthropic (/v1/messages) surfaces; full technique pipeline (trim / summarise / sliding window / image-evict / cache breakpoints / visual method — rasterise big tool outputs to images); manual message removal (cascade-safe drop-list, persisted to ~/.acm/dropped.json); multi-provider routing (OpenAI / OpenRouter / Google / Azure on the OpenAI surface, Anthropic native; creds in ~/.acm/providers.json; route by x-acm-provider header, slug/model prefix, or default — Bedrock via OpenRouter since it needs AWS SigV4); control plane (/status, /profile, /memory, /compact, /conversations, /messages*, /providers*).
  • MCP server — runnable: memory (remember/recall), compact, set_profile/status, manual removal (list_messages/drop_message/ restore_message), providers (list_providers/add_provider/ set_default_provider), sub-agent (spawn_subagent), and JIT retrieval (find_files/read_slice/grep_files).
  • Claude Code — gateway + hooks (trim + memory) + MCP. Done.
  • Cursor — gateway + hooks (capture + compact-on-stop) + MCP. Done.
  • VSCode — full extension (Language Model Tools + @acm chat participant + webview settings) talking to the gateway; MCP drop-in for Antigravity / Windsurf. TypeScript is written but not yet tsc-compiled here (needs npm install with @types/vscode).

Remaining work is marked with # TODO(acm) / TODO(acm): orphan-tool_use pruning on the Anthropic path, React components in the VSCode webview, and auto-starting the gateway from the extension.

Project details


Download files

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

Source Distribution

acm_context_management-0.2.0.tar.gz (116.6 kB view details)

Uploaded Source

Built Distribution

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

acm_context_management-0.2.0-py3-none-any.whl (92.8 kB view details)

Uploaded Python 3

File details

Details for the file acm_context_management-0.2.0.tar.gz.

File metadata

File hashes

Hashes for acm_context_management-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aea4775ef8cb72b71b3bf568ff0c77b3ef00c8807818eefd8e862dad41d8caa1
MD5 7c939dca5c8fb5a50ce6f479ea5b4dc1
BLAKE2b-256 9dde93fd47718afc2bf4b1652e0cb17b527ae47459aba8c67efa51ef12037f22

See more details on using hashes here.

File details

Details for the file acm_context_management-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for acm_context_management-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b359886d33e76104c02df12700f90da8e4c44c78ae523cfa17e345ca3fc3e068
MD5 87f6c707812e3dd61338b974cf1cc18f
BLAKE2b-256 95700f205dafcc834146066de5679e511b4aadc5033d5060f82bc065f095ac17

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 Pingdom Monitoring Sentry Error logging StatusPage Status page