-
Notifications
You must be signed in to change notification settings - Fork 19
Resolve reviews and update images for MCP docs #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SashenkaG
wants to merge
10
commits into
wso2:main
Choose a base branch
from
SashenkaG:docs-review
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
83128f3
Add MCP docs
Bhashinee 4913062
Replace the mcp-overview image
Bhashinee 0e96a60
Refactor the docs
Bhashinee 5aae090
Add to the mkdocs
Bhashinee 1935343
Refactor the introduction
Bhashinee 094194a
Update MCP documentation and images
SashenkaG b239db4
Fix typos in MCP docs
SashenkaG 4f6ec35
Fix typo in MCP server documentation
SashenkaG fc54901
Remove extra spacing
SashenkaG 5bfbcbd
Resolve reviews
SashenkaG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
|
|
||
|  | ||
|
|
||
| !!!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. | ||
|
|
||
|  | ||
|
|
||
|  | ||
|
|
||
| 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**. | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
|
|
||
|  | ||
|
|
||
| #### 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. | ||
|
|
||
|  | ||
|
|
||
| 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**. | ||
|
|
||
|  | ||
|
|
||
| 💡 **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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.