-
Notifications
You must be signed in to change notification settings - Fork 56
feat: accept endpoint and headers from mcp client #7
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
feat: accept endpoint and headers from mcp client #7
Conversation
|
Thanks! I do think we should stress in the description/name of the tool input that they're additional, otherwise models might keep filling in those fields while they're optional. Same for potential headers, should let them know which headers are already used |
|
I did some research, and according to the mcp spec, parameters can have a description. It seems good to add an explanation such as 'Optional: Override the default endpoint' to the parameters. When I tried it like this, it was successfully added to the parameter: What do you think? |
|
Ah good one, way better! Would also add a stringified json of the already configured headers so it knows whether it needs to override |
|
Is it correct that you mean adding the current header to headers.describe? If you could share a bit more of a concrete idea, I can work on this together with the previous comment. IMO, it might be a good idea to set up a tool like getCurrentConfig that returns the configuration currently set on the mcp-client side. |
|
Yeah so my idea would be: .describe(`Optional: Add additional headers, the already used headers are: ${JSON.stringify(config.headers)}`)Also in regards to setting up a config tool, I'm actually not sure whether MCP clients already get this information directly. Will check that out but can always add it in a separate PR. |
|
Thanks! Merging and will release asap |

Related Issues
#6
Summary
In this PR, I modify the mcp-graphql's mcp-server to allow receiving headers and endpoints from the mcp-client.
With this change, even if the MCP Client deploys the GraphQL server to some BaaS, it will be able to send requests without modifying the mcp-graphql configuration.