Clones and analyzes Bitbucket repositories to generate Postman collections and business insights from API codebases. Requires Bitbucket username and app password for repository access.
Clones and analyzes GitHub repositories to generate Postman collections and business insights from API codebases. Supports private repositories with personal access token authentication.
Integrates with OpenAI ChatGPT and Deep Research through SSE transport, providing tools for repository search, document fetching, and code analysis for AI-powered insights.
Generates Postman v2.1 collection files from analyzed API codebases, including endpoints, parameters, authentication, and response examples organized by tags or path segments.
Codebase Insights MCP Server
An MCP (Model Context Protocol) server that provides comprehensive codebase analysis, API documentation, Postman collection generation, and business insights. Analyzes API codebases to generate Postman collections, Product Owner reports, and detailed code insights. Supports multiple frameworks including FastAPI, Spring Boot, Flask, Express, and any codebase with OpenAPI/Swagger specifications.
Features
🚀 Multi-Framework Support: FastAPI, Spring Boot, Flask, Express, NestJS
📋 OpenAPI/Swagger First: Automatically detects and uses OpenAPI specs when available
🔍 Smart Code Analysis: Falls back to AST/pattern matching when no spec is found
🔐 Authentication Support: Handles Bearer, Basic, and API Key authentication
📁 Organized Output: Groups endpoints by tags or path segments
🎯 Accurate Detection: Extracts request bodies, parameters, and response examples
🤖 OpenAI ChatGPT Integration: SSE transport support for ChatGPT Connectors and Deep Research
🔌 Multiple Transport Modes: stdio (local), HTTP (testing), SSE (OpenAI integration)
Installation
For End Users (via uvx)
The easiest way to use this MCP server is with uvx:
For Development
Configuration
Claude Desktop Configuration
Add this to your Claude Desktop configuration file:
For uvx installation (recommended):
For local development:
Environment Variables
BITBUCKET_EMAIL: Your Bitbucket username (not email)BITBUCKET_API_TOKEN: Bitbucket app password with repository read accessGITHUB_TOKEN: GitHub personal access token (for private repos)output_directory: Where to save generated Postman collections (default: current directory)
Usage
Once configured, you can use the following commands in Claude:
The server will:
Clone the repository
Detect the framework and analyze the codebase
Extract all API endpoints with their parameters and examples
Generate a Postman v2.1 collection file
Save it to your output directory
Supported Frameworks
With Full Support
FastAPI (Python) - Full OpenAPI integration
Spring Boot (Java) - Annotation-based detection
Express (Node.js) - Route pattern matching
Flask (Python) - Decorator-based detection
Django REST (Python) - ViewSet and path detection
Coming Soon
NestJS (TypeScript)
Ruby on Rails
ASP.NET Core
Publishing Updates to PyPI
One-Time Setup
Publishing Updates Workflow
Update Version
# Update version in pyproject.toml poetry version patch # for bug fixes (0.1.0 -> 0.1.1) poetry version minor # for new features (0.1.0 -> 0.2.0) poetry version major # for breaking changes (0.1.0 -> 1.0.0)Build Package
poetry buildPublish to PyPI
poetry publishTest Installation
# Test the published package uvx --reinstall codebase-insights-mcp
Automated Version Workflow
Users Update with uvx
After publishing, users can update with:
Development
Running Tests
Code Quality
Local Testing with MCP Inspector
Option 1: Test Published Version (HTTP)
Option 2: Test Development Version (HTTP)
Testing SSE Transport (OpenAI ChatGPT Integration)
The SSE transport is required for OpenAI ChatGPT Connectors and Deep Research integration.
Local SSE Testing
Option 1: Test Published Version with SSE
Option 2: Test Development Version with SSE
Testing with OpenAI API
Once your SSE server is running and publicly accessible, test it with OpenAI:
Available Tools for OpenAI Integration
The following tools are available when using SSE transport with OpenAI:
search- Search for repositories and code (required by OpenAI ChatGPT Connectors){ "query": "FastAPI authentication" }fetch- Fetch full document content by ID (required by OpenAI ChatGPT Connectors){ "id": "doc-123" }generate_collection- Generate Postman collections from repositories{ "repo_url": "https://github.com/user/repo.git" }generate_product_owner_overview- Generate business analysis reports{ "repo_url": "https://github.com/user/repo.git" }analyze_repository_for_llm- Clone and return code for LLM analysis{ "repo_url": "https://github.com/user/repo.git", "max_files": 50 }
Transport Modes Comparison
Transport | Use Case | Endpoint | Tools Available |
stdio | Local CLI (Claude Desktop, Claude Code) | N/A (stdin/stdout) | All tools |
HTTP | Development, MCP Inspector testing |
| All tools |
SSE | OpenAI ChatGPT integration, Deep Research |
| All tools (especially |
When to use each transport:
stdio: Default for local MCP clients like Claude Desktop
HTTP: Best for testing with MCP Inspector during development
SSE: Required for OpenAI ChatGPT Connectors and Deep Research features
Using the Test Scripts
Interactive MCP Inspector Testing:
Automated HTTP API Testing:
Testing with MCP Inspector
Open MCP Inspector or run locally
Enter URL:
http://localhost:8000/mcpClick Connect
Test tools:
generate_collectionwith:{"repo_url": "https://bitbucket.org/tymerepos/tb-payshap-svc.git"}get_server_infowith:{}
STDIO
Command /bin/bash
Arguments -c "cd '/Users/lukelanterme/Documents/Code/Personal/AI/Projects/codebase-insights-mcp' && poetry run codebase-insights-mcp"
export BITBUCKET_EMAIL="your-username" export BITBUCKET_API_TOKEN="your-app-password" export output_directory="/tmp/"
Architecture
The server follows clean architecture principles:
Models: Pydantic models for API endpoints and Postman collections
Analyzers: Framework-specific endpoint extraction logic
Generators: Postman collection generation from API models
Clients: Git repository access with authentication support
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT License - see LICENSE file for details
Acknowledgments
Built with FastMCP framework
Inspired by API development workflows and the need for automation