What is MCP?
MCP is an open protocol that enables AI models to securely access external tools and data sources. With MCP, AI assistants can:- Create and manage mock API services from natural language descriptions
- Start and stop services dynamically
- Monitor service logs and status in real-time
- Generate service definitions without writing YAML manually
Installation
Install Apicentric with MCP support enabled:Claude Desktop setup
Locate configuration file
Find your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add Apicentric MCP server
Add the following configuration to
claude_desktop_config.json:If you installed Apicentric in a custom location, use the full path to the binary:
VS Code setup
For VS Code with MCP-compatible extensions:Install MCP extension
Install an MCP-compatible extension from the VS Code marketplace that supports the Model Context Protocol.
Available MCP tools
Apicentric exposes these tools through MCP:list_services
List all available mock services in the configured directory. Usage example:“Show me all my API services”
create_service
Create a new service from a YAML definition. Parameters:name: Service namedefinition: YAML service definition
“Create a mock API for a library system with book endpoints”
start_service
Start a specific mock service. Parameters:name: Service name or file path
“Start the user-api service”
stop_service
Stop a running service. Parameters:name: Service name or identifier
“Stop the user-api service”
get_service_logs
Retrieve logs for a specific service. Parameters:name: Service namelines: Number of log lines to retrieve (optional)
“Show me the last 50 logs from the products-api”
Example workflows
Creating a REST API from scratch
Have Claude create a complete mock API through natural conversation:Describe your API
Ask Claude:
“Create a REST API for managing books with the following endpoints:Each book should have: id, title, author, isbn, and published_date”
- GET /books - list all books
- GET /books/ - get a specific book
- POST /books - create a new book
- PUT /books/ - update a book
- DELETE /books/ - delete a book
Claude generates the service
Claude will use the
create_service MCP tool to generate a complete YAML service definition with:- All CRUD endpoints
- Request/response schemas
- Sample fixtures
- Proper validation
Start the service
Ask Claude:
“Start the books API service”Claude will use
start_service to launch the mock API.Debugging service issues
Use Claude to troubleshoot problems: User: “My user-api service isn’t responding to requests” Claude (using MCP tools):- Uses
get_service_logsto check for errors - Identifies port conflicts or configuration issues
- Suggests fixes based on log analysis
- Can restart the service with
stop_servicethenstart_service
Generating test data
User: “Add 10 sample products to the products-api with realistic data” Claude:- Uses
list_servicesto find the products-api definition - Creates a service variant with extended fixtures
- Uses
create_serviceto save the updated version - Restarts the service with new data
Configuration options
Custom services directory
Tell Apicentric where to find your service definitions:Enable debug logging
Get detailed logs for troubleshooting:Multiple service directories
Manage services from different projects:Benefits of MCP integration
Natural language API creation
Describe your API in plain English instead of writing YAML: Without MCP:“Create a user API with login, registration, and profile endpoints”
Automated testing setup
Let AI handle service creation and configuration:“Create mock services for our microservices architecture:
- User service on port 9001
- Product service on port 9002
- Order service on port 9003 All should support CRUD operations”
Integrated development workflow
Seamless workflow between AI assistance and API development:“My frontend needs a new endpoint GET /users//preferences that returns user preferences. Add it to the user-api and restart the service.”
Rapid prototyping
Go from idea to working mock API in seconds:“Create a payment processing API that mimics Stripe’s basic functionality”
Troubleshooting
MCP server not connecting
-
Verify Apicentric installation:
-
Check configuration path:
- Ensure you’re editing the correct config file for your OS
- Verify JSON syntax is valid
-
Restart Claude Desktop:
- Completely quit and reopen the application
- On macOS:
Cmd+Qto fully quit
-
Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/ - Look for MCP connection errors
- macOS:
Services not being created
If Claude can’t create services:-
Check permissions:
-
Verify services directory exists:
-
Set environment variable:
Command not found errors
If you see “apicentric: command not found”:-
Use full path in config:
-
Verify PATH in MCP context:
Advanced use cases
Generating OpenAPI specs
“Create a service definition and export it to OpenAPI 3.0 format”Claude can:
- Create the service with
create_service - Use Apicentric’s export functionality
- Save the OpenAPI spec to a file
Contract testing automation
“Compare my mock user-api against the production API and show me any differences”Claude can:
- Start the mock service
- Run contract tests
- Analyze the results
- Suggest fixes for discrepancies
Multi-service orchestration
“Start all services for the e-commerce platform: users, products, cart, and checkout”Claude can start multiple services in the correct order with proper dependencies.