What is MCP integration?
The Model Context Protocol (MCP) is an open standard that allows AI models to interact with external tools and services. Apicentric’s MCP server exposes API simulation capabilities as tools that AI assistants can invoke, turning your AI into a powerful API development assistant.Available MCP tools
list_services- List all available mock servicescreate_service- Create a new service from YAML definitionstart_service- Start a specific mock servicestop_service- Stop a running serviceget_service_logs- Retrieve logs for a serviceset_scenario- Activate a scenario for a service
Why use MCP integration?
Natural language API creation
Describe your API in plain English and let AI generate the complete service definition.
Intelligent assistance
AI understands context and can suggest endpoints, responses, and test scenarios.
Rapid prototyping
Go from idea to running mock API in seconds with conversational commands.
Automated workflows
Let AI handle repetitive tasks like starting services, checking logs, and debugging.
Setup and configuration
Install Apicentric with MCP support
MCP support is included in most installation methods:Verify MCP is available:
Configure your AI assistant
Add Apicentric to your AI assistant’s MCP configuration.
Claude Desktop
Edit~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):VS Code (with Cline or similar extensions)
Create.vscode/mcp.json in your project:Continue.dev
Add to~/.continue/config.json:Restart your AI assistant
Restart Claude Desktop, VS Code, or your AI tool to load the new MCP configuration.
Example workflows
Create an API from description
You: Create a REST API for managing books with CRUD operations. Include endpoints for listing books, getting book details, creating, updating, and deleting books. Use port 9005. AI Assistant:- Uses
create_servicetool to generate:
books-api.yaml
- Uses
start_serviceto launch the API - Provides test commands:
Debug a service
You: My user-api service is returning 500 errors. Can you check the logs? AI Assistant:- Uses
get_service_logstool - Analyzes error messages
- Identifies the issue (e.g., invalid Handlebars template)
- Suggests fix or offers to update the service definition
Simulate different scenarios
You: Simulate high load on the payment-api service AI Assistant:- Uses
set_scenariotool with scenario name “high_load” - Confirms activation
- Explains that responses will now be delayed according to the scenario configuration
MCP tool reference
list_services
Lists all available mock services. Input: None Output:create_service
Creates a new service from YAML definition. Input:start_service
Starts a specific mock service. Input:stop_service
Stops a running service. Input:get_service_logs
Retrieves recent logs for a service. Input:set_scenario
Activates a scenario for a service. Input:Use cases
Rapid prototyping
Scenario: You’re designing a new microservice and need to prototype the API quickly. With MCP:- Describe the API to your AI assistant
- AI generates complete service definition
- AI starts the service automatically
- You test immediately with curl or Postman
Learning and experimentation
Scenario: You’re learning API design patterns and want to experiment. With MCP:- Ask AI to create examples of REST, GraphQL, or other patterns
- Compare different approaches
- Modify and iterate with natural language
Team onboarding
Scenario: New team member needs to set up development environment. With MCP:- AI lists required services
- AI starts all services with one command
- AI provides test commands and documentation
Debugging
Scenario: Mock API isn’t behaving as expected. With MCP:- Ask AI to check service logs
- AI identifies configuration issues
- AI suggests fixes based on error patterns
Advanced configuration
Custom working directory
Run MCP server in a specific directory:Environment variables
Pass environment variables to MCP server:Troubleshooting
MCP server not responding
Issue: AI assistant can’t connect to Apicentric MCP server. Solutions:- Verify Apicentric is installed:
apicentric --version - Test MCP server manually:
apicentric mcp --test - Check AI assistant logs for connection errors
- Restart your AI assistant after configuration changes
Tools not appearing
Issue: AI assistant doesn’t show Apicentric tools. Solutions:- Verify MCP configuration file syntax (valid JSON)
- Ensure
commandpath is correct (use full path if needed:/usr/local/bin/apicentric) - Restart AI assistant to reload MCP servers
Permission errors
Issue: MCP server can’t create or modify files. Solutions:- Check file permissions in your services directory
- Run AI assistant with appropriate permissions
- Set custom
cwdin MCP configuration
Tips and best practices
MCP tools run with the same permissions as your AI assistant. Ensure the assistant has write access to your services directory.
Next steps
- Learn about API simulator features to understand what AI can create
- Use code generation to generate client code from AI-created services
- Explore the TUI for visual monitoring alongside AI-driven management
- Set up contract testing for AI-generated mocks