ctx-gen-mcp
This server provides tools to generate, validate, and assemble a navigable, AI-friendly code wiki for large projects:
Scan a code repository (
scan_skeleton): Analyze a project directory to produce a deterministic module skeleton, including domain groupings, tags, dependency graphs, and file/line statistics.Validate documentation coverage (
validate_coverage): Check that every discovered module has a corresponding generated context JSON, report coverage percentage, list missing modules, and detect stale modules whose source code has changed since last generation.Assemble wiki documentation (
assemble_docs): Compile all per-module JSON context files into a structured, progressive-disclosure Markdown wiki — producing a mainINDEX.mdentry point and individual cross-linked.wiki.mdpages per module, organized by domain.
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 wiki generator -- MCP Server + OpenCode plugin for navigable, progressive-disclosure code docs with domain grouping, tags, and dependency graph.
What It Does
Generates a navigable Code Wiki for large projects, so AI coding agents can quickly locate and understand any module without reading the entire codebase.
Instead of dumping flat documentation, ctx-gen produces:
INDEX.md -- single entry point with domain table, tag index, and module list
Cross-linked wiki pages -- each module has its own
.wiki.mdwith YAML front-matter, summary, dependency links, and detailed contentDomain grouping -- modules auto-grouped by directory structure
Tag-based lookup -- find modules by language, architecture level, tech feature
Dependency graph -- shallow
#include/importanalysis with cross-links
Related MCP server: MCP Prompt Enhancer
Progressive Disclosure
The wiki is designed so AI agents read the minimum to locate what they need:
INDEX.md (~50-100 lines) -- scan domains and tags
lookup MCP tool -- find modules by keyword without reading the INDEX
Module wiki page -- full context for one module with cross-links to related modules
Follow links --
Depends:/Used by:links for impact analysis
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 wiki"Or switch to the
ctx-genagent in the agent panelThe agent will: scan -> generate per-module JSON -> validate -> assemble wiki
MCP Tools (any MCP-compatible agent)
The package exposes 4 deterministic MCP tools:
Tool | What it does |
| Scan repo -> skeleton with domains, tags, dependency graph |
| Find modules by tag/domain/keyword (no need to read full INDEX) |
| Check all modules have context, detect stale ones |
| Build wiki INDEX.md + cross-linked .wiki.md pages |
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 with domains/tags/deps (deterministic)
ctx/
<module_id>.json # per-module structured context
docs/
wiki/
INDEX.md # single entry point
domains/
<domain>/
<module>.wiki.md # cross-linked per-module wiki pageAdd these to .gitignore:
.ctx-cache/
docs/wiki/Architecture
Core Insight: Separate Deterministic from LLM Operations
Operation | Who does it | Why |
Repo scanning + domain grouping |
| Glob + regex never hallucinates |
Module lookup by tag/keyword |
| String matching is exact |
Per-module description | LLM (via Agent) | Needs semantic understanding |
Coverage validation |
| Hash comparison is exact |
Wiki assembly |
| Template + cross-link generation |
Domain Grouping (Hybrid Strategy)
Directory-based first:
src/engine/-> domain "engine"If a domain has >10 modules, flagged for potential LLM subdivision
Domains are reflected in the output directory structure
Tag Inference (Automatic)
Tags are inferred from file names, directory names, and shallow content analysis:
Dimension | Examples | Detection Method |
Language |
| File extension statistics |
Architecture |
| Filename + content keywords |
Tech feature |
| Filename + content keywords |
Build target |
| Build system analysis |
Dependency Detection (Shallow)
Only direct #include, import, require statements are analyzed.
This covers ~80% of real dependencies with zero parser overhead.
Requirements
Python >= 3.10
OpenCode >= 1.0 (for skill/agent support)
Or any MCP-compatible agent (Claude Code, etc.)
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
- 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/liubinmaster/ctx-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server