contextplus

Semantic Intelligence for Large-Scale Engineering. Context+ is an MCP server designed for developers who demand 99% accuracy. By combining RAG, Tree-sitter AST, Spectral Clustering, and Obsidian-style linking, Context+ turns a massive codebase into a searchable, hierarchical feature graph.

1,974
Stars
166
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/forloopcodes/contextplus

快速入门

使用 contextplus 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Context+

Semantic Intelligence for Large-Scale Engineering.

Context+ is an MCP server designed for developers who demand 99% accuracy. By combining RAG, Tree-sitter AST, Spectral Clustering, and Obsidian-style linking, Context+ turns a massive codebase into a searchable, hierarchical feature graph.

https://github.com/user-attachments/assets/a97a451f-c9b4-468d-b036-15b65fc13e79

Tools

Discovery

ToolDescription
get_context_treeStructural AST tree of a project with file headers and symbol ranges (line numbers for functions/classes/methods). Dynamic pruning shrinks output automatically.
get_file_skeletonFunction signatures, class methods, and type definitions with line ranges, without reading full bodies. Shows the API surface.
semantic_code_searchSearch by meaning, not exact text. Uses embeddings over file headers/symbols and returns matched symbol definition lines.
semantic_identifier_searchIdentifier-level semantic retrieval for functions/classes/variables with ranked call sites and line numbers.
semantic_navigateBrowse codebase by meaning using spectral clustering. Groups semantically related files into labeled clusters.

Analysis

ToolDescription
get_blast_radiusTrace every file and line where a symbol is imported or used. Prevents orphaned references.
run_static_analysisRun native linters and compilers to find unused variables, dead code, and type errors. Supports TypeScript, Python, Rust, Go.

Code Ops

ToolDescription
propose_commitThe only way to write code. Validates against strict rules before saving. Creates a shadow restore point before writing.
get_feature_hubObsidian-style feature hub navigator. Hubs are .md files with [[wikilinks]] that map features to code files.

Version Control

ToolDescription
list_restore_pointsList all shadow restore points created by propose_commit. Each captures file state before AI changes.
undo_changeRestore files to their state before a specific AI change. Uses shadow restore points. Does not affect git.

Memory & RAG

ToolDescription
upsert_memory_nodeCreate or update a memory node (concept, file, symbol, note) with auto-generated embeddings.
create_relationCreate typed edges between nodes (relates_to, depends_on, implements, references, similar_to, contains).
search_memory_graphSemantic search with graph traversal — finds direct matches then walks 1st/2nd-degree neighbors.
prune_stale_linksRemove decayed edges (e^(-λt) below threshold) and orphan nodes with low access counts.
add_interlinked_contextBulk-add nodes with auto-similarity linking (cosine ≥ 0.72 creates edges automatically).
retrieve_with_traversalStart from a node and walk outward — returns all reachable neighbors scored by decay and depth.

Complementary server: pmll-memory-mcp (npx pmll-memory-mcp) is a separate MCP server by @drQedwards that adapts Context+'s long-term memory graph and adds short-term KV context memory, Q-promise deduplication, and a solution engine on top. See drQedwards/PPM for details.

Setup

Quick Start (npx / bunx)

No installation needed. Add Context+ to your IDE MCP config.

For Claude Code, Cursor, and Windsurf, use mcpServers:

{
  "mcpServers": {
    "contextplus": {
      "command": "bunx",
      "args": ["contextplus"],
      "env": {
        "OLLAMA_EMBED_MODEL": "nomic-embed-text",
        "OLLAMA_CHAT_MODEL": "gemma2:27b",
        "OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY"
      }
    }
  }
}

For VS Code (.vscode/mcp.json), use servers and inputs:

{
  "servers": {
    "contextplus": {
      "type": "stdio",
      "command": "bunx",
      "args": ["contextplus"],
      "env": {
        "OLLAMA_EMBED_MODEL": "nomic-embed-text",
        "OLLAMA_CHAT_MODEL": "gemma2:27b",
        "OLLAMA_API_KEY": "YOUR_OLLAMA_API_KEY"
      }
    }
  },
  "inputs": []
}

If you prefer npx, use:

  • "command": "npx"
  • "args": ["-y", "contextplus"]

Or generate the MCP config file directly in your current directory:

npx -y contextplus init claude
bunx contextplus init cursor
npx -y contextplus init opencode

Supported coding agent names: claude, cursor, vscode, windsurf, opencode.

Config file locations:

IDEConfig File
Claude Code.mcp.json
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Windsurf.windsurf/mcp.json
OpenCodeopencode.json

CLI Subcommands

  • init [target] - Generate MCP configuration (targets: claude, cursor, vscode, windsurf, opencode).
  • skeleton [path] or tree [path] - (New) View the structural tree of a project with file headers and symbol definitions directly in your terminal.
  • [path] - Start the MCP server (stdio) for the specified path (defaults to current directory).

Including paths excluded by the workspace .gitignore

If your workspace .gitignore excludes a sub-directory that you still want indexed (common in monorepos where sub-projects under repos/, packages/, or vendor/ are gitignored at the top level), use --include or CONTEXTPLUS_EXTRA_ROOTS to add the paths back.

CLI form (repeatable):

bunx contextplus /path/to/workspace \
  --include repos/lacuna \
  --include repos/graphrag-core

Environment variable (fallback when no --include flag is set; uses the system path separator — : on Unix, ; on Windows):

CONTEXTPLUS_EXTRA_ROOTS=repos/lacuna:repos/graphrag-core \
  bunx contextplus /path/to/workspace

In .mcp.json the env form is usually more ergonomic:

{
  "mcpServers": {
    "contextplus": {
      "command": "bunx",
      "args": ["contextplus", "/path/to/workspace"],
      "env": {
        "CONTEXTPLUS_EXTRA_ROOTS": "repos/lacuna:repos/graphrag-core"
      }
    }
  }
}

Each path listed is walked independently of the workspace root, with a fresh ignore scope. Each path's own .gitignore is respected. Paths are validated at startup; invalid entries (non-existent, not a directory, outside the workspace) emit a stderr warning and are skipped.

Nested .gitignore files inside the workspace and inside each extra root are loaded and merged with inherited rules, matching git and ripgrep behavior.

From Source

npm install
npm run build

Embedding Providers

Context+ supports two embedding backends controlled by CONTEXTPLUS_EMBED_PROVIDER:

ProviderValueRequiresBest For
Ollama (default)ollamaLocal Ollama serverFree, offline, private
OpenAI-compatibleopenaiAPI keyGemini (free tier), OpenAI, Groq, vLLM

Ollama (Default)

No extra configuration needed. Just run Ollama with an embedding model:

ollama pull nomic-embed-text
ollama serve

Google Gemini (Free Tier)

Full Claude Code .mcp.json example:

{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": ["-y", "contextplus"],
      "env": {
        "CONTEXTPLUS_EMBED_PROVIDER": "openai",
        "CONTEXTPLUS_OPENAI_API_KEY": "YOUR_GEMINI_API_KEY",
        "CONTEXTPLUS_OPENAI_BASE_URL": "https://generativelanguage.googleapis.com/v1beta/openai",
        "CONTEXTPLUS_OPENAI_EMBED_MODEL": "text-embedding-004"
      }
    }
  }
}

Get a free API key at Google AI Studio.

OpenAI

{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": ["-y", "contextplus"],
      "env": {
        "CONTEXTPLUS_EMBED_PROVIDER": "openai",
        "OPENAI_API_KEY": "sk-...",
        "OPENAI_EMBED_MODEL": "text-embedding-3-small"
      }
    }
  }
}

Other OpenAI-compatible APIs (Groq, vLLM, LiteLLM)

Any endpoint implementing the OpenAI Embeddings API works:

{
  "mcpServers": {
    "contextplus": {
      "command": "npx",
      "args": ["-y", "contextplus"],
      "env": {
        "CONTEXTPLUS_EMBED_PROVIDER": "openai",
        "CONTEXTPLUS_OPENAI_API_KEY": "YOUR_KEY",
        "CONTEXTPLUS_OPENAI_BASE_URL": "https://your-proxy.example.com/v1",
        "CONTEXTPLUS_OPENAI_EMBED_MODEL": "your-model-name"
      }
    }
  }
}

Note: The semantic_navigate tool also uses a chat model for cluster labeling. When using the openai provider, set CONTEXTPLUS_OPENAI_CHAT_MODEL (default: gpt-4o-mini).

For VS Code, Cursor, or OpenCode, use the same env block inside your IDE's MCP config format (see Config file locations table above).

Architecture

Three layers built with TypeScript over stdio using the Model Context Protocol SDK:

Core (src/core/) - Multi-language AST parsing (tree-sitter, 43 extensions), gitignore-aware traversal, Ollama vector embeddings with disk cache, wikilink hub graph, in-memory property graph with decay scoring.

Tools (src/tools/) - 17 MCP tools exposing structural, semantic, operational, and memory graph capabilities.

Git (src/git/) - Shadow restore point system for undo without touching git history.

Runtime Cache (.mcp_data/) - created on server startup; stores reusable file, identifier, and call-site embeddings to avoid repeated GPU/CPU embedding work. A realtime tracker refreshes changed files/functions incrementally.

Config

VariableTypeDefaultDescription
CONTEXTPLUS_EMBED_PROVIDERstringollamaEmbedding backend: ollama or openai
OLLAMA_EMBED_MODELstringnomic-embed-textOllama embedding model
OLLAMA_API_KEYstring-Ollama Cloud API key
OLLAMA_CHAT_MODELstringllama3.2Ollama chat model for cluster labeling
CONTEXTPLUS_OPENAI_API_KEYstring-API key for OpenAI-compatible provider (alias: OPENAI_API_KEY)
CONTEXTPLUS_OPENAI_BASE_URLstringhttps://api.openai.com/v1OpenAI-compatible endpoint URL (alias: OPENAI_BASE_URL)
CONTEXTPLUS_OPENAI_EMBED_MODELstringtext-embedding-3-smallOpenAI-compatible embedding model (alias: OPENAI_EMBED_MODEL)
CONTEXTPLUS_OPENAI_CHAT_MODELstringgpt-4o-miniOpenAI-compatible chat model for labeling (alias: OPENAI_CHAT_MODEL)
CONTEXTPLUS_EMBED_BATCH_SIZEstring (parsed as number)8Embedding batch size per GPU call, clamped to 5-10
CONTEXTPLUS_EMBED_CHUNK_CHARSstring (parsed as number)2000Per-chunk chars before merge, clamped to 256-8000
CONTEXTPLUS_MAX_EMBED_FILE_SIZEstring (parsed as number)51200Skip non-code text files larger than this many bytes
CONTEXTPLUS_EMBED_NUM_GPUstring (parsed as number)-Optional Ollama embed runtime num_gpu override
CONTEXTPLUS_EMBED_MAIN_GPUstring (parsed as number)-Optional Ollama embed runtime main_gpu override
CONTEXTPLUS_EMBED_NUM_THREADstring (parsed as number)-Optional Ollama embed runtime num_thread override
CONTEXTPLUS_EMBED_NUM_BATCHstring (parsed as number)-Optional Ollama embed runtime num_batch override
CONTEXTPLUS_EMBED_NUM_CTXstring (parsed as number)-Optional Ollama embed runtime num_ctx override
CONTEXTPLUS_EMBED_LOW_VRAMstring (parsed as boolean)-Optional Ollama embed runtime low_vram override
CONTEXTPLUS_EMBED_TRACKERstring (parsed as boolean)trueEnable realtime embedding refresh on file changes
CONTEXTPLUS_EMBED_TRACKER_MAX_FILESstring (parsed as number)8Max changed files processed per tracker tick, clamped to 5-10
CONTEXTPLUS_EMBED_TRACKER_DEBOUNCE_MSstring (parsed as number)700Debounce window before tracker refresh

Test

npm test
npm run test:demo
npm run test:all

常见问题

What is contextplus?

contextplus is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by forloopcodes. Semantic Intelligence for Large-Scale Engineering. Context+ is an MCP server designed for developers who demand 99% accuracy. By combining RAG, Tree-sitter AST, Spectral Clustering, and Obsidian-style linking, Context+ turns a massive codebase into a searchable, hierarchical feature graph. It has 1,974 GitHub stars.

Is contextplus safe to use?

contextplus returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.

How do I install contextplus?

Clone the repository with "git clone https://github.com/forloopcodes/contextplus" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is contextplus written in?

contextplus is primarily written in TypeScript. It is open-source under forloopcodes on GitHub, so you can review or fork the full source.

Are there alternatives to contextplus?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh contextplus against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情