project_context
Detects Android projects and provides a bootstrapped project knowledge baseline with concise project context for Android repositories.
Detects C/C++ projects and provides project context and knowledge baseline generation for C++ repositories.
Detects Dart projects and provides project context and knowledge baseline generation for Dart repositories.
Recognizes Docker-aware repositories and incorporates container-related awareness into the generated project context.
Detects Electron projects and provides project context and knowledge baseline generation for Electron repositories.
Detects JavaScript projects and provides project context and knowledge baseline generation for JavaScript repositories.
Detects C#/.NET projects and provides project context and knowledge baseline generation for .NET repositories.
Detects PHP projects and provides project context and knowledge baseline generation for PHP repositories.
Detects Python projects and provides project context and knowledge baseline generation for Python repositories.
Detects React projects and provides project context and knowledge baseline generation for React repositories.
Detects Ruby projects and provides project context and knowledge baseline generation for Ruby repositories.
Detects Rust projects and provides project context and knowledge baseline generation for Rust repositories.
Detects Swift projects and provides project context and knowledge baseline generation for Swift repositories.
Detects TypeScript projects and provides project context and knowledge baseline generation for TypeScript repositories.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@project_contextbootstrap project context for this repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenCode Project Knowledge
Universal, one-time-installable project understanding for OpenCode and Antigravity IDE/CLI.
Install once, open any repository, and get efficient project context automatically
— no per-project setup. The engine is the same on both platforms; thin adapters expose
the same project_context as an OpenCode plugin and an Antigravity MCP server + hook.
What it does
Detects the project type (Python, JS/TS, Vue, React, Electron, C#/.NET, Java, C/C++, PHP, Go, Rust, Android, mixed, or unknown→generic).
Bootstraps a concise
.project/knowledge baseline safely when missing.Injects a compact (~35-line)
PROJECT CONTEXTat task start — never the whole knowledge base, never large source excerpts.Refreshes incrementally: file change → affected modules → stale markers → targeted doc updates → baseline update.
Works with local filesystem + Git only. On OpenCode: no MCP required (plugin + instructions); on Antigravity: same engine via MCP
project_contextPreInvocationhook + skills (open Agent Skills spec).
Related MCP server: @mempalace/mcp-dev
Install (Windows, one click)
Get this repository onto your machine (Clone it, or Download ZIP from GitHub and extract it anywhere).
Double-click
Install.bat.Done. No admin rights needed — it installs for your Windows user only, and the window stays open so you can see the result.
To remove it later, double-click Uninstall.bat (your other OpenCode
settings are left untouched).
Advanced (terminal — does exactly the same thing):
powershell -ExecutionPolicy Bypass -File install.ps1
powershell -ExecutionPolicy Bypass -File install.ps1 -DryRun # preview onlyOne-liner (no clone needed):
irm https://raw.githubusercontent.com/usm007/opencode-project-knowledge/main/install.ps1 | iexLinux/macOS:
./install.shUninstall (terminal — same as Uninstall.bat):
powershell -ExecutionPolicy Bypass -File uninstall.ps1./uninstall.shHow automatic operation works
Open any repo in OpenCode or Antigravity.
Global
AGENTS.md+project-knowledge-autoskill fire before substantial work (Antigravity also auto-injects via itsPreInvocationhook and exposesproject_contextvia MCP)..project/present →context.jsbuildsPROJECT CONTEXTfromoverview.md+knowledge.json+state/stale.json; only the touched subsystem's detail docs are read via themodules.mdmap..project/absent →bootstrap.mjscreates it safely (detects type, respects.gitignore, skips build output/secrets, never touches source, never commits, creates rootAGENTS.mdonly if missing).Edits →
refresh.jsmarks affected modules stale; agent updates only those docs;status.jsreports health read-only.
Debug directly:
node project-knowledge/detect.js <repo> --json
node project-knowledge/context.js <repo> "one-line task"
node project-knowledge/status.js <repo>
node project-knowledge/refresh.js <repo>
node project-knowledge/bootstrap.mjs <repo>Supported project types
Python · JavaScript · TypeScript · Vue · React (incl. Next/Angular hints) · Electron · C#/.NET · Java · C · C++ · PHP · Go · Rust · Android · Ruby · Dart · Swift · Docker-aware · mixed-language · unknown → generic structural analysis.
Global vs project-local
Global (installed once, | Project-local (per repo, |
|
|
Limitations
Heuristic detection (markers + extension census) can misread exotic layouts —
detect.js --jsonshows evidence; source always wins.Bootstrap stubs contain
(agent)placeholders until completed with real reads.Git-absent repos lose change tracking (filesystem fallback only).
The plugin is optional/defensive; CLI + instructions are the guaranteed path. It ships as ESM per OpenCode's documented plugin format and installs its
@opencode-ai/plugindependency automatically at first OpenCode startup.
Security
Never records passwords, API keys, tokens, certificates, or env secret values.
Respects .gitignore + info/exclude; skips node_modules/bin/obj/dist/build/ target/vendor, caches, binaries, and secret-like paths. See docs/.
Safety guarantees
--forcebootstrap backs up overwritten docs to.project/.backup/<timestamp>/.Your own keys in
knowledge.jsonsurvive regeneration; pre-existing payload files are backed up (.bak) on first install and restored on uninstall.Installers refuse silent downgrades, support
--dry-run/-DryRunpreviews, and verify installed files againstSHA256SUMS.npm test(52 unit + E2E) runs on Windows + Linux via CI (--allow-downgradeand POSIX paths covered on Ubuntu).
Contributing
See docs/development.md. Requires Node ≥ 18, no deps.
Run npm test before PRs. Bump VERSION on releases.
Layout
├── README.md LICENSE VERSION AGENTS.md package.json
├── install.ps1 uninstall.ps1 install.sh uninstall.sh
├── project-knowledge/ skills/ plugins/ commands/ antigravity/
├── tools/ tests/ docs/ examples/This server cannot be deployed
Maintenance
Related MCP Connectors
Project memory, semantic code search, and grounded agent context.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
- OneLoreOAuthai.onelore
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceIntelligently analyzes codebases to enhance LLM prompts with relevant context, featuring adaptive context management and task detection to produce higher quality AI responses.2-
- AlicenseAqualityCmaintenanceEnables AI coding assistants to access grounded, branch-scoped codebase context via semantic search, git tracking, change ledger, and structured feature management with Project Tracks.191MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI coding assistants to automatically detect and inject team-specific codebase patterns (e.g., error handling, imports, naming conventions) via the Model Context Protocol, ensuring suggestions follow project conventions.MIT
- AlicenseBqualityAmaintenanceEnables AI coding agents to maintain persistent project context, including rules, decisions, environment intelligence, and Git history, using a local-first MCP server with automatic project detection and token-efficient retrieval.13MIT