{"record":{"id":"1fdd53758f5568ed","repo":"iflytek/astron-agent","slug":"list-mcp-plugin-url-is-not-set","errorCode":null,"errorMessage":"LIST_MCP_PLUGIN_URL is not set","messagePattern":"LIST_MCP_PLUGIN_URL is not set","errorType":"exception","errorClass":"GetMcpPluginExc","httpStatus":null,"severity":"error","filePath":"core/agent/service/plugin/mcp.py","lineNumber":157,"sourceCode":"                mcp_plugins.append(mcp_plugin)\n        return mcp_plugins\n\n    async def query_servers(self, span: Span) -> list[dict]:\n        with span.start(\"QueryServers\") as sp:\n            data = {\n                \"sid\": sp.sid,\n                \"mcp_server_ids\": self.mcp_server_ids,\n                \"mcp_server_urls\": self.mcp_server_urls,\n            }\n            sp.add_info_events(\n                attributes={\n                    \"mcp-query-servers-inputs\": json.dumps(data, ensure_ascii=False)\n                }\n            )\n            try:\n                list_url = os.getenv(\"LIST_MCP_PLUGIN_URL\")\n                if not list_url:\n                    raise GetMcpPluginExc(\"LIST_MCP_PLUGIN_URL is not set\")\n                async with aiohttp.ClientSession() as session:\n                    timeout = aiohttp.ClientTimeout(total=40)\n                    async with session.post(\n                        list_url,\n                        json=data,\n                        timeout=timeout,\n                    ) as response:\n                        response.raise_for_status()\n                        if response.status == 200:\n                            resp = await response.json()\n                            sp.add_info_events(\n                                attributes={\n                                    \"mcp-plugin-list-outputs\": json.dumps(\n                                        resp, ensure_ascii=False\n                                    )\n                                }\n                            )\n                        else:","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/agent/service/plugin/mcp.py#L139-L175","documentation":"GetMcpPluginExc raised in McpPlugin.query_servers (mcp.py:157). Before listing MCP servers, the code reads LIST_MCP_PLUGIN_URL from the environment; if unset or empty it raises 'LIST_MCP_PLUGIN_URL is not set' (code 40026). It is a deployment/configuration failure, raised before any network I/O.","triggerScenarios":"Building the agent's tool list (build_tools -> query_servers) in a process where LIST_MCP_PLUGIN_URL was never set.","commonSituations":"Missing env entry in docker compose / Helm values, .env file not mounted, variable name typo, or MCP plugin feature enabled without its endpoint configured.","solutions":["Set LIST_MCP_PLUGIN_URL (e.g. http://mcp-plugin:8080/list) in the agent service environment and restart.","Add it to the compose/Helm config alongside RUN_MCP_PLUGIN_URL so both MCP endpoints are provisioned together.","Add a boot-time check that asserts both MCP URL env vars exist when MCP tools are enabled."],"exampleFix":"// before (helm values)\nagent:\n  env:\n    RUN_MCP_PLUGIN_URL: http://mcp-plugin:8080/run\n// after\nagent:\n  env:\n    RUN_MCP_PLUGIN_URL: http://mcp-plugin:8080/run\n    LIST_MCP_PLUGIN_URL: http://mcp-plugin:8080/list","handlingStrategy":"validation","validationCode":"list_url = os.getenv(\"LIST_MCP_PLUGIN_URL\")\nif not list_url:\n    raise RuntimeError(\"LIST_MCP_PLUGIN_URL must be set to build MCP tools\")","typeGuard":null,"tryCatchPattern":"try:\n    servers = await mcp_plugin.query_servers(span)\nexcept GetMcpPluginExc as e:\n    if \"not set\" in str(e):\n        logger.critical(\"MCP listing not configured: %s\", e)\n    raise","preventionTips":["Provision LIST_MCP_PLUGIN_URL together with RUN_MCP_PLUGIN_URL in every environment","Add a boot-time assertion for required MCP env vars","Keep .env.example and Helm values in sync with the code's env expectations","Reference env var names via a single constants module"],"tags":["mcp","plugin","configuration","environment"],"backgroundTag":"missing-env-var","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}