-
Notifications
You must be signed in to change notification settings - Fork 54
LCORE-312: Support MCP Headers #202
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
Conversation
b874043 to
31b367c
Compare
manstis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I think there's a small flaw in part of your logic.
Have a look and let me know where I've misunderstood 🤣
umago
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, left a question inline
manstis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
issue: https://issues.redhat.com/browse/LCORE-312 this supports the client providing the headers to supply to mcp servers via llama-stack in the form of a dictionary like mcp_headers = { "mcp-server-url-1": {"HEADER-1": "HEADER-1-VALUE-1", "HEADER-1": "HEADER-1-VALUE-2"}, "mcp-server-url-2": {"HEADER-2": "HEADER-2-VALUE"} } Signed-off-by: Djebran Lezzoum <ldjebran@gmail.com>
|
@umago Did you want another look to approve before this is merged? |
umago
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
Sorry, just took another look at the patch. It LGTM! Thank you |
tisnik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good, thank you
Description
issue: https://issues.redhat.com/browse/LCORE-312
this supports the client providing the headers to supply to mcp servers via llama-stack in the form of a dictionary like:
{
"mcp-server-url-1": {"HEADER-1": "HEADER-1-VALUE-1", "HEADER-1": "HEADER-1-VALUE-2"},
"mcp-server-url-2": {"HEADER-2": "HEADER-2-VALUE"}
}
Suppose each different mcp server support it's own authentication type, or needs some headers to be supplied, this PR will allow to fine tune which headers may be passed to which mcp server.
For the moment did not moved the extra_headers to create_turn function as the AsyncAgent is not supporting that.
moved the toolgroups to create_turn function as when declared at the agent, the headers are not sent to mcp servers the first time llama-stack is listing the tools from mcp servers, that may lead to authentication failure.
The optimal is to move also the headers to be declared in create_turn function and not at the agent level, but this should be done in it's own task ticket. as we weed to implement the same for AsyncAgent. This will allow us to have one agent instance for all sessions and remove the agent caching.
Type of change
Related Tickets & Documents
Checklist before requesting a review
Testing
Tested with 2 mcp servers that support authentication, the mcp servers does not allow tools listing without authentication too, put in configuration file lightspeed-stack.yaml
The llama-stack was running as an external service by default using model "granite-3.3-8b-instruct" via vllm container runing in openshift
Created 2 scripts one for streaming and one for non streaming endpoints:
lightspeed-stack-mco-headers-2025-07-08.at.11.17.03.mp4