An open-source Model Context Protocol server for dynamic API testing and validation powered by OpenAPI specifications.
APIBridge automatically generates MCP tools from your OpenAPI (Swagger) specification, allowing you to interact with, test, and validate your APIs using natural language. Simply provide an OpenAPI YAML or JSON file, and APIBridge creates a complete testing suite with zero configuration.
ποΈ Foundation-First Design Philosophy: APIBridge is architected as a foundational platform that provides base workflows and core tools which you can extend, customize, and enhance. Rather than being a rigid solution, it serves as extensible building blocks for your specific API integration needs.
npm install

cd demo-api
./demo.sh

node index.js demo-api/sample-api.yml

Add the MCP server to VS Code (Example)
You can quickly add the MCP server to VS Code:
MCP: Open User Configuration and select it.The foundation workflows will be automatically generated and ready for extension!
π For the full MCP config JSON example, see the VS Code Configuration section below.

Once your APIBridge MCP Server is running, you can connect to it from any compatible client (like VS Code or Claude Desktop) to interact with your API using natural language. The video below demonstrates how APIBridge can run a comprehensive suite of tests against a demo API, from checking the API health and metrics to validating CRUD operations for different endpoints. It intelligently identifies issues, such as a failing create_product operation, and then automatically generates a detailed report in Markdown format, summarizing the status of the entire system. This entire workflow is executed through a series of simple, conversational prompts, showcasing the power of using a 100% local, open-source MCP server to streamline API testing and validation.

Clone or download the project files, then install the required dependencies:
npm install
The server can be used in several ways:
With OpenAPI Specification (Recommended):
# Using OpenAPI YAML file
node index.js demo-api/sample-api.yml
# With custom base URL
node index.js demo-api/sample-api.yml --base-url http://localhost:8080/api
# With API key authentication
node index.js demo-api/sample-api.yml --api-key your-api-key-here
# Enable verbose logging
node index.js demo-api/sample-api.yml --verbose
With Configuration File:
# Use custom configuration file
node index.js --config apibridge.config.json
# Combine with OpenAPI spec
node index.js api.yml --config apibridge.config.json
Command Line Options:
--openapi, -o: OpenAPI specification file (YAML or JSON)--config, -c: Configuration file (default: apibridge.config.json)--base-url, -b: Base URL for the API--api-key, -k: API key for authentication--verbose, -v: Enable verbose logging--help, -h: Show help messageFor a complete demo with a working API backend:
# Run the demo script (starts demo API server + shows instructions)
cd demo-api
./demo.sh
Or manually:
# Terminal 1: Start the demo API server
cd demo-api
npm install
npm start
# Terminal 2: Start the MCP server
node index.js demo-api/sample-api.yml
To start the MCP server, run:
node index.js demo-api/sample-api.yml
The server will start and listen for requests from an MCP client on stdio.
create_user, list_users, etc., from your API endpoint configuration.ping_api) and run comprehensive validation tests (validate_api).get_metrics tool./your-project
βββ index.js # The main server entry point
βββ package.json # Project definition and dependencies
βββ README.md # This file
βββ LICENSE # The MIT License with Commercial Enterprise Addendum
βββ /src/ # Source code directory
β βββ /api/ # Main server implementation
β βββ /auth/ # Authentication utilities
β βββ /config/ # Configuration management
β βββ /docs/ # Documentation utilities
β βββ /services/ # Core services (OpenAPI parser, etc.)
β βββ /tools/ # Tool management and generation
β βββ /utils/ # Utility functions
βββ /test/ # Test files
β βββ workflow-generator.test.js # Main test file
βββ /demo-api/ # Demo API server with sample OpenAPI spec
β βββ server.js # Express server implementing sample-api.yml
β βββ package.json # Demo API dependencies
β βββ sample-api.yml # Example OpenAPI specification
β βββ demo.sh # Demo script for this API server
β βββ README.md # Demo API documentation
βββ /logs/ # (Auto-generated) For log files
APIBridge includes a comprehensive test suite with sample APIs from different domains to validate workflow generation.
Before starting the MCP server, you can validate your OpenAPI specification to ensure it is correctly formatted and will generate the expected workflows. We have included a test script that you can run from the command line.
To test your OpenAPI file, run the following command:
npm test -- /path/to/your/openapi.yml
Replace /path/to/your/openapi.yml with the actual path to your OpenAPI specification file. The script will parse the file, generate the endpoints and workflows, and report any errors it finds.
If the script runs successfully, you will see a confirmation message indicating that your OpenAPI specification is valid and ready to be used with the APIBridge MCP Server.
# Run the full test suite
node test/workflow-generator.test.js
# Test specific API domains
node test/workflow-generator.test.js test/sample-ecommerce-api.yml
node test/workflow-generator.test.js test/sample-library-api.yml
node test/workflow-generator.test.js test/sample-healthcare-api.yml
# Test your own API
node test/workflow-generator.test.js path/to/your-api.yml
Available Test APIs:
For detailed testing documentation, see test/README.md.
apibridge.config.jsonThe apibridge.config.json file is used to configure the APIBridge MCP Server. It allows you to specify settings such as:
apiBaseUrl: The base URL of the API to connect toname/version: Server name and versiontimeout, retryAttempts: Request timeout and retry settingsenableLogging, enableMetrics: Enable/disable logging and metricsendpoints, workflows: Custom endpoints and workflows (optional)This file makes it easy to change server behavior, API targets, and workflow definitions without modifying code. It is especially useful for demos, CI/CD, or switching between different API environments.
Example:
{
"name": "APIBridge Demo MCP Server",
"version": "1.0.0",
"apiBaseUrl": "http://localhost:3000/api",
"timeout": 10000,
"retryAttempts": 3,
"enableLogging": true,
"enableMetrics": true,
"endpoints": {},
"workflows": {}
}
You can specify a custom config file with:
node index.js --config apibridge.config.json
To use this server with MCP clients like Claude Desktop or VS Code, you need to configure the client to recognize and connect to your APIBridge server.
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/claude/claude_desktop_config.json{
"mcpServers": {
"apibridge": {
"command": "node",
"args": ["/path/to/your/api-bridge-mcp-server/index.js", "demo-api/sample-api.yml"],
"env": {
"NODE_ENV": "production"
}
}
}
}
{
"mcpServers": {
"my-api-bridge": {
"command": "node",
"args": [
"/path/to/your/api-bridge-mcp-server/index.js",
"/path/to/your/openapi-spec.yml",
"--base-url", "https://api.yourcompany.com",
"--api-key", "your-api-key-here"
],
"env": {
"NODE_ENV": "production"
}
}
}
}
π See Quick Start Step 4 above for a fast walkthrough of adding the MCP server to VS Code.
You can add the MCP server to VS Code in just a few steps:
MCP: Open User Configuration and select it.Add your MCP configuration as shown below and save the file:
{
"inputs": [
{
"type": "promptString",
"id": "api-base-url",
"description": "API Base URL (optional)",
"default": "http://localhost:3000/api"
},
{
"type": "promptString",
"id": "api-key",
"description": "API Key (optional)",
"password": true
}
],
"servers": {
"apibridge": {
"type": "stdio",
"command": "node",
"args": ["/path/to/your/api-bridge-mcp-server/index.js", "demo-api/sample-api.yml"],
"cwd": "/path/to/your/api-bridge-mcp-server",
"env": {
"API_BASE_URL": "${input:api-base-url}",
"API_KEY": "${input:api-key}"
}
}
}
}

Key Features:
For other MCP-compatible clients, the general pattern is:
node["/path/to/api-bridge-mcp-server/index.js", "your-openapi-spec.yml"]/path/to/api-bridge-mcp-serverOnce configured, you should be able to:
ping_api, validate_api, and dynamically generated endpoint tools.Example tools youβll see:
ping_api - Check API healthvalidate_api - Run comprehensive API testslist_users - Get all users (if your API has this endpoint)create_user - Create a new userget_metrics - View server statisticsAPIBridge is designed as a foundational platform that provides base workflows and core functionality that you can build upon. The architecture embraces extensibility at every level, allowing you to customize and enhance the system to meet your specific requirements.
APIBridge provides these base building blocks:
Extensibility Philosophy:
Core tools are custom tools that are not generated from an OpenAPI specification. You can add your own tools by following these steps:
src/tools/tool-manager.js.In the setupCoreTools method, add a new entry to the this.coreTools map.
this.coreTools.set('my_custom_tool', {
name: 'my_custom_tool',
description: 'A new tool that does something awesome.',
inputSchema: {
type: 'object',
properties: {
my_arg: { type: 'string', description: 'An argument for my tool' }
}
},
handler: this.handleMyCustomTool.bind(this)
});
Add the handler method to the ToolManager class.
async handleMyCustomTool(args, testContext, metrics) {
// Your tool's logic here
const myArg = args.my_arg;
// ...
return {
content: [{
type: 'text',
text: `My custom tool ran with arg: ${myArg}`
}]
};
}
The generated workflows serve as foundational building blocks that you can extend and enhance:
Base Workflow Examples:
users_crud_workflow - Basic user management operationsposts_crud_workflow - Basic post content operationsproducts_crud_workflow - Basic product catalog operationsExtension Strategies:
// In src/services/openapi-parser.js
generateWorkflows() {
const baseWorkflows = this.generateBaseWorkflows();
// Extend workflows with custom steps
baseWorkflows.users_crud_workflow.steps.unshift({
action: 'validate_user_permissions',
// ... custom validation logic
});
return baseWorkflows;
}
// Combine base workflows for complex operations
const complexWorkflow = {
name: 'user_onboarding_workflow',
steps: [
...baseWorkflows.users_crud_workflow.steps,
{ action: 'send_welcome_email' },
{ action: 'setup_default_preferences' },
{ action: 'assign_default_role' }
]
};
// Extend for e-commerce scenarios
const ecommerceWorkflows = {
...baseWorkflows,
order_fulfillment_workflow: {
steps: [
{ action: 'validate_inventory' },
...baseWorkflows.products_crud_workflow.steps,
{ action: 'process_payment' },
{ action: 'schedule_shipping' }
]
}
};
Workflow Extension Guidelines:
The serverβs authentication logic is centralized in src/utils/http-client.js. You can easily modify this file to support different authentication schemes.
--api-key flag or API_KEY environment variable.src/auth/auth-examples.js. You can import and use these functions in src/utils/http-client.js to extend the authentication capabilities.Example: Implementing Custom Header Auth
In src/utils/http-client.js:
import { setupCustomHeaderAuth } from '../auth/auth-examples.js';
// ... inside the HttpClient class, in the initialize() method
// Add this line to use a custom header
setupCustomHeaderAuth(this.client, config.apiKey, 'X-My-Custom-Header');
You can change how tools are generated from an OpenAPI specification by modifying the following files:
src/services/openapi-parser.js: Modify this file to change how the OpenAPI specification is parsed and interpreted. For example, you could change how endpoint names are extracted or how test data is generated.src/tools/tool-manager.js: Modify the generateToolName, generateToolDescription, or generateToolSchema methods to change how the parsed OpenAPI data is converted into MCP tools.APIBridge is intentionally designed as a foundation rather than a complete solution. This approach provides several benefits:
Pattern 1: Industry-Specific Workflows
# Start with base
node index.js your-api.yml
# Extend for healthcare, e-commerce, finance, etc.
# Add domain-specific validation, compliance, workflows
Pattern 2: Integration Workflows
# Combine multiple APIs using base workflows
# Add orchestration between different services
# Create composite operations across systems
Pattern 3: Advanced Testing Workflows
# Build on base validation tools
# Add performance testing, load testing
# Create comprehensive test suites
We encourage users to:
The goal is to build a rich ecosystem of extensions while maintaining a solid, reliable foundation that works consistently across different use cases.
Remember: The foundation is designed to handle the common cases well, while giving you the flexibility to handle the unique aspects of your specific requirements.
logs directory for detailed error information.