Skip to content

Header propagation #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

robinevers93
Copy link
Contributor

Hello!

I'm writing an MCP server which has a requirement to do an auth check on each tool call.
The recommended way to implement this is by letting the MCP client handle obtaining the token, and passing the token from the MCP client to the MCP server through the header.

I have implemented a proposed solution to provide support in chimp for this. There are two main changes in my suggestion:

  1. The mcpEndpoint method takes an optional name of the header (defaulted to no header).
  2. A handleWithHeader method is added in which the logic takes in the value of the header as a parameter.

I included unit tests for my changed and added an example on how it can be used.

I also recorded a video to show it working, I'll attach it to the PR.

chimp-with-header-propagation.mov

Thanks a lot for considering this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant