Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added en/docs/assets/img/mcp/create-mcp-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/generate-mcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/mcp-inspector-initial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/mcp-inspector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/mcp-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/mcp-publish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/mcp-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/docs/assets/img/mcp/mcp-tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 166 additions & 0 deletions en/docs/mcp-servers/generate-mcp-servers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Generate MCP Servers

## **Overview**

## What is Model Context Protocol?

MCP is a JSON-RPC–based protocol designed to standardize how applications interact with large language models (LLMs). It enables sharing of contextual information—such as local files, databases, or APIs—with LLMs, while also allowing applications to expose tools and capabilities for AI-driven workflows and integrations.

MCP follows a host–client–server architecture and supports two primary transport mechanisms: stdio and streamable HTTP. While stdio is commonly used for local communication between clients and servers on the same machine, streamable HTTP is increasingly preferred for remote connections, especially as MCP adoption grows across networked environments.

For more information, refer to the official [specification](https://modelcontextprotocol.io/introduction).

## Remote MCP servers with Devant

Devant now includes support for MCP servers. It provides a complete solution for transforming existing APIs into intelligent, AI-ready tools. With a centralized control plane, Devant simplifies the entire lifecycle of MCP server management from creation to discovery, while delivering a seamless experience for both API developers and AI agent builders.

In summary, Devant provides the following capabilities related to MCP.

* Create MCP Servers from existing HTTP services under the category `Integration as APIs` from Devant.
* Automatically generates MCP tool schemas from the service definition.
* Secures the MCP Servers using OAuth2 authentication and authorization.

# Design and publish MCP servers

## Prerequisites

### Create an organization

If you're signing in to the Devant Console for the first time, create an organization.

1. Go to [Devant Console](https://console.devant.dev/) and sign in using your Google, GitHub, or Microsoft account.
2. Enter a unique organization name.
3. Read and accept the privacy policy and terms of use.
4. Click **Create**.

This creates the organization and opens the organization home page.

### Create a project

1. Go to [Devant Console](https://console.devant.dev/) and sign in. This opens the organization home page.
2. On the organization home page, click **+ Create Project**.
3. Enter the following details:

!!! info
The **Name** field must be unique and cannot be changed after creation.

| **Field** | **Value** |
| ---------------- | ----------------- |
| **Display Name** | Sample Project |
| **Identifier** | sample-project |
| **Description** | My sample project |

4. Click **Create**. This creates the project and takes you to the project home page.

### Create MCP servers for existing HTTP integrations under the `Integration as API` category in Devant.

1. Navigate to an HTTP based `Integration as API` type integration in Devant. At the top right corner of the integration's overview page, click the **Generate MCP server** button.

**Note:** The **Generate MCP server** button is only enabled if the API has been promoted to production. If the API is not yet in production, promote it first to enable this option.

![Create MCP server from service](../assets/img/mcp/generate-mcp.png)

2. Complete the form shown in the image below, then click **Create and Deploy**. This action will create and deploy the MCP server to the Development environment.

![Create MCP server form](../assets/img/mcp/create-mcp-form.png)

!!!important
Although the MCP Server is associated with the HTTP service, their lifecycles are not tightly coupled. As a result, unpublishing or undeploying the HTTP service can disrupt the MCP Server created using it, so it’s important to manage these actions carefully.

!!!info
The MCP Servers created in Devant currently support **2025-03-16** specification.

## Modify tools of your MCP server

You can modify the details of the tools of your generated MCP Server by clicking the **View More** button under the tool list. The default tool names and descriptions are generated by Devant based on the information available in the API contract.

![MCP Overview](../assets/img/mcp/mcp-overview.png)

![Edit MCP tools](../assets/img/mcp/mcp-tools.png)

The following options are supported when modifying the Tools

1. **Add new tool** - You can create a new tool by selecting the **+** icon at the top. You have to provide the name and description at this stage. The schema will be auto generated once you create the mapping to the REST resource
2. **Edit tool details** - You can modify the tool name and description of each tool by clicking on the tool icon. The tool schema cannot be modified.
3. **Delete tools** - By default tools are created for all the resources of the REST service or the backend service. You can remove unwanted ones by deleting the tool.

!!!tip
Clear and well-defined tool names and descriptions make it easier for LLMs to recognize and use the tools effectively. If the auto-generated versions don’t meet your needs, you should feel free to customize them to better suit your use case.

You have to **Redeploy** the MCP Server after saving for the new changes to be reflected.

## Invoke the MCP server

The MCP Inspector in Developer Portal allows you to list and invoke MCP tools. Follow these steps to publish and test your generated MCP server.

### Prerequisites

Before you start, ensure both the generated MCP server and the service used to generate it meet the following requirements:

- Deployed to Production.
- Published to the Dev Portal.
- Subscribed to the same application in the Dev Portal (both the REST service used to create the MCP server and the generated MCP server must be subscribed to the same application).

---

#### Step 1: Publish the REST service to the Developer Portal

Promote the REST service (used to generate the MCP server) to production. It will then be automatically published to the Developer Portal.

1. Go to the Overview page of the REST service and click the **Developer Portal** button located at the top right (second button).
2. You will be redirected to the Developer Portal’s representation of the service.
3. Click **Subscribe** and create an application.

💡 **Note:** Once the MCP server is also published to the Developer Portal, subscribe the same application to it as well.

#### Step 2: Publish the MCP server to the Developer Portal

1. Open your MCP server in Devant.
2. Click **Lifecycle Status** in the top-right corner of the Overview page.
3. In the lifecycle graph, click **Publish**.

![MCP lifecycle](../assets/img/mcp/mcp-publish.png)

4. Go to the Overview page of the MCP service and click the **Developer Portal** button located at the top right (second button).
5. You will be redirected to the Developer Portal’s representation of the service.
6. Click **Subscribe** and create an application.
7. From the drop-down list, select the same application used by the REST service and subscribe.

#### Step 3: Access the MCP inspector

1. Go back to the Devant MCP server Overview page.
2. In the Development environment header, click the test icon.
3. This opens the MCP Inspector view in the Developer Portal.

![MCP inspector initial view](../assets/img/mcp/mcp-inspector-initial.png)

#### Step 4: Prepare the access token

1. In the Developer Portal open the Applications view in another browser tab.
2. Select the application subscribed to both services.
3. Click **Generate** to create a token.

![MCP lifecycle](../assets/img/mcp/mcp-token.png)

4. Copy the generated token.

#### Step 5: Connect to the MCP server

1. Return to the MCP Documentation tab.
2. In the **Token** field, enter: `Bearer <copied token>`
3. Click **Connect**.

![MCP inspector](../assets/img/mcp/mcp-inspector.png)

💡 **Note:** Clicking Connect sends an Initialize call to the MCP Server deployed in the gateway, establishing a connection.

#### Step 6: Invoke MCP tools

Once connected, you can:

- Select individual tools.
- Provide parameters if required.
- Execute the tool calls directly from the MCP Inspector UI.

!!!important
If you are using another AI Agent or an MCP Client, you need to configure the MCP server URL and set the authorization token appropriately. You can retrieve the tokens as given in the 4th step under [`Invoke the MCP`](#invoke-the-mcp-server) server section.
4 changes: 3 additions & 1 deletion en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ nav:
- API Management:
- Lifecycle Management: api-management/lifecycle-management.md
- Configure VPN:
- Configure VPNs on the Devant Cloud Data Plane: configure-vpn/configure-tailscale-vpn.md
- Configure VPNs on the Devant Cloud Data Plane: configure-vpn/configure-tailscale-vpn.md
- Create MCP servers:
- Create MCP servers from existing REST services: mcp-servers/generate-mcp-servers.md
- Testing:
- Test REST Endpoints via the OpenAPI Console: testing/test-rest-endpoints-via-the-openapi-console.md
- Monitoring and Insights:
Expand Down