PlugWiki
Context Mode logo

Context Mode MCP Server: Setup for Claude Code, Cursor and Other Apps

CommunityLocal
Getnpmcontext-modemksglu/context-mode

Keeps big tool output out of your assistant's context window by running code and searching a local index.

Context Mode keeps your assistant's context window from filling up. Instead of pasting big logs, pages or files into the chat, the assistant runs code that prints only the answer, or searches a local index of what you stored. It runs on your computer with no account and works with Claude Code, Cursor, Gemini CLI and others. It can run any code you can, so it has the same reach as your shell.

Good for

  • Claude Code users whose long sessions run out of context
  • Developers who read large logs, API responses or test output
  • Teams who want a local index of docs and web pages to search

Works in

12 should work

Tap an app to see how to set it up and any known problems.

Install Context Mode MCP

Claude Code

  1. 1

    Copy this prompt.

    Add the Context Mode MCP server to Claude Code. Run this command:
    
    claude mcp add context-mode -- npx -y context-mode
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

Built from the package data we hold. Not yet tested by us.

Tools

  • Runs code and returns only what it prints

    Runs code in a subprocess in one of 12 languages and sends back only the printed output, so a big log or file is analyzed without filling the chat. The code has your computer's file and network access.

    Try: “Count the lines in every .ts file under src and print only the totals.”

    Runs code · ctx_execute

  • Processes a file with code, without reading it into the chat

    Runs code over a file and returns only the result. It is limited to the project folder unless you allow other paths in your permission rules.

    Try: “Run a script over logs/access.log and report the 10 most common URLs.”

    Runs code · ctx_execute_file

  • Runs several commands and searches in one call

    Runs a list of commands and then searches the output for several questions in one step. You can run up to 8 at once.

    Try: “Run git log, git status and npm test, then tell me what failed.”

    Runs code · ctx_batch_execute

  • Downloads a web page and stores it for search

    Fetches one or more URLs, splits them into chunks and adds them to the local search index. It reuses a recent copy for 24 hours by default. It refuses cloud-metadata addresses and non-web links.

    Try: “Fetch the Stripe webhooks docs and index them.”

    Write · ctx_fetch_and_index

  • Stores text or a file in the local search index

    Splits Markdown or file content into chunks and adds it to a local database for search.

    Try: “Index docs/architecture.md so I can ask questions about it.”

    Write · ctx_index

  • Searches what you indexed

    Runs several queries at once over the indexed content and returns only the matching parts.

    Try: “Search the index for how authentication tokens are refreshed.”

    Read · ctx_search

  • Permanently deletes indexed content

    Deletes the stored search index for a scope you pick. It cannot be undone and needs an explicit confirmation.

    Try: “Purge the knowledge base for this session.”

    Delete · ctx_purge

  • Used by the assistant behind the scenes

    Shows how much context you saved

    Returns the bytes sent to the chat, a breakdown by tool, call counts and the savings ratio for this session.

    Try: “Show my context savings so far.”

    Read · ctx_stats

  • Checks that the install works

    Runs checks on languages, hooks and the search database and prints a status report.

    Try: “Run the Context Mode diagnostics.”

    Read · ctx_doctor

  • Gives the command to update it

    Returns a shell command that updates Context Mode from GitHub, rebuilds it and fixes hooks. The assistant then runs that command in your shell.

    Try: “Upgrade Context Mode.”

    Runs code · ctx_upgrade

  • Opens the hosted Insight dashboard

    Opens the Context Mode Insight dashboard on context-mode.com in your browser. It is a launcher for the hosted analytics page.

    Try: “Open the Insight dashboard.”

    Network · ctx_insight

Read from the source code

Permissions

high risk · 5 things to watch

High risk

The assistant can run any code your user account can run, with network access, and nothing limits what that code does; only file reads by one tool are kept inside the project. Keep approval prompts on, add deny rules for risky commands, and use it on projects you can restore.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It runs arbitrary code with your access

    Three tools run code you or the assistant write, with full network access. The README calls the file guard defense in depth, not an operating system sandbox. github.com

  • It records your session in a local database

    File edits, git actions, tasks, errors and decisions are tracked in SQLite so the session can resume after compaction. Tool inputs are redacted for common secret names, but check the folder if you work with sensitive code. github.com

  • Fetch can reach your local network

    Localhost and private network addresses are allowed by default. Set CTX_FETCH_STRICT to 1 to block them. github.com

  • Purge deletes the index for good

    ctx_purge cannot be undone. It needs confirm set to true and one scope. github.com

  • It can use your deny rules

    Rules you set in Claude Code settings, such as blocking sudo, also apply inside its code tools. Add them before you use it. github.com

Security advisories

No published security advisories as of Nov 1, 2026.

Technical details
Turning on read-onlyNo read-only mode is documented. Your existing deny rules for Bash commands also apply inside its code tools.
Talks toAny address the code you run contacts. URLs you ask it to fetch (web only; cloud-metadata addresses are blocked). context-mode.com when you open the Insight dashboard. GitHub when you upgrade
Sign-in and keysNo account or key. The README says nothing leaves your machine and there is no telemetry. Session and index data is stored in SQLite files in your home folder.

Questions

What does Context Mode do?

It keeps raw output out of the chat. Instead of pasting a 50 KB log, the assistant runs code that prints only the answer, or searches an index of what you stored. The README says this cut one 315 KB example down to 5.4 KB.

Is it free?

You can use it without paying and without an account. The package license is Elastic License 2.0, which is source-available and not an open-source license, so read the terms before you use it at work.

Does it send my code anywhere?

The README says nothing leaves your machine and there is no telemetry. It does fetch URLs you ask for, opens the hosted Insight dashboard on request and downloads updates from GitHub.

Should I install the plugin or just the server?

Claude Code users can install it as a plugin, which also adds hooks that steer the assistant toward these tools and slash commands. The MCP-only install in the box above gives the 11 tools without the hooks. The README suggests trying it first.

Which apps does it support?

The README lists 17 platforms including Claude Code, Gemini CLI, Cursor, VS Code Copilot, Codex, OpenCode and Zed. Hook-capable apps get automatic routing; others need a one-time rules file copy.

Is it safe to let it run code?

It is as safe as running that code yourself. It runs with your permissions and has full network access, so use your deny rules and approval prompts.

Information

updated Nov 2, 2026

Publisher
Community
Package
context-mode
Registry
npm
Transport
stdio
Auth
None
License
Elastic-2.0
Last commit
Oct 31, 2026
Open issues
0

WebsiteGitHubChangelog

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 3
  1. Context Mode README · github.com
  2. Tool registrations · github.com
  3. context-mode on npm · npmjs.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.