Skip to content

Adding a ssl_verify flag to the sse_client asynccontextmanager function in the sse client library #505

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

Closed

Conversation

adrianwebb
Copy link

This pull request adds an optional ssl_verify parameter that defaults to true in the SSE client so that development can be conducted using servers running on HTTPS but with self signed certificates.

Motivation and Context

I have a need to test locally on servers running self signed certificates and I kept getting self signed verification issues and it did not seem to be possible to skip verification without adding a parameter to the httpx AsyncClient. When I added this parameter everything worked as expected.

How Has This Been Tested?

This pull request does not make material changes to the functionality itself outside of configurability of the httpx client objects for SSE but I have run all the tests, linting, and format checks outlined in the CONTRIBUTING text. Everything works as expected.

Breaking Changes

This pull request does not introduce any breaking changes. It just adds an extra parameter at the end of the sse_client function prototype.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • [x ] I have read the MCP Documentation
  • [x ] My code follows the repository's style guidelines
  • [x ] New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This is a feature easily found by looking at the function definition and there was no direct documentation section but I am happy to add documentation if needed in other repositories. Since this change does not alter the implementation of the MCP Python SDK itself, but instead passes an extra parameter to the httpx client instantiator, there was no error handling to update that does not already exist.

Copy link

@mcp-shadow mcp-shadow bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, I'm closing this PR as it duplicates functionality already proposed in PR #415, which is currently in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant