Working with MCP tools and server

The Model Context Protocol (MCP) provides standardization that allows APIs to be represented as tools that AI agents can discover and invoke.

Enterprise capabilities such as retrieving data or updating records are typically exposed through REST APIs. These APIs and its operations are commonly defined by using OpenAPI specifications. However, AI agents or large language models (LLMs) cannot understand the OpenAPI specifications. For an AI agent to understand what actions are available and how to invoke them, these capabilities must be exposed in a standardized MCP format.

An MCP tool represents a specific action that an AI agent can perform, such as retrieving or updating data. Each MCP tool corresponds to an API operation.

An MCP server hosts one or more MCP tools and exposes them in a format that AI agents can discover and invoke. The MCP server acts as the interface through which AI agents interact with enterprise capabilities.

In the AI view of IBM API Studio, you can select an API, which is created from an OpenAPI specification and choose the operations that you want AI agents to use. IBM API Studio converts the selected OpenAPI‑based operations into MCP‑compliant tool definitions and groups them into an MCP server. For details about the MCP specifications, see MCP tool and server configurations.

You can then review the generated tools, apply governance policies, and publish the MCP server so that AI agents can securely discover and invoke these capabilities. You can also use the API Agent to perform these actions by using natural language prompts.

Benefits of converting APIs into MCP tools by using API Studio

  • Select relevant API operations.

    Choose only the API operations that you want AI agents to access so that exposed capabilities are aligned with your use case.

  • Simplify MCP tool generation.

    Automatically generate MCP‑compliant tools from existing OpenAPI definitions without modifying your underlying APIs.

  • Improve tool descriptions for AI agents.

    Use the MCP Server Enhancer to refine tool names and descriptions so that AI agents can understand how and when to use each tool. It refines OpenAPI technical field descriptions into structured LLM-optimized metadata that helps AI agents understand the semantic context of each tool's operations, parameters, prerequisites, and possible outcomes.

  • Improve invocation reliability.

    Clearer tool definitions help AI agents select correct tools and parameters. It reduces the hallucination gaps, resulting in fewer failed API calls during autonomous task execution.

Converting APIs into MCP tools

IBM API Studio offers flexible options for converting the existing APIs to MCP tools and server. Users can generate MCP tools by using the form-based approach and update the generated MCP tools definitions by using a code-based approach.

  • Form view. Simplifies MCP creation by providing guided input fields, making it easier to convert API to MCP tools and server without manually writing YAML configurations.
  • Code view. Update the generated YAML configurations of MCP tools and server. This approach works well for those who prefer updating directly with code.