Token team_id extraction and usage for APIs#1460
Merged
Conversation
fd50da9 to
5eeac74
Compare
rakdutta
approved these changes
Nov 19, 2025
Collaborator
rakdutta
left a comment
There was a problem hiding this comment.
Registration for the gateway, virtual server, tools, prompts, and resources works as expected, and the team ID is correctly populated from the token. However, during REST tool creation, the API response still shows team = null, even though the team ID is correct.
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
d881808 to
a0fe6de
Compare
madhav165
approved these changes
Nov 19, 2025
Collaborator
madhav165
left a comment
There was a problem hiding this comment.
Merging after rebase. It allows team_id to be read from the JWT as requested by WxO team.
kcostell06
pushed a commit
to kcostell06/mcp-context-forge
that referenced
this pull request
Feb 24, 2026
Token team_id extraction and usage for APIs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Bug-fix PR
📌 Summary
Closes #1453
Instead of manually providing the team_id in the API requests, if the token has a team-level scope, extract the team_id directly from the token and use it for the relevant API calls.
🔁 Reproduction Steps
After this change:
The added server will be created under the team corresponding to the token used for the API call.
This is implemented for MCP servers, virtual servers, tools, prompts, resources.
🐞 Root Cause
When team_id is not provided, the team for the added resource is defaulted to the default personal team of the user, which should not happen as the token is used only for a specific team.
💡 Fix Description
Major changes in create and list APIs for all resources.
🧪 Verification
make lintmake testmake coverage📐 MCP Compliance (if relevant)
✅ Checklist
make black isort pre-commit)