Building MCP tools and server
MCP tools help large language models (LLMs) understand and call existing APIs as if they were native functions. By defining APIs as tools by using the Model Context Protocol (MCP), you enable AI agents to trigger operations, fetch data, and interact with systems directly through API calls.
API Studio simplifies MCP tool creation by automating tool definition generation and packaging into a stand-alone server. It works with existing OpenAPI definitions, reducing manual effort and streamlining integration. The generated server can be tested locally and connected to AI agents such as Claude or Copilot.
The following sections describe how the protocol works, how to use API Studio to generate and connect MCP tools, and the key benefits of this integration.
Understanding the benefits of using MCP in API Studio
API Studio reduces the complexity of making APIs accessible to AI agents. It supports familiar inputs by working directly with OpenAPI definitions and avoids the need to restructure existing APIs. During tool creation, you can select only the endpoints and methods relevant to their use case, giving them control over what is exposed.
Once tools are defined, API Studio packages them into a stand-alone server that can be run and tested locally. When connected to an AI agent such as Claude or Copilot, the agent can automatically discover and start the tools without requiring custom code or configuration. Because tool definitions are based on the original OpenAPI documentation, they stay consistent with backend implementations and maintain a single source of truth.
By supporting existing specifications, enabling selective exposure of operations, and allowing local validation before deployment, API Studio streamlines the entire MCP tool lifecycle.
Understanding how MCP works in API Studio
API Studio provides a guided workflow to define, package, and test MCP tools by using OpenAPI specifications. It hides the underlying MCP concepts so you can focus on selecting, configuring, and validating the tools that you need.
- Defining tools by using APIs
- To define tools, you can import an OpenAPI specification into API Studio. API Studio parses the definition and lists the available operations. Selected endpoints and methods are automatically converted into MCP-compliant tool definitions.
- Packaging tools into a server
- Once tool selection is complete, API Studio packages the tool definitions into a runnable MCP server. This server acts as a container that hosts the tools and exposes them in a format that AI agents can inspect and interact with.
- Connecting the server to an AI agent
-
After the server is created, it can be run locally. AI agents such as Claude or Copilot can connect to the MCP server, discover the available tools, and register them. API Studio configures the server to follow the MCP specification, which supports smooth discovery and registration.
- Using tools through the AI agent
- Once tools are registered, the AI agent can call them directly from the MCP server. This capability allows the agent to retrieve data, perform operations, and interact with backend services by using tools that are generated through API Studio.