Smart Docs
STDIOMCP server for intelligent codebase analysis and comprehensive documentation generation
MCP server for intelligent codebase analysis and comprehensive documentation generation
A production-ready Model Context Protocol (MCP) server that intelligently analyzes codebases and generates comprehensive documentation. Built with TypeScript and tree-sitter for accurate code parsing.
npm install npm run build
Add to your MCP client configuration (Claude Desktop):
Windows: %APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "smart-docs": { "command": "node", "args": ["C:\\ProjectFolder\\dist\\index.js"] } } }
Then restart Claude Desktop.
analyze_codebaseAnalyze a codebase or file to extract code elements and calculate documentation coverage.
Input:
{ "path": "/path/to/your/codebase" }
Output:
generate_documentationGenerate comprehensive markdown documentation for a codebase.
Input:
{ "path": "/path/to/your/codebase", "format": "markdown" }
Output:
detect_missing_docsDetect code elements missing documentation with severity classification.
Input:
{ "path": "/path/to/your/codebase", "minSeverity": "critical" }
Severity Levels:
Output:
suggest_improvementsAnalyze existing documentation and suggest improvements.
Input:
{ "path": "/path/to/your/codebase", "limit": 20 }
Output:
smart-docs-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── types/
│ │ └── index.ts # TypeScript types and interfaces
│ ├── parsers/
│ │ ├── base-parser.ts # Abstract parser base class
│ │ ├── typescript-parser.ts # TypeScript/JavaScript parser
│ │ └── python-parser.ts # Python parser
│ ├── analyzers/
│ │ ├── codebase-analyzer.ts # Main analysis engine
│ │ └── doc-detector.ts # Missing documentation detector
│ ├── generators/
│ │ ├── markdown-generator.ts # Markdown doc generator
│ │ └── improvement-suggester.ts # Improvement suggestions
│ ├── tools/
│ │ ├── analyze-codebase.ts
│ │ ├── generate-documentation.ts
│ │ ├── detect-missing-docs.ts
│ │ └── suggest-improvements.ts
│ └── utils/
│ └── file-utils.ts # File system utilities
├── package.json
├── tsconfig.json
└── README.md
The server uses intelligent severity classification:
All tools include comprehensive error handling:
# Install dependencies npm install # Build the project npm run build # Watch mode for development npm run watch # Run the server npm start
@modelcontextprotocol/sdk: MCP protocol implementationtree-sitter: Code parsing enginetree-sitter-typescript: TypeScript/JavaScript grammartree-sitter-python: Python grammarzod: Schema validationA test project is included in the test-project/ directory with sample files demonstrating various documentation scenarios.
MIT
Contributions are welcome! Please ensure: