agentscope-ai / agentscope-ai/agentscope
[Feature]: Support OAuth dynamic auth for streamableHTTP MCP transport
- Vorherrschende Sprache
- Python
- Sterne
- 31.5k
- Forks
- 3.5k
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 95
Beschreibung
Is your feature request related to a problem? Please describe.
Yes. Currently the AgentScope MCP (Model Context Protocol) client for streamableHTTP transport only supports static authentication credentials (e.g. hardcoded API keys) when connecting to MCP servers. There is no built-in support for dynamic OAuth 2.0 authentication workflows, which are mandatory for most SaaS-provided MCP services (such as official Feishu/Lark, Notion, Google Workspace MCP integrations).
For example, when I try to connect to a self-hosted Feishu MCP server, the OAuth access token issued by Feishu only has a 2-hour validity period. Since AgentScope does not support automatic token refresh, I have to manually update the credential in the configuration and restart the AgentScope service every 2 hours, which is extremely inefficient and will interrupt running agent tasks in production environments. I'm always frustrated when my production agent workflow fails unexpectedly due to expired OAuth tokens.
Describe the solution you'd like
I hope AgentScope adds native support for dynamic OAuth 2.0 authentication for streamableHTTP type MCP clients, with the following capabilities:
Out-of-the-box support for common OAuth 2.0 grant types (Client Credentials flow, Authorization Code flow with refresh token support), so users only need to fill in basic OAuth configuration items (client ID, client secret, token endpoint, refresh token, etc.) without writing extra custom code.
Expose a customizable token fetch/refresh callback interface, so users can implement custom authentication logic for service providers with non-standard OAuth flows.
Add automatic token expiration detection and pre-refresh logic, which automatically refreshes the token before sending requests to the MCP server, no manual intervention required.
Keep full backward compatibility with existing static authentication configurations, so existing users' configurations will not be broken after the feature is released.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.