You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current MCPToolkit class does not support adding authorization headers in SSE connections, making it impossible to connect to MCP servers that require authentication. When attempting to connect to protected MCP server endpoints, the connection is rejected (typically with a 401 error) due to the inability to provide authentication credentials.
Solution
The current MCPToolkit class does not support adding authorization headers in SSE connections, making it impossible to connect to MCP servers that require authentication. When attempting to connect to protected MCP server endpoints, the connection is rejected (typically with a 401 error) due to the inability to provide authentication credentials.
Current Code Limitations
In the camel/toolkits/mcp_toolkit.py file, the connection method establishes connections using sse_client without providing an option to pass authentication headers:
This feature is essential for connecting to MCP servers that require API keys, OAuth tokens, or other forms of authentication. Typical use cases include:
Secure API access in enterprise environments
Public API services requiring access control
User authentication in multi-tenant environments
Example Usage
After implementation, client code would be able to use it as follows:
It's necessary to confirm whether the underlying sse_client function supports a headers parameter. If not, deeper code modifications might be required.
Thank you for considering this feature request!
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Required prerequisites
Motivation
The current MCPToolkit class does not support adding authorization headers in SSE connections, making it impossible to connect to MCP servers that require authentication. When attempting to connect to protected MCP server endpoints, the connection is rejected (typically with a 401 error) due to the inability to provide authentication credentials.
Solution
The current
MCPToolkit
class does not support adding authorization headers in SSE connections, making it impossible to connect to MCP servers that require authentication. When attempting to connect to protected MCP server endpoints, the connection is rejected (typically with a 401 error) due to the inability to provide authentication credentials.Current Code Limitations
In the
camel/toolkits/mcp_toolkit.py
file, theconnection
method establishes connections usingsse_client
without providing an option to pass authentication headers:This prevents adding necessary authentication information, such as Bearer tokens, to the SSE connection.
Proposed Implementation
I suggest adding support for authentication headers in the
MCPToolkit
class with the following changes:headers
parameter to the constructor:sse_client
in theconnection
method:Use Cases
This feature is essential for connecting to MCP servers that require API keys, OAuth tokens, or other forms of authentication. Typical use cases include:
Example Usage
After implementation, client code would be able to use it as follows:
Technical Notes
It's necessary to confirm whether the underlying
sse_client
function supports aheaders
parameter. If not, deeper code modifications might be required.Thank you for considering this feature request!
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: