CodeDoc MCP Server
Provides security scanning for hardcoded secrets and API keys to prevent leaks before pushing to GitHub, and supports commit integration for automatic documentation updates.
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., "@CodeDoc MCP Server scan my uncommitted changes for secrets before I push"
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.
🛡️ CodeDoc MCP Server
CodeDoc is an AI-powered "Project Guardian" built for Cursor and Claude. CodeDoc is a high-performance architectural sentinel that transforms Cursor into a Project Architect by enforcing security, structural integrity, and production-grade code quality across your entire codebase. Unlike general AI coding assistants, CodeDoc is a context-aware engine designed to enforce structural integrity, SOLID principles, and clean code standards directly within your local environment. CodeDoc goes beyond simple code generation. It acts as a "Guardian" for your project, ensuring that every refactor is secure, every change is understood across the "Radius," and every line of code meets industry-standard health metrics.
🚀 Why CodeDoc?
Invisible Automation: Works seamlessly within Cursor or Claude Desktop.
PR-Ready Audits: Catches SQL Injections, Race Conditions, and Resource Leaks.
Context-Aware: Reads local files directly from your workspace—no more copy-pasting.
Smart Filtering: Automatically ignores
node_modules,.env, and binary files.
Related MCP server: vibelogic
⚖️ How CodeDoc is Different
While standard AI chat can explain code, CodeDoc is built for a professional "Review-First" workflow. It bridges the gap between temporary chat conversations and permanent repository health.
🛡️ The "Certified Push" Workflow
CodeDoc is the only tool that bridges the gap between Code Execution and Compliance.
The Challenge: Cursor suggests code, but does it follow your team's specific naming conventions? Does it avoid nested loops?
The Solution: With CodeDoc Phase 2, you provide your Development Manifesto. CodeDoc then audits your staged files against those specific rules, refactors the logic, and documents the changes in one step.
It doesn't just write code; it enforces your standards.
Feature | Standard AI Chat | CodeDoc MCP |
Persistence | Lost when chat is cleared | Permanent in |
Context | Limited to open tabs | Scans entire project structure |
Workflow | Reactive (answering questions) | Proactive (pre-commit style auditing) |
Output | Raw text in chat window | Professional, version-controlled Markdown |
System Awareness | No local file access | Reads & Writes directly to your workspace |
🚀 The Guardian Pipeline
CodeDoc doesn't just write code; it follows a professional safety-first workflow:
Security Scan: Detects hardcoded secrets or API keys before they leak to GitHub.
Impact Analysis: Maps the ripple effect of your changes across the entire project.
Health Audit: Scores your code (1-10) based on SOLID, OOPS, and maintainability.
Certified Refactor: Generates production-ready optimizations with a native side-by-side Diff view.
🚀 Features
Smart Documentation
Automatic Docs: Generates technical documentation for any file.
Structure Scanning: Maps out project files and dependencies.
Guardian Refactoring
Refactor & Optimize: Targeted refactoring using SOLID and OOPS principles.
Smart Pathing: Finds
Middleware.javaeven if it's buried insrc/main/resources/internal/.Custom Rule Injection: Allows users to pass specific team standards (e.g., "Use Tailwind for styles").
Security Sentinel (Project-Wide)
Stop leaks before they happen. CodeDoc scans uncommitted files or specific folders for API keys, tokens, and vulnerabilities.
Prompt: "codedoc, scan my uncommitted changes for secrets before I push."
Impact Analyzer (The Blast Radius)
Understand the ripple effect of your changes. It identifies exactly which files and line numbers will break when you modify a function signature or rename a variable.
Prompt: "What happens if I change the 'fetchData' argument to an object in apiService.ts?"
Architecture Scorecard
Get an instant audit of your code health. CodeDoc provides a 1-10 score, breaks down complexity, and identifies architectural debt.
Prompt: "Give me a health score for login.tsx and provide the optimised code based on the health."
Smart Project Awareness
Language-agnostic support for Java, TypeScript, Python, C++, C#, and more. CodeDoc intelligently prunes node_modules and heavy folders to provide lightning-fast results without freezing your system.
Future Roadmap
🚀 Smart Refactoring: Automated suggestions to simplify complex logic.
⚡ Performance Optimization: Identifying and fixing $O(n^2)$ bottlenecks. User can ask for the code optimisation and bugfree code before final push to production.[in progress].
🔒 Secret Detection: Scanning for leaked API keys or hardcoded credentials.
📈 Commit Integration: Automatically updating docs on every local commit.
🛠️ Installation
To add the Guardian Engine to your Cursor IDE:
Open Cursor Settings (
Cmd+Shift+JorCtrl+Shift+J).Go to Features > MCP.
Click + Add New MCP Server.
Paste the following:
{
"mcpServers": {
"codedoc": {
"command": "uvx",
"args": [
"--refresh",
"--from",
"git+[https://github.com/akshay1018/mcp-codedoc.git](https://github.com/akshay1018/mcp-codedoc.git)",
"codedoc"
]
}
}
}
📖 How to Use (The Guide)
Once installed, you don't need to learn any special commands. Just talk to the AI in your sidebar.
The "Auto-Refactor" Prompt
"@codedoc scan and refactor Login.tsx using SOLID principles. Extract logic into a service file."
The "Project Map" Prompt
"@codedoc scan project files and identify any files missing documentation."
The "Clean Push" Prompt
"@codedoc refactor Middleware.java for better performance before I push to main."
📂 Understanding the Output
Every time you run a documentation task, CodeDoc creates a folder named /documentation in your project root.
Plaintext
your-project/
├── documentation/
│ ├── documentation_snippet_20251227_010000.md <-- Your Report
├── # other filesWhat's inside the report?
Each .md file generated includes:
Technical Documentation: Overview, Parameters, and Return Values.
Quality Audit: The most important section. This lists potential bugs, security risks, and performance bottlenecks.
Source Code: A timestamped reference of the code that was audited.
🤝 Contributing & Support
If you encounter any issues or have feature requests, please open an issue on the GitHub Repository.
License: MIT
Available Tools
10 toolsapply_syncB
Generates and applies code patches to heal broken call-sites across the project.
Args: symbol_name: The function/class name that was changed. change_type: 'RENAME', 'PARAM_ADDED', or 'STRUCT_CHANGE'. metadata: Dictionary containing 'new_name' or 'new_params'.
Inputs: metadata (required), change_type (required), symbol_name (required). Returns: result
evaluate_and_refactorC
Language-agnostic --- health audit AND generates optimized code.
Inputs: file_path (required), custom_rules. Returns: result
generate_smart_docD
Universal tool for documentation and audits.
file_path: Path to local file.
code_snippet: Pasted code from chat.
Inputs: doc_content (required), audit_results (required), language, file_path, +1 more. Returns: result
global_security_auditA
Scans the ENTIRE project for secrets, keys, and vulnerabilities. Use this before pushing code to GitHub/GitLab.
Inputs: no named parameters. Returns: result
guardian_scanA
Versatile security scanner.
If scan_uncommitted is True: Scans only changed files in Git.
If target_path is provided: Scans that specific file or folder.
Default: Scans current working directory.
Inputs: target_path, scan_uncommitted. Returns: result
heal_dependency_callsA
Finds and proposes updates for all files calling a modified symbol.
Args: symbol_name: The name of the function or class that was modified. file_path: The source file where the change originated. change_type: e.g., 'RENAME', 'PARAM_ADDED', 'PARAM_REMOVED'.
Inputs: file_path (required), change_type (required), symbol_name (required). Returns: result
inspect_contract_changeA
Analyzes uncommitted changes to identify modified 'Contracts' (function signatures, class names, etc.) that require Sync.
Inputs: no named parameters. Returns: result
predict_impactA
Analyzes the impact of changing a specific symbol (variable, function, or class). If no symbol is provided, it analyzes dependencies on the file itself.
Inputs: file_path (required), symbol. Returns: result
refactor_and_optimizeC
Refactors and optimizes code. Handles case-insensitivity and deep path discovery.
Inputs: file_path (required), custom_rules. Returns: result
scan_project_filesA
Returns a list of all documentable source files in the current project root.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Multiple tools have overlapping purposes: refactor_and_optimize and evaluate_and_refactor both refactor/optimize code, while global_security_audit and guardian_scan both perform security scanning. generate_smart_doc is described as 'universal' and could be mistaken for an audit tool, adding confusion.
Naming conventions are mixed: some tools use verb_noun (scan_project_files, predict_impact), some use verb_and_verb (refactor_and_optimize, evaluate_and_refactor), and others use arbitrary adjectives (guardian_scan, generate_smart_doc). This inconsistency makes it harder to predict tool behavior from the name.
The count of 10 is within a reasonable range, but several tools serve nearly identical functions (two refactoring tools, two security scanners), suggesting the set is not well-scoped and redundant tools could be consolidated.
The server covers multiple areas (documentation, refactoring, security, impact analysis, dependency healing), but the name 'CodeDoc' suggests a focus on documentation, which is only represented by one broad tool. Missing features like updating existing documentation or verifying code post-refactor create notable gaps.
Maintenance
Related MCP Connectors
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Enforces architectural invariants and code quality rules inside your AI agent's edit loop.
Your AI mind directs coding agents; work reviewed against your memories: Claude Code, Codex, Cursor
Audit and write CLAUDE.md / AGENTS.md / Cursor rules; generate full build specs for new projects.
Related MCP Servers
- FlicenseAqualityCmaintenanceEnforces disciplined programming practices by requiring AI assistants to audit their work and produce verified outputs at each phase of development, following structured workflows for refactoring, feature development, and testing.2012-
- AlicenseAqualityDmaintenanceA deterministic architecture audit engine for Cursor. It enforces visual Mermaid protocols to prevent LLM hallucinations, ensuring AI modifies code based on strict blueprints.1MIT
- FlicenseAqualityAmaintenanceAI-powered continuous code assistant for Cursor, VS Code, Antigravity, and Claude Code via MCP, providing tools for code review, testing, documentation, and quality analysis.81-
- AlicenseNot gradedqualityBmaintenanceOrchestrates Claude Code and OpenAI Codex to plan, implement, review, and verify code changes via pull requests with security controls.MIT