A tool to generate MCP (Model Context Protocol) servers from HAR (HTTP Archive) files.
MCP Creator analyzes HAR files captured from browser network activity or API testing tools to automatically generate comprehensive MCP servers. This enables rapid creation of MCP servers for any API service.
- HAR File Parsing: Extracts API endpoints, request/response patterns, and authentication mechanisms
- Smart Endpoint Detection: Filters out static assets and identifies API calls
- Path Parameter Extraction: Automatically detects UUIDs, numeric IDs, and other path parameters
- Query Parameter Discovery: Extracts and documents query parameters with examples
- Multiple Authentication Methods:
- API Key authentication
- Bearer token authentication
- Basic authentication
- Custom header authentication
- OAuth2 client credentials flow
- Production-Ready Code: Generates well-structured, documented Python MCP servers
git clone https://github.com/iblai/iblai-mcp-creator.git
cd iblai-mcp-creator
pip install -e .Or just use directly with Python:
python cli.py <har_file>See what endpoints and authentication patterns were discovered:
python cli.py analyze your-api.harOutput includes:
- Service name (auto-detected from URLs)
- Base URL
- Authentication patterns found
- List of endpoints with parameters
Example output:
============================================================
HAR Analysis: your-api.har
============================================================
Service Name: example-service
Suggested MCP Name: iblai-example-service
Base URL: https://api.example.com
========================================
Authentication Patterns Discovered
========================================
- Type: bearer
Header: Authorization
Location: header
========================================
API Endpoints (3 found)
========================================
GET /api/users/
Tool name: get_api_users
Query params: ['page', 'limit']
POST /api/users/
Tool name: create_api_users
Has request body: Yes
GET /api/users/{id}
Tool name: get_api_users_id
Path params: ['id']
Create a complete MCP server from a HAR file:
# Auto-detect name from HAR file
python cli.py create your-api.har
# Specify custom name
python cli.py create your-api.har --name myservice
# Specify output directory
python cli.py create your-api.har --output ./servers# Shortcut - same as 'create'
python cli.py your-api.har
# Analyze only
python cli.py your-api.har --analyze- Open Developer Tools (F12)
- Go to the Network tab
- Perform the API operations you want to capture
- Right-click on the network requests list
- Select "Save all as HAR with content"
- Open Developer Tools (F12)
- Go to the Network tab
- Perform the API operations
- Click the gear icon and select "Save All As HAR"
- Make your API requests
- Click on the History tab
- Select the requests you want to export
- Right-click and select "Export" > "HAR"
iblai-<service>/
├── pyproject.toml # Project configuration
├── README.md # Documentation
├── .env.example # Environment variables template
└── iblai_<service>/
├── __init__.py
├── server.py # Main MCP server
├── auth.py # Authentication manager
└── client.py # HTTP client
The generated servers support multiple authentication methods via environment variables:
export SERVICENAME_AUTH_TYPE=api_key
export SERVICENAME_API_KEY=your_api_key
export SERVICENAME_API_KEY_HEADER=X-API-Key # optional, default: X-API-Keyexport SERVICENAME_AUTH_TYPE=bearer
export SERVICENAME_BEARER_TOKEN=your_tokenexport SERVICENAME_AUTH_TYPE=basic
export SERVICENAME_BASIC_USERNAME=your_username
export SERVICENAME_BASIC_PASSWORD=your_passwordexport SERVICENAME_AUTH_TYPE=oauth2_client_credentials
export SERVICENAME_OAUTH2_CLIENT_ID=your_client_id
export SERVICENAME_OAUTH2_CLIENT_SECRET=your_client_secret
export SERVICENAME_OAUTH2_TOKEN_URL=https://auth.example.com/oauth/token
export SERVICENAME_OAUTH2_SCOPE=read write # optional- Clear existing requests: Start with a clean Network tab
- Preserve log: Enable "Preserve log" to keep requests across page navigations
- Include all variations: Perform different operations to capture all endpoints
- Multiple parameters: Try different query parameters to capture all options
- Authenticated sessions: Capture while logged in to see auth headers
All generated servers follow the naming convention: iblai-<service>
The service name is auto-detected from the HAR file's URLs, but can be overridden with --name.
The tool has three main components:
- har_parser.py: Parses HAR files to extract
ServiceInfocontaining endpoints, auth patterns, base URLs. Key classes:HARParser,APIEndpoint,AuthPattern,ServiceInfo - mcp_generator.py: Generates complete MCP server packages from
ServiceInfo. Creates server.py, auth.py, client.py, pyproject.toml, README.md - cli.py: CLI interface with
analyzeandcreatecommands
The generated servers are meant to be starting points. Common extensions:
- Add custom tools: Edit
server.pyto add tools not in the HAR - Add resources: Expose data as MCP resources
- Add prompts: Create prompt templates
- Enhanced error handling: Customize error responses
- Rate limiting: Add rate limiting to the client
Generated MCP servers are published to: iblai/iblai-mcp
MIT