openapi-spec-master
v2.0.0
Published
π Professional OpenAPI specification analyzer and MCP server. The ultimate toolkit for API developers with VS Code extension integration.
Maintainers
Readme
π OpenAPI Spec Master
The ultimate OpenAPI specification toolkit for professional developers
A powerful, professional-grade OpenAPI specification analyzer with advanced AI integration via Model Context Protocol (MCP). Features comprehensive API analysis, code generation, and seamless integration with VS Code extension.
π¦ Available on NPM - Install with npx openapi-spec-master@latest
π VS Code Extension - Professional IDE integration
β¨ Why Choose OpenAPI Spec Master?
- π― Professional Grade: Enterprise-ready with advanced performance optimizations
- π€ AI Integration: Native MCP server for Claude, Cursor, and other AI tools
- β‘ Lightning Fast: Optimized for large specifications with intelligent caching
- π Deep Analysis: 16 powerful tools for comprehensive API insights
- π οΈ Multi-Language: Generate code in TypeScript, JavaScript, Python, cURL, and more
- π Rich Analytics: Advanced filtering, grouping, and visualization capabilities
- π VS Code Integration: Professional extension for seamless development workflow
Features
π Advanced Analysis
- Smart Filtering: Multi-dimensional filtering by methods, tags, complexity, security, and more
- Intelligent Grouping: Organize endpoints by tags, methods, complexity, or path patterns
- Analytics Dashboard: Comprehensive API analytics with distribution charts and insights
- AI Suggestions: Context-aware recommendations for API improvements
π€ MCP Server Integration
- Dual Transport Support: Both stdio and HTTP transport options
- AI Client Connectivity: Connect to Claude Desktop, Cursor, and other MCP-compatible clients
- 16 Powerful Tools: Comprehensive suite for API analysis, development, validation, and optimization
- Advanced Schema Analysis: Deep property searching, dependency tracking, and evolution analysis
- Code Generation: TypeScript types, mock data, and multi-language examples
- Security & Validation: Authentication analysis, example validation, and design recommendations
- Real-time Analysis: Get instant API insights through your AI conversations
- Streaming Support: Server-sent events for real-time updates (HTTP transport)
π Visualization & Export
- Multiple View Modes: List, grid, compact, and table layouts
- Export Options: JSON, PDF, CSV, and Markdown formats
- Dark/Light Theme: Beautiful UI with theme switching
- Responsive Design: Works perfectly on desktop and mobile
Quick Start
π NPX Usage (Recommended)
Get started instantly without installation:
# Show setup instructions
npx openapi-spec-master@latest setup
# Start MCP server (stdio transport)
npx openapi-spec-master@latest mcp
# Start MCP server (HTTP transport)
npx openapi-spec-master@latest mcp --http
# Start web interface (development mode)
npx openapi-spec-master@latest webπ¦ Installation
If you prefer to install globally:
npm install -g openapi-spec-masterπ€ MCP Server Setup
Option A: NPX (Recommended)
Easy one-command setup - no installation required!
Configure Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"openapi-spec-master": {
"command": "npx",
"args": ["openapi-spec-master@latest", "mcp"]
}
}
}For HTTP transport:
{
"mcpServers": {
"openapi-spec-master-http": {
"command": "npx",
"args": ["openapi-spec-master@latest", "mcp", "--http", "--port", "3001"]
}
}
}Option B: Local Development
For development or customization:
- Clone the repository
- Install dependencies:
npm install - Build the servers:
npm run build:all
Configure with local build:
{
"mcpServers": {
"openapi-spec-master": {
"command": "node",
"args": ["path/to/openapi-spec-master/dist/mcp/server.js"]
}
}
}Web Application (Development)
- Clone the repository
- Install dependencies:
npm install - Start the development server:
npm run dev - Open your browser and load an OpenAPI specification
Test the Connection
Test with NPX:
npx openapi-spec-master@latest mcpTest HTTP server:
npx openapi-spec-master@latest mcp --http
# Check health: curl http://localhost:3001/healthHTTP Transport Features
The HTTP transport provides additional capabilities beyond the standard MCP protocol:
RESTful API Endpoints
GET /health- Server health checkPOST /mcp/tools/list- List available MCP toolsPOST /mcp/tools/call- Execute an MCP toolGET /mcp/stream- Server-sent events streamPOST /mcp/execute- Execute tool with optional streamingGET /api/info- Get loaded API informationGET /api/endpoints- Search endpoints directlyGET /docs- API documentation
Streaming Support
# Real-time updates via Server-Sent Events
curl -N http://localhost:3001/mcp/stream
# Streaming tool execution
curl -X POST http://localhost:3001/mcp/execute \
-H "Content-Type: application/json" \
-d '{"tool": "get_api_overview", "args": {}, "stream": true}'Direct API Access
# Load OpenAPI spec
curl -X POST http://localhost:3001/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "load_openapi_spec",
"arguments": {
"source": "https://petstore.swagger.io/v2/swagger.json",
"sourceType": "url"
}
}'
# Search endpoints
curl "http://localhost:3001/api/endpoints?query=user&method=GET&limit=10"MCP Tools Available
Core Functions (4 tools)
load_openapi_spec- Load and parse OpenAPI specifications from multiple sourcesget_api_overview- Get comprehensive API overview and statisticssearch_endpoints- Search and filter endpoints with advanced criteriaget_endpoint_details- Get detailed information about specific endpoints
Development Tools (3 tools)
generate_code_examples- Generate code examples in multiple programming languagesgenerate_typescript_types- Convert OpenAPI schemas to TypeScript interfaces and typesgenerate_mock_data- Generate realistic mock data based on OpenAPI schemas
Analysis & Validation (5 tools)
search_request_body_properties- Deep search through request body schemas for propertiesfind_schema_dependencies- Trace schema references and dependencies throughout the APIvalidate_request_examples- Validate that request/response examples match their schemasget_api_analytics- Comprehensive API analytics and insightsvalidate_api_design- API design validation with recommendations
Security & Optimization (3 tools)
extract_auth_patterns- Analyze authentication and authorization patterns across the APIfind_unused_schemas- Identify schemas that are defined but never referencedanalyze_schema_evolution- Analyze how schemas might evolve and suggest versioning strategies
Documentation (1 tool)
export_documentation- Export API documentation in various formats
π₯ New Advanced Capabilities
The latest version introduces 8 powerful new tools that dramatically expand analysis capabilities:
π Deep Schema Analysis
- Property Search: Find specific properties across all request/response schemas
- Dependency Mapping: Understand how schemas relate and depend on each other
- Evolution Analysis: Assess how schemas might change and plan versioning strategies
π‘οΈ Security & Quality Assurance
- Auth Pattern Analysis: Comprehensive security scheme analysis and recommendations
- Example Validation: Ensure all documented examples actually match their schemas
- Unused Schema Detection: Clean up APIs by finding orphaned schema definitions
β‘ Developer Productivity
- TypeScript Generation: Auto-generate type-safe interfaces from OpenAPI schemas
- Smart Mock Data: Context-aware mock data generation that understands field semantics
- Advanced Code Examples: Multi-language code generation with proper typing
These tools work seamlessly with AI clients to provide unprecedented insight into API design, helping developers build better, more maintainable APIs.
Usage Examples with AI Clients
Once connected to Claude Desktop or Cursor, you can use prompts like:
Core Operations
- "Load this OpenAPI spec and give me an overview: [paste spec]"
- "Search for all POST endpoints in the user management section"
- "Get detailed information about the GET /users/{id} endpoint"
Development & Code Generation
- "Generate a Python example for the GET /users/{id} endpoint"
- "Generate TypeScript interfaces for all schemas in this API"
- "Create realistic mock data for the User schema"
Advanced Analysis
- "Find all properties named 'email' in request bodies"
- "Show me the schema dependencies for the User model"
- "Validate all examples against their schemas"
- "Analyze the authentication patterns used in this API"
- "Find any unused schemas that could be cleaned up"
Optimization & Planning
- "Analyze how the User schema might evolve over time"
- "Get comprehensive analytics about this API's design"
- "Validate the API design and suggest improvements"
- "Export the documentation in markdown format"
Supported Formats
- OpenAPI 3.0+ (JSON/YAML)
- Swagger 2.0 (JSON/YAML) - automatically converted
- URL Loading - Direct import from API endpoints
- File Upload - Drag & drop or file picker
- Text Paste - Direct specification pasting
Development
Project Structure
src/
βββ components/ # React components
βββ utils/ # Utility functions
βββ hooks/ # Custom React hooks
βββ types/ # TypeScript type definitions
βββ mcp/ # MCP server implementations
βββ server.ts # Stdio transport server
βββ http-server.ts # HTTP transport serverAvailable Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run mcp:build- Build stdio MCP servernpm run mcp:http:build- Build HTTP MCP servernpm run mcp:dev- Run stdio MCP server in developmentnpm run mcp:http- Run HTTP MCP server in development
Transport Comparison
| Feature | Stdio Transport | HTTP Transport | |---------|----------------|----------------| | Latency | Lower | Higher | | Setup | Simple | Moderate | | Streaming | No | Yes (SSE) | | Direct Access | No | Yes (REST API) | | MCP Standard | β | β | | Custom Integration | Limited | Full | | Debugging | Harder | Easier |
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- π Check the in-app MCP instructions for detailed setup
- π Report issues on GitHub
- π‘ Request features through GitHub issues
- π HTTP API documentation at
/docsendpoint
