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.1.tar.gz (96.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.1-py3-none-any.whl (106.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acm_context_management-0.2.1.tar.gz
  • Upload date:
  • Size: 96.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acm_context_management-0.2.1.tar.gz
Algorithm Hash digest
SHA256 35b9ea638277401728279fda4da07b8a3f6acd79becf28aabaa75b7aa474d252
MD5 4d1530e5cfea6d4e90f85714e60aca3f
BLAKE2b-256 481cdf64dbe1cb63ee0e2c35e3536b63ad24a480a3a4db9c7e99cddfbb651d00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acm_context_management-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 106.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acm_context_management-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b843317cde34ef9ba1927e2d886add2d60c304afc0ec36ee50ab7bfc6057d3
MD5 aed1e39af71847fc6df9f97ec3ca6186
BLAKE2b-256 a619247359b034ce3fcf91b217fd07c2b842b172a286ffe0e4f0b11ab1b7d504

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