Skip to content

How to protect tools #16

Answered by kargnas
psociety asked this question in Q&A
Discussion options

You must be logged in to vote

Since the streamable HTTP and the SSE are not for web browsers, the normal auth module won't work.

My idea is that you add an argument in the function names auth_token and send the user auth token when your agent calls the MCP tool.

Then you can auth the user using the token inside execute().

To filter the tool list, you can create a middleware that set an array config of tool list with authentication.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kargnas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants