/ Directory / Playground / contextplus
● Community ForLoopCodes ⚡ Instant

contextplus

by ForLoopCodes · ForLoopCodes/contextplus

Give your coding agent a persistent semantic map of the repo — AST + embeddings + memory graph + shadow undo — so it stops re-reading the whole codebase.

Context+ (ForLoopCodes/contextplus) is a TypeScript MCP exposing 17 tools for repo understanding: tree-sitter AST trees, file skeletons, semantic identifier search, blast-radius analysis, a memory graph for long-running projects, and shadow restore points for safe edits. Works with Ollama or cloud embeddings.

Why use it

Key features

Live Demo

What it looks like in practice

contextplus.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": [
        "-y",
        "contextplus"
      ],
      "_inferred": true
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": [
        "-y",
        "contextplus"
      ],
      "_inferred": true
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": [
        "-y",
        "contextplus"
      ],
      "_inferred": true
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": [
        "-y",
        "contextplus"
      ],
      "_inferred": true
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "contextplus",
      "command": "npx",
      "args": [
        "-y",
        "contextplus"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "contextplus": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "contextplus"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add contextplus -- npx -y contextplus

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use contextplus

How to make a new agent productive in a large repo fast

👤 Tech leads using Cursor/Claude Code on a monorepo ⏱ ~20 min intermediate

When to use: The agent wastes 30% of context reading and re-reading files.

Prerequisites
  • Node + bun or npm — brew install bun or use npm
  • An embeddings provider (Ollama local, OpenAI, Gemini, or Groq) — ollama pull nomic-embed-text for offline
Flow
  1. Build the context tree
    Run get_context_tree on the repo root. Summarize the top-level layers.✓ Copied
    → AST tree with file headers
  2. Skeleton-only reads
    Use get_file_skeleton on src/auth/ to see just signatures — don't read bodies yet.✓ Copied
    → Function signatures without bodies
  3. Ask a semantic question
    semantic_identifier_search: 'where is JWT verification implemented and called?'✓ Copied
    → Ranked implementations + call sites

Outcome: Agent operates with a mental model of the repo using ~5x less context.

Pitfalls
  • First-run indexing is slow — Run the initial scan once; incremental updates are fast
  • Embeddings model mismatch between index and query — Stick with one embedding model; re-index if you change it
Combine with: filesystem · github

How to refactor with shadow restore points

👤 Devs worried about letting agents edit code ⏱ ~15 min intermediate

When to use: You want agent edits but also want a one-click undo that doesn't dirty git.

Flow
  1. Capture a restore point
    Create a restore point named 'before-auth-refactor'.✓ Copied
    → Point id returned
  2. Let the agent edit
    propose_commit: refactor JWT verification to use the new key rotation helper.✓ Copied
    → Files edited + validation passed
  3. Rollback if wrong
    undo_change back to 'before-auth-refactor'.✓ Copied
    → Files reverted, git history clean

Outcome: Fearless refactors without polluting git history.

Pitfalls
  • Restore points live in .contextplus/ — don't check this in — Add .contextplus/ to .gitignore
Combine with: github

How to assess blast radius before deleting a function

👤 Engineers cleaning up dead code ⏱ ~10 min intermediate

When to use: You want to know exactly who imports or uses a symbol before removing it.

Flow
  1. Ask for the blast radius
    get_blast_radius for function 'legacyFormatPrice' in src/pricing.ts.✓ Copied
    → Every file/line that imports or calls it
  2. Plan removal
    For each call site, suggest the replacement. Any site without a clean swap, flag as risky.✓ Copied
    → Migration checklist

Outcome: A deletion PR with zero surprises.

Pitfalls
  • Dynamic imports (require, string refs) aren't detected — Supplement with a grep pass for the function name
Combine with: github

How to persist decisions across sessions with the memory graph

👤 Any agent user on a long-running project ⏱ ~15 min advanced

When to use: You keep re-explaining the same architectural choices to the agent.

Flow
  1. Seed memory
    upsert_memory_node: 'We chose Postgres over MongoDB because of transactional invariants in the billing flow.'✓ Copied
    → Node created with embedding
  2. Create relations
    create_relation: link that decision to files src/billing/*.ts with edge type 'implements'.✓ Copied
    → Edge created
  3. Retrieve next session
    search_memory_graph: 'why are we using Postgres?'✓ Copied
    → Decision surfaces with supporting files

Outcome: Durable project memory that outlives the chat.

Pitfalls
  • Memory graph grows stale — Run prune_stale_links monthly
Combine with: memory-service

Combinations

Pair with other MCPs for X10 leverage

contextplus + github

Use blast-radius findings to populate a tracking issue

Run get_blast_radius on LegacyAuth then create a GitHub tracking issue with each call site as a checklist item.✓ Copied
contextplus + memory-service

Persist long-term decisions across projects using mcp-memory-service as the shared store

Whenever Context+ captures a new architectural decision, mirror it into mcp-memory-service.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
get_context_tree root: str, depth?: int First call in a new repo session free
get_file_skeleton path: str Cheap file overview free
semantic_code_search query: str, k?: int Find code by meaning 1 embedding + 1 vector search
semantic_identifier_search query: str Locate a function/class 1 vector search
get_blast_radius symbol: str, file?: str Before deleting/renaming free
run_static_analysis path?: str Unused code + type errors free
propose_commit files: Edit[] Apply edits with validation free
list_restore_points See available rollbacks free
undo_change restore_point_id: str Revert a shadow edit free
upsert_memory_node content: str, tags?: str[] Save a durable fact 1 embedding
search_memory_graph query: str, traversal?: int Recall past decisions 1 vector search

Cost & Limits

What this costs to run

API quota
Depends on embedding provider: Ollama free, OpenAI ~$0.02/1M tokens
Tokens per call
Skeleton reads: 100-500 tokens. Full searches: 500-2000
Monetary
Free (open source) + embedding costs if using cloud providers
Tip
Use Ollama with nomic-embed-text for zero marginal cost.

Security

Permissions, secrets, blast radius

Minimum scopes: Filesystem read/write to the indexed repo
Credential storage: Embedding provider keys via env
Data egress: Embeddings go to your chosen provider (or stay local with Ollama)
Never grant: Do not index directories with secrets like .env

Troubleshooting

Common errors and fixes

Indexing is extremely slow

Add large directories (node_modules, dist) to .contextplusignore; use Ollama locally.

Semantic search returns irrelevant results

Your query is too abstract — include a concrete symbol or filename hint.

undo_change fails with 'point not found'

Shadow points are per-session by default. Persist across sessions via the config flag.

Tree-sitter grammar missing for a language

Check the supported extensions list; files of unsupported types are skipped but indexed as plain text.

Alternatives

contextplus vs others

AlternativeWhen to use it insteadTradeoff
mcp-language-serverYou want LSP semantics (rename, references) rather than embedding-based searchNo memory graph, no shadow undo
codebase-memory-mcpYou prefer a knowledge-graph view over per-file skeletonsDifferent index shape; 66 languages

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills