list_listened_configs
Retrieve configurations subscribed to by a specific client IP address to monitor active listeners and their namespace settings.
Instructions
This interface lists the configurations subscribed to by a specific client IP address.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | The namespaceId of configs, default is `public` if missing | |
| ip | Yes | The client ip of config listeners, Required. | |
| aggregation | No | Whether aggregation from whole cluster, if `false`, only get listeners from requested node, default `true` if missing |
Implementation Reference
- src/mcp_server_nacos/server.py:132-135 (handler)Executes the list_listened_configs tool by instantiating the tool class to get the Nacos API URL, then calling nacos.get() to perform the HTTP GET request with arguments and return the result as text content.case nacos_tools.NacosToolNames.LIST_LISTENED_CONFIGS: url = nacos_tools.NacosListListenedConfigs().url result = nacos.get(name, url, arguments) return [types.TextContent(type="text", text=result)]
- Defines the MCP Tool object for 'list_listened_configs' including name, description, input schema (namespaceId optional, ip required, aggregation optional), and the target Nacos API endpoint.class NacosListListenedConfigs(NacosTool): def __init__(self): super().__init__( name=NacosToolNames.LIST_LISTENED_CONFIGS, description="This interface lists the configurations subscribed to by a specific client IP address.", inputSchema={ "type": "object", "properties": { "namespaceId": {"type": "string", "description": "The namespaceId of configs, default is `public` if missing"}, "ip": {"type": "string", "description": "The client ip of config listeners, Required."}, "aggregation": {"type": "bool", "description": "Whether aggregation from whole cluster, if `false`, only get listeners from requested node, default `true` if missing"} }, "required": ["ip"], }, url="/nacos/v3/admin/cs/listener" )
- src/mcp_server_nacos/server.py:71-86 (registration)Registers the list_listened_configs tool (via NacosListListenedConfigs instance) in the MCP server's list_tools handler, making it available to clients.@server.list_tools() async def handle_list_tools() -> list[types.Tool]: """List available tools""" return [ nacos_tools.NacosListNamespacesTool(), nacos_tools.NacosListServices(), nacos_tools.NacosGetService(), nacos_tools.NacosListInstances(), nacos_tools.NacosListServiceSubscribers(), nacos_tools.NacosListConfigs(), nacos_tools.NacosGetConfig(), nacos_tools.NacosListConfigHistory(), nacos_tools.NacosGetConfigHistory(), nacos_tools.NacosListConfigListeners(), nacos_tools.NacosListListenedConfigs(), ]
- Defines the tool name constant in NacosToolNames enum, used for matching in handler and registration.LIST_LISTENED_CONFIGS = "list_listened_configs",