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

6

Forks

0

Issues

0

README
πŸ“„ 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 (FastAPI route parsing)
  • Dependency tracking (imports, method calls)
πŸ“š Documentation Generation
  • README.md with version and usage info
  • API_DOCS.md with detailed function/class docs
  • Setup guides and code examples
  • Automatically generated structure diagram (structure_diagram.png)
πŸ’¬ Interactive Help
  • CLI Bot: Run python main.py to 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.md
  • generated_docs/README.md
  • generated_docs/structure_diagram.png
  • logs/conversation_log.json

πŸ–₯️ Streamlit App
streamlit run app.py
  • Upload your .py files 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 exit to close the CLI assistant
  • Logs are saved in logs/conversation_log.txt and .json

🧠 How It Works
  1. Parses the AST (Abstract Syntax Tree) of Python files
  2. Extracts metadata (name, args, docstrings, decorators)
  3. Generates Markdown documentation
  4. Builds an interactive Q&A system from parsed data
  5. 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

Author Information

0

Followers

0

Repositories

0

Gists

0

Total Contributions