Open-source Swagger/OpenAPI Generator – Automatically analyze your codebase and generate accurate, always up-to-date API documentation.
Save time, improve API visibility, and keep docs in sync with your source code.
Swagger Generator is an open-source tool that:
- Scans your codebase automatically.
- Detects REST API endpoints.
- Generates Swagger/OpenAPI specifications (
swagger.json).
It removes the need for manual API documentation and ensures your API docs stay accurate, searchable, and developer-friendly.
- 🔍 Code Analysis → Auto-discovers REST APIs from your code.
- 📄 Swagger/OpenAPI Docs → Instantly generates spec files (
swagger.json). - 🌍 Language Agnostic → Works with popular frameworks & languages.
- ⚡ Developer Friendly → Lightweight, fast setup, fully open-source.
- 📈 SEO & Visibility → Great for publishing public API docs with Swagger UI.
- ⏱️ Eliminate manual documentation → No more writing Swagger files by hand.
- 🔄 Keep docs always in sync → Docs auto-update with your codebase.
- 👨💻 Improve onboarding → Easier for developers, clients, and external users.
- 🛠️ Integrate with Swagger UI → Interactive API documentation out of the box.
- ✅ Ideal for → Startups, open-source projects, and enterprise teams managing APIs.
You can set up Swagger Generator in two ways:
curl -sSL https://raw.githubusercontent.com/qodex-ai/swagger-generator/refs/heads/main/run.sh -o script.sh \
&& chmod +x script.sh \
&& ./script.sh --repo-path {repo_path} --project-api-key {project_api_key} --ai-chat-id {ai_chat_id}Flags
--repo-path → Local path where the repo should be cloned / used
--project-api-key → Your project API key
--ai-chat-id → Target AI chat ID
Download the MCP server file
wget https://github.com/qodex-ai/swagger-generator/blob/ankit/swagger_mcp.py -O swagger_mcp.pyAdd this to your MCP settings
{
"mcpServers": {
"swagger-generator": {
"command": "uv",
"args": ["run", "/path/to/swagger_mcp/swagger_mcp.py"]
}
}
}Replace /path/to/swagger_mcp/swagger_mcp.py with the actual file path.
📄 Once complete, you’ll find a generated swagger.json in your repo path — ready to use with Swagger UI, OpenAPI tools, or API gateways.
Requires Python 3.9+ and uv.
Works on Linux, macOS, and Windows (via WSL).
Lightweight, no heavy dependencies.
Contributions are welcome!
Open an issue for bugs, feature requests, or improvements.
Submit PRs to enhance language/framework coverage.
Help us make API documentation automatic and effortless 🚀