-
Notifications
You must be signed in to change notification settings - Fork 614
[BUG]: Gateway creation under team scope returns team id as null #1453
Copy link
Copy link
Description
🐞 Bug Summary
When making API calls to add resources (e.g., MCP servers, virtual servers, tools) using a team-level scoped token, the team_id is not being automatically extracted from the token. Instead, the resource is added to the default personal team of the user, even though the token is scoped for a specific team.
🧩 Affected Component
Select the area of the project impacted:
-
mcpgateway- API -
mcpgateway- UI (admin panel) -
mcpgateway.wrapper- stdio wrapper - Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
🔁 Steps to Reproduce
- Use the POST /gateways API to add an MCP server to the gateway, but do not include the team_id parameter in the request body.
- Use a team-level scoped token for the API call.
- Observe that the server is added to the default personal team of the user, rather than the team associated with the token.
🤔 Expected Behavior
When the team_id is not explicitly provided, the API should extract the team_id from the team-level scoped token and use it to associate the resource with the correct team, rather than defaulting to the user's personal team.
🧠 Environment Info
You can retrieve most of this from the /version endpoint.
| Key | Value |
|---|---|
| Version or commit | e.g. v0.9.0 or main@a1b2c3d |
| Runtime | e.g. Python 3.11, Gunicorn |
| Platform / OS | e.g. Ubuntu 22.04, macOS |
| Container | e.g. Docker, Podman, none |
🧩 Additional Context (optional)
Add any configuration details, flags, or related issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working