contextforge-mcp
Click on "Install 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., "@contextforge-mcpWhat are the project conventions?"
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.
ContextForge
ContextForge scans your codebase, detects conventions, and generates a .context.md file that AI-powered IDEs (Claude Code, Cursor, Windsurf, VS Code Copilot) read automatically. It also runs as an MCP server, giving those IDEs live access to your project's conventions, prior decisions, and relevant context through four purpose-built tools.
Quick start
# Install globally
npm install -g contextforge
# In your project root
contextforge initinit does three things in one shot:
Bootstraps
.contextforge/(config, decisions log, MCP server registration)Scans your codebase — detects languages, frameworks, naming conventions, import style, test patterns
Generates
.context.md+ the IDE-specific file for your detected editor
When run interactively, init walks you through three prompts:
IDE selection — choose from the supported list if
--ideis not passedSlash command templates — apply all five templates to your IDE's command directory
.gitignore— add all generated files (.contextforge/,.mcp.json, IDE files) to.gitignore
To skip prompts in CI or scripts, use flags directly:
contextforge init --ide claude-code --templates --gitignoreRelated MCP server: Carto MCP Server
CLI commands
Command | Description |
| Full bootstrap + scan + generate. Prompts interactively to apply templates and add to |
| Start the MCP stdio server (used by IDE MCP integrations). |
| Show context freshness, last updated, detected IDE, and section list. |
| Re-write the IDE-specific file from the existing |
| Health check: context freshness, IDE file, sections, contested conventions, templates. |
| List the five built-in slash command templates. |
| Write a slash command template to the IDE-specific directory. |
IDE targets
claude-code · cursor · windsurf · vscode · antigravity · bob
MCP server setup
The MCP server exposes four tools that let your AI assistant pull live project context during a conversation.
Claude Code
contextforge init writes .mcp.json at your project root automatically. You can also add it manually:
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": ["-y", "contextforge-mcp"]
}
}
}Cursor
// .cursor/mcp.json
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": ["-y", "contextforge-mcp"]
}
}
}Windsurf
// .windsurf/mcp.json
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": ["-y", "contextforge-mcp"]
}
}
}VS Code (Copilot)
// .vscode/mcp.json
{
"servers": {
"contextforge": {
"command": "npx",
"args": ["-y", "contextforge-mcp"]
}
}
}Antigravity
// .antigravity/mcp.json
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": ["-y", "contextforge-mcp"]
}
}
}Bob
// .bob/mcp.json
{
"mcpServers": {
"contextforge": {
"command": "npx",
"args": ["-y", "contextforge-mcp"]
}
}
}MCP tools
Once the server is running, your AI assistant can call these tools:
Tool | Description |
| Returns all detected conventions with confidence scores. Contested conventions (split codebase) are flagged with ⚠. |
| Searches |
| Wraps a raw prompt with stack context, conventions, prior decisions, and known anti-patterns. |
| Appends an architectural decision to |
Example — enrich a prompt
use the enrich_prompt tool with "add user authentication"The assistant receives the raw prompt augmented with your stack, detected conventions (e.g. "camelCase functions, named imports"), prior decisions (e.g. "chose JWT over sessions"), and anti-patterns to avoid.
Slash command templates
ContextForge ships five built-in templates for common AI workflows. Apply them once and they appear as slash commands in your IDE:
Template | What it does |
| Calls |
| Root-cause workflow, checks decisions log, requires regression test |
| Maps blast radius, checks contested conventions, logs decision |
| Convention-aware code review checklist |
| Structured deep-dive using live project context |
contextforge templates apply --all --ide claude-code
# Writes to .claude/commands/*.mdHow .context.md works
ContextForge generates six delimited sections:
<!-- contextforge:stack:start hash="a1b2c3d4" -->
## Stack
...
<!-- contextforge:stack:end -->The hash covers the inputs that produced each section. On the next init, only sections whose inputs changed are rewritten — manual content you add inside <!-- contextforge:manual:start/end --> blocks is never touched.
IDE-specific files
The same content is stripped of delimiters and written to the IDE's native instruction file:
IDE | File |
Claude Code |
|
Cursor |
|
Windsurf |
|
VS Code |
|
Antigravity |
|
Bob |
|
What gets detected
Languages: TypeScript · JavaScript · Python · Go · Rust · PHP · Ruby
Frameworks: React · Next.js · Express · NestJS · Vue · Svelte · FastAPI · Django · Flask · Gin · Echo · Actix · Axum · Laravel · Symfony · Rails · Sinatra
Conventions (via tree-sitter AST):
Function, class, variable, constant naming (camelCase / snake_case / PascalCase / SCREAMING_SNAKE)
Import style (named / default / namespace)
Export style
Test file patterns and framework
Conventions include a confidence score (% of files using that pattern) and are flagged as contested when the codebase is split (< 60% majority). Contested conventions show the minority locations to help you decide which way to align.
Docker
Run the MCP server in a container, mounting your project at /project:
docker build -t contextforge-mcp .
docker run --rm -i \
-v /path/to/your/project:/project \
-e PROJECT_ROOT=/project \
contextforge-mcpThe container communicates over stdio — no port is exposed.
Monorepo structure
packages/
scanner/ — project detection + AST-based convention analysis (tree-sitter)
watcher/ — chokidar-based FS watcher, classifies meaningful changes
generator/ — .context.md renderer + patcher + IDE file writer
bootstrapper/ — one-time setup (.contextforge/, MCP config)
mcp/ — MCP server + pipeline (full + incremental)
cli/ — contextforge binary (init, serve, status, switch, audit, templates)Dependency order: scanner ← generator ← bootstrapper, mcp ← cli
Development
# Install dependencies
pnpm install
# Build all packages (dependency order maintained by pnpm -r)
pnpm build
# Run all tests
pnpm test
# Watch a specific package
cd packages/scanner && pnpm devRunning tests for a single package
cd packages/cli && pnpm exec vitest runCI
GitHub Actions runs on every push to main and on all PRs:
Test job — Node 20 + 22 matrix, frozen-lockfile install, build, test
Docker job — builds the image (no push) after tests pass
Publish job — triggers on
v*tags, publishes all packages to npm
Architecture notes
Incremental pipeline — The watcher classifies file changes into four categories (dependency-manifest, config, schema, new-directory). On a change, the pipeline re-scans only the affected LanguageContext and patches only the changed sections in .context.md, leaving unaffected sections and manual blocks intact.
WASM tree-sitter — Native tree-sitter bindings are unavailable on some platforms (e.g. darwin/x64 + Node 22). ContextForge uses web-tree-sitter (WASM) exclusively for portability. The parser pool is a singleton that initialises once and reuses grammar parsers across files.
Convention confidence — Each detected pattern carries count/total confidence. Patterns below 60% confidence are marked contested: true and their minority locations are recorded. This surfaces mid-migration codebases where two styles coexist.
Decision store — .contextforge/decisions.jsonl is append-only JSONL. The log_decision MCP tool writes to it; get_relevant_context searches it alongside .context.md.
Manual blocks — Sections wrapped in <!-- contextforge:manual:start/end --> are extracted before patching and re-inserted after. The patcher tracks their byte offsets and never writes inside them, regardless of what content they contain (including fake section tags).
Contributing
Contributions are welcome. Please read CONTRIBUTING.md for the full workflow — fork, clone, add upstream, open an issue, branch, write tests, and open a PR.
See also: Code of Conduct · Security Policy
Contributors
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- 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
- Alicense-qualityBmaintenanceEnables AI coding tools to query your live codebase for routes, import graph, domain context, and blast radius, eliminating hallucinations about project structure.29071MIT
- Alicense-qualityAmaintenanceProvides LLMs with code intelligence tools like relationship explanation, PR impact analysis, and health reports via the Model Context Protocol.1MIT
- Alicense-qualityCmaintenanceEnables AI coding agents to retrieve and manage code context with hybrid search, project memory, and observability via MCP tools.29MIT
Related MCP Connectors
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Git-backed platform for skills, tools, and context for AI agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/beethovkjfe/contextforge-cli'
If you have feedback or need assistance with the MCP directory API, please join our Discord server