Create and deploy Model Context Protocol (MCP) servers from your OpenAPI specifications, or configure existing external MCP servers.
Before you begin
Before you begin, verify that you have the following:
- Visual Studio Code with API Agent installed. For more information, see Getting started.
- An OpenAPI 3.0 specification file (YAML or JSON format) for creating a custom MCP server. For example, you can use an
orders.yaml file that defines your API operations.
- For external MCP servers: The server deployment URL and authentication credentials.
About this task
Use the MCP client tool to extend your your API Agent's capabilities by
connecting to external services and tools.
By using the MCP tool, you can do the following key actions.
- Dynamically create and deploy MCP servers from OpenAPI 3.0 specifications
- Enable and interact with external or internal MCP servers
- Run operations on any compliant server by using natural language prompts
- Automatically generate tool interfaces and schemas based on server definitions
Procedure
Creating a custom MCP server from an OpenAPI specification
- Open Visual Studio Code and ensure your OpenAPI specification file, for example,
orders.yaml is available in your workspace.
Note: The OpenAPI file must be in YAML or JSON format and accessible within your Visual Studio Code
workspace for API Agent
to process it.
- Open API Agent in Visual Studio Code.
- In the Type something field, enter the following prompt, replacing the placeholder with your actual file name.
Create an MCP server from @orders.yaml
API Agent displays
the proposed plan.
- Click Start.
- After API Agent generates the MCP
server code, download the compressed file, for example,
output.zip, and save it in
your Visual Studio Code workspace.
- To deploy the server locally, click the Deploy the application code using [zip file] instruction in the proposed plan.
- Replace the placeholder
[zip file] with your actual file name by
selecting the compressed file from your workspace.
- In the proposed plan, click Start.
- To verify the deployment status, enter the following prompt by using your actual file
name.
Give me the deployment status for the application code file @output.zip
After successful deployment, API Agent displays the URL
where your custom MCP server is deployed.
- Optional: To configure an existing external MCP server, such as a GitHub
integration or another prebuilt MCP server, enter a prompt similar to the following example.
Enable the MCP server for github with description 'GitHub integration for
repository management', deployed_url: https://github-mcp.example.com, authentication: ghp_your_token_here
Note:
- Replace the URL and authentication token with the actual values provided by your external MCP
server provider.
- If you face any issue during configuration, see troubleshooting or limitations.