ctx-gen-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., "@ctx-gen-mcpgenerate L0-L3 context docs for this project"
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.
ctx-gen-mcp
Code context description generator — MCP Server + OpenCode plugin for progressive AI-friendly docs.
What It Does
Generates progressive-disclosure code context docs (L0/L1/L2/L3) for large projects, so AI coding agents can understand your codebase without eating their entire context window.
L0: One-liner — what does this project do?
L1: Module map — which modules exist, what do they do?
L2: Per-module detail — full context for ONE module
L3: Architecture decisions — WHY was it built this way?
Related MCP server: MCP Prompt Enhancer
One-Click Install
# 1. Install the pip package
pip install ctx-gen-mcp
# 2. Run one-click setup (installs skill + agent + MCP config)
ctx-gen-setupThat's it. OpenCode will now have:
A
ctx-genskill (loadable via/ctx-gen)A
ctx-genagent (switchable in agent panel)MCP server config in
opencode.jsonAGENTS.mdin your project root
Usage
In OpenCode (recommended)
Open your project in OpenCode
Say:
"use the ctx-gen skill to generate context for this project"Or switch to the
ctx-genagent in the agent panelThe agent will: scan → generate per-module JSON → validate → assemble MD docs
MCP Tools (any MCP-compatible agent)
The package exposes 3 deterministic MCP tools:
Tool | What it does |
| Deterministic repo scan — no LLM needed |
| Check all modules have context, detect stale ones |
| Merge per-module JSONs into progressive MD docs |
CLI
# Run MCP server directly (for testing)
ctx-gen-server
# Or:
python -m ctx_gen_mcp.server
# Re-run setup (e.g. after moving project)
ctx-gen-setup --project-dir /path/to/project
# Install globally (all projects)
ctx-gen-setup --global
# Uninstall
ctx-gen-setup --uninstallOutput
After running, you'll have:
.ctx-cache/
skeleton.json # repo structure (deterministic)
ctx/
<module_id>.json # per-module structured context
docs/
PROJECT_CONTEXT.md # L0 + L1 + L3 (main doc)
modules/
<module_id>.md # L2 (per-module detail)Add these to .gitignore:
.ctx-cache/
docs/PROJECT_CONTEXT.md
docs/modules/Requirements
Python >= 3.10
OpenCode >= 1.0 (for skill/agent support)
Or any MCP-compatible agent (Claude Code, etc.)
How It Works
The core insight: separate deterministic operations from LLM operations.
Operation | Who does it | Why |
Repo scanning |
| Glob + regex never hallucinates |
Per-module description | LLM (via Agent) | Needs semantic understanding |
Coverage validation |
| Hash comparison is exact |
MD assembly |
| Template filling, no creativity needed |
This separation is what makes the output stable and coverage-guaranteed.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/liubinmaster/ctx-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server