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
π 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 infoAPI_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
- 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
0
Followers
0
Repositories
0
Gists
0
Total Contributions