-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Dynamic Tool Registration Based on Authentication Context #836
Copy link
Copy link
Open
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implementv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implementv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature Request: Dynamic Tool Registration Based on Authentication Context
Is your feature request related to a problem? Please describe.
The MCP server only supports static tool registration at startup or based on notifications which requires session management. This forces applications that need user-specific tools to either:
We need to provide different tools based on the authenticated user's permissions and context.
Describe the solution you'd like
Add a dynamic tool registration mechanism that allows tools to be discovered at runtime based on authentication context:
Describe alternatives you've considered
Current Workaround: Override
listToolsandcallToolhandlers, access private_registeredToolswith@ts-expect-error, duplicate schema conversion logic.Notifications Approach: I know it's possible to achieve this using MCP notifications, but that requires implementing session management which adds significant complexity that do not overlap with the vision of making MCP server simple using HTTP Streamable API.
Additional context
We currently use this for dynamic actions based on user permissions in our Port platform. The workaround works but is fragile and duplicates logic that should be handled by the SDK.