Bug: server identifier returned instead of provider ID in console API workspaces/current/tools/mcp #21998

Open
opened 2026-02-21 20:15:12 -05:00 by yindo · 1 comment
Owner

Originally created by @ThomasETN on GitHub (Jan 30, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.3

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Call console API for the list of MCP servers /console/api/workspaces/current/tools/mcp.
  2. Inspect the response, notice that on every single entry field id is the same as field server_identifier.
  3. Inspect the file class ToolMCPListAllApi, notice that the function list_providers always return object where ID is server_identifier.
Image

✔️ Expected Behavior

The id field in each MCP server entry should be the provider ID.

Otherwise we cannot make use of other APIs such as /workspaces/current/tool-provider/mcp/update/<path:provider_id>, since we have no way to obtain the provider ID (without removing and adding the MCP server instance).

Actual Behavior

  • The id and server_identifier fields are effectively the same.
  • We have no way of obtaining the provider ID without removing and re-adding MCP servers.
  • As such we cannot easily make use of related APIs that depends on provider ID.
Originally created by @ThomasETN on GitHub (Jan 30, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.3 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1. Call console API for the list of MCP servers `/console/api/workspaces/current/tools/mcp`. 2. Inspect the response, notice that on every single entry field `id` is the same as field `server_identifier`. 3. Inspect the file class `ToolMCPListAllApi`, notice that the function `list_providers` always return object where ID is `server_identifier`. <img width="1886" height="2337" alt="Image" src="https://github.com/user-attachments/assets/1b16df31-8ffc-4673-bfad-7839f94926dc" /> ### ✔️ Expected Behavior **The `id` field in each MCP server entry should be the provider ID.** Otherwise we cannot make use of other APIs such as `/workspaces/current/tool-provider/mcp/update/<path:provider_id>`, since we have no way to obtain the provider ID (without removing and adding the MCP server instance). ### ❌ Actual Behavior - The `id` and `server_identifier` fields are effectively the same. - We have no way of obtaining the provider ID without removing and re-adding MCP servers. - As such we cannot easily make use of related APIs that depends on provider ID.
yindo added the 🐞 bug label 2026-02-21 20:15:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2026):

Hi @ThomasETN! I'm Dosu and I’m helping the dify team.

The bug is caused by the /console/api/workspaces/current/tools/mcp endpoint calling MCPToolManageService.list_providers without setting for_list=True, so the id field in each entry is the server_identifier instead of the provider ID. To fix this, update the endpoint to call:

tools = service.list_providers(tenant_id=tenant_id, include_sensitive=False, for_list=True)

This change will ensure the API returns the provider ID in the id field, which is required for related endpoints like /workspaces/current/tool-provider/mcp/update/<provider_id> source.

There are no known side effects, as other endpoints already use provider IDs and the transform logic is designed to handle both cases source. Until this is fixed, the only workaround is to manually query the database for provider IDs or re-add MCP servers.

This issue is tracked in #31763.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 30, 2026): <!-- Greeting --> Hi @ThomasETN! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The bug is caused by the `/console/api/workspaces/current/tools/mcp` endpoint calling `MCPToolManageService.list_providers` without setting `for_list=True`, so the `id` field in each entry is the `server_identifier` instead of the provider ID. To fix this, update the endpoint to call: ```python tools = service.list_providers(tenant_id=tenant_id, include_sensitive=False, for_list=True) ``` This change will ensure the API returns the provider ID in the `id` field, which is required for related endpoints like `/workspaces/current/tool-provider/mcp/update/<provider_id>` [source](https://github.com/langgenius/dify/blob/ba568a634d107fe3329393627183e1346ac136fd/api/controllers/console/workspace/tool_providers.py#L1138-L1152). There are no known side effects, as other endpoints already use provider IDs and the transform logic is designed to handle both cases [source](https://github.com/langgenius/dify/blob/ba568a634d107fe3329393627183e1346ac136fd/api/services/tools/tools_transform_service.py#L230-L263). Until this is fixed, the only workaround is to manually query the database for provider IDs or re-add MCP servers. This issue is tracked in [#31763](https://github.com/langgenius/dify/issues/31763). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/87933f3a-77a4-4e64-aa29-44c5b5fca057?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20bug%20is%20caused%20by%20the%20%60/console/api/workspaces/current/tools/mcp%60%20endpoint%20calling%20%60MCPToolManageService.list_providers%60%20without%20setting%20%60for_list%3DTrue%60%2C%20so%20the%20%60id%60%20field%20in%20each%20entry%20is%20the%20%60server_identifier%60%20instead%20of%20the%20provider%20ID.%20To%20fix%20this%2C%20update%20the%20endpoint%20to%20call%3A%0A%0A%60%60%60python%0Atools%20%3D%20service.list_providers%28tenant_id%3Dtenant_id%2C%20include_sensitive%3DFalse%2C%20for_list%3DTrue%29%0A%60%60%60%0A%0AThis%20change%20will%20ensure%20the%20API%20returns%20the%20provider%20ID%20in%20the%20%60id%60%20field%2C%20which%20is%20required%20for%20related%20endpoints%20like%20%60/workspaces/current/tool-provider/mcp/update/%3Cprovider_id%3E%60%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/ba568a634d107fe3329393627183e1346ac136fd/api/controllers/console/workspace/tool_providers.py%23L1138-L1152%29.%0A%0AThere%20are%20no%20known%20side%20effects%2C%20as%20other%20endpoints%20already%20use%20provider%20IDs%20and%20the%20transform%20logic%20is%20designed%20to%20handle%20both%20cases%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/ba568a634d107fe3329393627183e1346ac136fd/api/services/tools/tools_transform_service.py%23L230-L263%29.%20Until%20this%20is%20fixed%2C%20the%20only%20workaround%20is%20to%20manually%20query%20the%20database%20for%20provider%20IDs%20or%20re-add%20MCP%20servers.%0A%0AThis%20issue%20is%20tracked%20in%20%5B%2331763%5D%28https%3A//github.com/langgenius/dify/issues/31763%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31763)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21998