By Zi Kui and Yu Huai
The rapid development of MCP seems to exceed most people’s expectations. In February of this year, Cursur, Winsurf, and Cline all began to introduce MCP. Recently, OpenAI announced support for MCP, and domestic providers such as Baidu Maps and Amap have successively released MCP Servers. Additionally, numerous active suppliers are providing MCP hosting and middleware services, signaling a more rich and mature MCP ecosystem.
Although AI still faces ROI challenges in the short term, almost everyone has confidence in its future and does not want to miss this "arms race." However, issues arise as transforming APIs in existing business architectures into MCP Servers involves both time costs and human resource challenges. Enterprises increasingly yearn for open-source and commercial options that can enhance MCP construction efficiency.
NAs MCP Registry, Nacos plays the role of a control plane, managing tool metadata and transforming existing APIs into the MCP protocol.
Nacos can help applications quickly convert existing API interfaces into MCP protocol interfaces, and combined with the Higress AI gateway, achieve transformation between MCP protocol and existing protocols.Nacos provides management of existing services and dynamic definitions of service information, helping businesses apply the MCP Server protocol generated by Higress gateway dynamically without changing existing interfaces.
Taking advantage of the development opportunity of MCP, Nacos (Naming and Configuration Service) is evolving from building cloud-native applications to an open-source project for dynamic service discovery, configuration management, and service management platforms for cloud-native AI applications. The official release of Nacos 3.0 is imminent, which will provide systematic upgrades aimed at AI architecture.
Let’s first look at how a regular invocation occurs.
First, the caller needs to know the address of the service provider (either a domain name or an IP), and then the caller invokes the interface according to pre-agreed parameters. The invocation flowchart is as follows:
In daily development, we are already familiar with the current provider's interface collection, and the specific roles of the interfaces and their parameters. Therefore, we can write the invocation logic in business code based on this context to achieve inter-service calls. For models, these invocation contexts are also essential; models need to know the interface collection and detailed descriptions to invoke interfaces based on context.
Therefore, for existing services that have already used Nacos as a registration and configuration center, the calling addresses of the services are already stored in Nacos. Simply adding the interface information of the service allows models to invoke the context.
To achieve this, we introduced an "Application Global Description" to describe the current application and detailed information about the interfaces, transforming services in Nacos into the MCP format through a unified interface description protocol.
For services that were not previously registered in Nacos, they can be manually registered via Nacos's persistent service discovery.
After configuring the relevant information of the service, all data required by the MCP protocol will be complete. Next, we need to consider how to expose this data through the MCP protocol. Here, we accomplish the exposure capability of the MCP protocol via Higress's plugin mechanism. The invocation flowchart is as follows:
Currently, the MCP protocol supports various resources (Tool, Prompt, Resource, etc.). We prioritized the implementation of commonly used Tools and accelerated the construction of MCP Server with the unified SSE protocol support provided by Higress.
The implementation principle involves exposing the Tools managed in Nacos through the MCP Server plugin in Higress, exposing standard HTTP services via the MCP protocol. We need to accomplish two tasks; the implementation principle diagram is as follows:
The tool/list method is primarily responsible for returning a detailed information list of the Tools supported by the current MCP Server to the client. The returned information includes the description of the Tool's function and the parameter descriptions (including type, function, etc.), and it transforms the description information stored in Nacos into the standard MCP protocol's tool/list result and returns it to the client.
Multiple services will be registered in Nacos, each service having multiple interfaces, with each interface mapped to a Tool. The description of the Tool is the description of the interface. Then, based on the interface names, all service names of all Tools will be generated into a globally unique Tool name, and these Tools will be aggregated into the current Tool list which is returned to the MCP Client.
When the MCP Client intends to call a Tool, Higress parses the Json RPC request of tool/call and generates an HTTP request for the backend using user-configured parameter mappings, Path, backend addresses, and other information. Upon completion of the call, the result from the backend is wrapped and returned as the result of the standard tool/call interface invocation.
Overall, Nacos serves as the MCP Registry, managing the Tool's metadata in the control plane, while Higress performs protocol conversion and RPC invocations in the data plane. Existing services only need to add interface descriptions without making any changes.
● Existing APIs can quickly build MCP Servers: The integration of Nacos and Higress allows users to rapidly construct MCP Servers with zero code needed, keeping pace with the MCP protocol.
● MCP information can be dynamically distributed and take effect in real time: MCP descriptions, Tools, and Prompts need debugging for better results. Nacos can assist in managing and distributing information for more efficient debugging.
● Management of historical versions of MCP information: Nacos will manage and store historical versions of MCP information, making it convenient to perform Diff comparisons and quick rollbacks.
● Gray-scale management of MCP information: When MCP information takes effect, Nacos can implement gradual deployment, making it easy to compare the effectiveness of MCP information.
● Encryption of password configurations: Sensitive information such as passwords is needed during MCP information and API invocation processes. Nacos provides capabilities for encrypting sensitive information, helping to use MCP more securely.
● Conversion of MCP return format from JSON to XML: The interaction with large models is more intuitive; for models, JSON is not as usable as XML format. Therefore, for the MCP return information format, Nacos can assist in converting the return format from JSON to XML, making it easier for large models to understand.
● MCP service management and health checks: As the number of MCP services increases, Nacos has large-scale service management capabilities and continuously iterates to perform health checks, real-time updates, and load balancing for MCP, serving as the management hub for MCP service discovery.
Recently, Amap launched its MCP Server, which has received widespread attention in the industry. This part of the Server was developed based on the MCP community's development guidelines, with high construction costs. Next, we will demonstrate how to zero-code adapt the MCP Server based on Amap's official Open API interface through the Nacos+Higress solution.
Deploy Nacos via Docker:
export NACOS_AUTH_TOKEN=custom token, the token is the base64 encoded result of the original content
export NACOS_AUTH_IDENTITY_VALUE=custom IDENTITY_VALUE, any combination of letters and numbers
docker run -td -e PREFER_HOST_MODE=hostname -e MODE=standalone -e NACOS_AUTH_IDENTITY_KEY=serverIdentity -e NACOS_AUTH_IDENTITY_VALUE=${NACOS_AUTH_IDENTITY_VALUE} -e NACOS_AUTH_TOKEN=${NACOS_AUTH_TOKEN} -p 8848:8848 -p 9848:9848 nacos/nacos-server
Please refer to the documentation for Higress deployment: https://higress.cn/en/ai/mcp-quick-start/
After the environment deployment is completed, we will demonstrate the entire process through a small demo. We will use the weather query scenario to expose Amap's HTTP interface as an MCP protocol without any modification for the Agent to invoke.
To call Amap API, we first need to apply for Amap API key. Go to the Amap developer platform, log in, and create a new application.
Create a New Application.
After creating the application, we create a key.
After seeing the key in the console, save it.
Next, we complete the configuration in Higress to associate Nacos as the MCP registry.
Next, we complete the configuration of Amap's HttpApi description file and domain information in Nacos.
First, we register Amap's domain name in Nacos using its persistent service discovery capability, naming the service "amap" and grouping it as "amap."Use the following command to register Amap's domain name.
curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=amap&groupName=amap&ip=restapi.amap.com&port=80&ephemeral=false'
Check that the instance count for the "amap" service has changed to 1.
Create a new configuration file in the configuration center to describe the Amap API.
In the configuration center, click to create a new configuration.
Create a configuration item with DataId "amap-mcp-tools.json" grouped as "amap," with the configuration content as follows:
{
"protocol": "http",
"tools": [
{
"name": "get_weather",
"description": "get weather",
"inputSchema": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "city adcode"
}
}
}
},
{
"name": "get_adcode",
"description": "get adcode via address",
"inputSchema": {
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "address"
}
}
}
},
{
"name": "get_address_via_ip",
"description": "get address via ip",
"inputSchema": {
"type": "object",
"properties": {
"ip": {
"type": "string",
"description": "ip address"
}
}
}
}
],
"toolsMeta": {
"get_weather": {
"credentialRef": "amap-key.json",
"InvokeContext": {
"path": "/v3/weather/weatherInfo",
"method": "GET"
}
},
"get_adcode": {
"credentialRef": "amap-key.json",
"InvokeContext": {
"path": "/v3/geocode/geo",
"method": "GET"
}
},
"get_address_via_ip": {
"credentialRef": "amap-key.json",
"InvokeContext": {
"path": "/v3/ip",
"method": "GET"
}
}
}
}
This configuration describes the relevant parameter information for Amap's HTTP API, as well as the contextual information needed by Higress during protocol conversion.
Next, create a configuration item with DataId "amap-key.json," grouped as "amap," with the configuration content as follows:
{
"type": "fixed-query-token",
"credentialsMap": {
"key": "key",
"value": "api key of Amap"
}
}
Register a service to obtain the current export IP. For example, use ipinfo.io to create a service named "ip" in the service management, grouped as "ip":
curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=ip&groupName=ip&ip=ipinfo.io&port=80&ephemeral=false'
After registration, you will see an instance under the IP service in the Nacos console.
After the service is created, we configure the interface description for the IP retrieval service in the configuration center.Create a DataId "ip-mcp-tools.json," grouped as "ip," with the configuration content as follows:
{
"protocol": "http",
"tools": [
{
"name": "get_current_ip_address",
"description": "get current caller's ip address",
"inputSchema": {
"type": "object",
"properties": {
"empty_args": {
"type": "string",
"description": "should be empty"
}
}
}
}
],
"toolsMeta": {
"get_current_ip_address": {
"InvokeContext": {
"path": "/",
"method": "GET"
}
}
}
}
After the configuration is created, Higress can be set up in Cursor to call the Tool as the MCP Server.
The specific configuration method for Cursor is as follows: first, install the latest version of Cursor. After installation, configure the specific information of the MCP Server in Cursor's settings.
{
"mcpServers": {
"nacos-registry": {
"url": "http://localhost/registry/sse"
}
}
}
After configuration is complete, you should see the Tools provided by the MCP Server exposed via Higress + Nacos.
Next, we ask the agent how the weather is today in agent mode.
As observed, the agent first retrieves the current host's export IP, then uses the IP to obtain specific provincial and city information, retrieves the adcode via this information, and finally fetches the current weather information using the adcode.
During the entire process, users only need to register the service in Nacos and configure the relevant description information for the service interfaces in Nacos without requiring any changes to the service's actual code.
Using the Nacos+Higress solution to achieve zero-code transformation connects the Agent to existing applications, significantly reducing the transformation cost for legacy applications.
Currently, users need to manually configure interface description information, which can later be simplified through toolization, allowing users to make minor adjustments only. In reality, we have numerous legacy services and interfaces. According to the mapping from interfaces to Tools, we will end up with many Tools. When the Agent pulls the Tool list and passes it to the model, it can lead to significant token consumption and possibly degrade the model's performance.
Thus, how to delineate an effective Tool list within the context and return it to the Agent will be one of our important directions for future evolution.
In addition to Tools, the MCP protocol includes Prompts, Resources, etc. The MCP community is also continuously updating the protocol, and we will support these gradually in the future to aid the development of the MCP ecosystem.
The Nacos 3.0 architecture has officially released its version, positioning itself as an AI application service management platform that includes dynamic management of MCP. It also covers general AI ecological scenarios, including model parameters, dynamic templates for Prompts, and more to help businesses manage dynamically and take effect in real-time. The Nacos community has a comprehensive multi-language client ecosystem, with mature adaptations for mainstream programming languages such as Python, Go, Rust, Java, and NodeJS, enabling you to build AI applications quickly at minimal cost.
As Nacos evolves, more AI-related capabilities will be introduced. We hope everyone will continue to participate in building the Nacos community. Nacos 3.0 welcomes community contribution!
Nacos-Controller 2.0: Efficiently Manage Your K8s Configuration with Nacos
Compile-time Instrumentation: The Optimal Choice for Monitoring Go Applications
552 posts | 53 followers
FollowAlibaba Cloud Native Community - April 9, 2025
Alibaba Cloud Native Community - April 15, 2025
Alibaba Cloud Native Community - April 3, 2025
Alibaba Cloud Native Community - April 18, 2025
Alibaba Cloud Native - September 8, 2022
Alibaba Cloud Native Community - April 16, 2025
552 posts | 53 followers
FollowAccelerate AI-driven business and AI model training and inference with Alibaba Cloud GPU technology
Learn MoreTop-performance foundation models from Alibaba Cloud
Learn MoreOffline SDKs for visual production, such as image segmentation, video segmentation, and character recognition, based on deep learning technologies developed by Alibaba Cloud.
Learn MoreSelf-service network O&M service that features network status visualization and intelligent diagnostics capabilities
Learn MoreMore Posts by Alibaba Cloud Native Community