langgenius / langgenius/dify

MCP provider deletion still sends provider_id in a DELETE request body

Open Beginner friendly
#42,218 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

### Self Checks

- [x] I have read the Contributing Guide and Language Policy.
- [x] I have searched for existing issues and pull requests, including closed ones.
- [x] I confirm that I am using English to submit this report.

### Dify version

main

### Cloud or Self Hosted

Both

### Problem

The Web MCP provider delete hook still sends `provider_id` in a DELETE request body:

```ts
del('/workspaces/current/tool-provider/mcp', {
body: { provider_id: id },
})
```

This leaves the browser path vulnerable to intermediaries that drop DELETE request bodies. Adjacent model credential DELETE paths were moved to query parameters in #42162 for the same transport reason.

### Runtime contract

Dify's shared `@model_validate` handling already reads DELETE query parameters first and falls back to a JSON body. The backend therefore already accepts:

```text
DELETE /console/api/workspaces/current/tool-provider/mcp?provider_id=
```

without removing compatibility for older body-based callers.

### Expected behavior

`useDeleteMCP()` should send `provider_id` through request query params rather than the DELETE body.

### Proposed bounded scope

- change the Web MCP delete hook from `body` to `params`;
- add a focused service-hook regression test that asserts the request shape;
- leave backend/service behavior unchanged.

The endpoint's OpenAPI annotation still describes the legacy DELETE body shape. That contract cleanup can be handled separately with generated-contract regeneration; it is not required for the browser runtime fix because DELETE query parsing is already supported upstream.

I have the scoped change ready.

Contributor guide

Open the contributing guide

Research direction

Start at the Web MCP useDeleteMCP() hook and inspect the adjacent model credential DELETE changes from #42162 for the established request shape. Change the hook to send provider_id as query params, then add a focused service-hook regression test that verifies the request uses params rather than a DELETE body.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.