Skip to content

Conversation

@VedantMadane
Copy link

Summary

This PR improves the Python MCP Streamable HTTP connector to fail fast on authentication / authorization issues.

  • Adds a preflight request in MCPStreamableHttpPlugin.__aenter__ and raises KernelPluginInvalidConfigurationError on HTTP 401/403.
  • Raises for other non-success HTTP responses early to surface configuration/network issues quickly.

Why

When credentials or permissions are misconfigured, the server returns 401/403 and the plugin should error clearly and immediately, instead of failing later during session setup.

Tests

  • Added unit tests that mock httpx.AsyncClient:
    • 401/403 raises KernelPluginInvalidConfigurationError
    • 200 proceeds successfully

Related

  • microsoft/semantic-kernel#13414

@VedantMadane VedantMadane requested a review from a team as a code owner January 18, 2026 08:57
@moonbox3 moonbox3 added the python Pull requests for the Python Semantic Kernel label Jan 18, 2026
@VedantMadane
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants