mcp-doc-bot
An AI-powered documentation assistant that scans Python codebases to auto-generate clean, structured documentation. It supports both CLI and Streamlit UI, providing API mappings, code samples, flow diagrams, version tracking, and best-practice tips — all with one click.
GitHub Stars
0
User Rating
Not Rated
Favorites
0
Views
31
Forks
0
Issues
0
📄 MCP Documentation Bot
MCP Documentation Bot is an intelligent assistant that automatically parses Python codebases, generates developer-friendly documentation (like README and API docs), visualizes code structure with diagrams, and answers user queries through an interactive bot or Streamlit UI.
🚀 Features
🔍 Code Analysis
- Full repository scanning
- Function and class documentation extraction
- API endpoint detection (
FastAPIroute parsing) - Dependency tracking (imports, method calls)
📚 Documentation Generation
README.mdwith version and usage infoAPI_DOCS.mdwith detailed function/class docs- Setup guides and code examples
- Automatically generated structure diagram (
structure_diagram.png)
💬 Interactive Help
- CLI Bot: Run
python main.pyto ask about code from terminal - Streamlit UI: Upload files and interact visually
- Usage examples, best practice feedback, and troubleshooting info
✅ Best Practices
- Heuristic-based analysis to detect missing docstrings or bad practices
- JSON-based feedback for improvements
🎁 Bonus Features
- 📊 Diagram Generation (Flowchart of code structure)
- 🔖 Version Tracking (Auto-included in README)
🧪 Example Output
generated_docs/API_DOCS.mdgenerated_docs/README.mdgenerated_docs/structure_diagram.pnglogs/conversation_log.json
🖥️ Streamlit App
streamlit run app.py
- Upload your
.pyfiles from the sidebar - View auto-generated docs
- Ask the bot questions about your codebase
- Visualize and download the structure diagram
🖱️ CLI Bot
python main.py
- Type function or class names to get instant documentation
- Type
exitto close the CLI assistant - Logs are saved in
logs/conversation_log.txtand.json
🧠 How It Works
- Parses the AST (Abstract Syntax Tree) of Python files
- Extracts metadata (name, args, docstrings, decorators)
- Generates Markdown documentation
- Builds an interactive Q&A system from parsed data
- Optionally generates a class-function-method diagram
📦 Installation
git clone https://github.com/SS-Hossain/mcp-doc-bot.git
cd mcp-doc-bot
pip install -r requirements.txt
🛠️ Tech Stack
- Python 3.8+
- Streamlit
- AST module
- Graphviz (for diagram generation)
- JSON, Markdown, OS libraries
📁 Folder Structure
mcp-doc-bot/
├── example_project/ # Sample code to test
├── generated_docs/ # Output docs + diagram
├── logs/ # Bot conversation logs
├── uploaded_project/ # Uploaded files via Streamlit
├── app.py # Streamlit UI
├── main.py # CLI assistant
├── code_parser.py # AST-based parser
├── doc_generator.py # README + API docs
├── diagram_generator.py # Structure diagram
├── interactive_bot.py # Terminal Q&A bot
├── version.py # Version control
└── requirements.txt
📌 Version
Current release: v1.0.0
📜 License
This project is licensed under the MIT License.
🤝 Contributing
Pull requests are welcome! Feel free to open issues or suggest features.
👨💻 Author
Made with ❤️ by SK Shaid Hossain