Skip to content

Conversation

@daniel-lxs
Copy link
Contributor

🧪 Evaluation PR for Testing

This is an automated test PR created for evaluation purposes.


Summary

This PR addresses Issue #8355 by adding certificate trust configuration support for MCP servers using HTTPS connections (SSE and StreamableHTTP transports).

Problem

MCP servers using self-signed or internal CA-signed certificates cannot be used because there's no way to specify trust information for these certificates. This prevents users from connecting to MCP servers in development environments or corporate networks with internal certificate authorities.

Solution

Added a certificateTrust configuration option for SSE and StreamableHTTP server types with three settings:

  • allowSelfSigned: Allow self-signed certificates (for development)
  • caCertPath: Path to custom CA certificate file (for internal CAs)
  • rejectUnauthorized: Control certificate validation (defaults to true for security)

Changes

  • ✅ Added CertificateTrustSchema to validate certificate trust configuration
  • ✅ Implemented HTTPS agent configuration for SSE transport using custom fetch
  • ✅ Implemented HTTPS agent configuration for StreamableHTTP transport
  • ✅ Added comprehensive test coverage for all configuration scenarios
  • ✅ Created detailed documentation with examples and security considerations

Testing

  • All existing tests pass
  • Added 6 new test cases covering certificate trust configuration
  • TypeScript type checking passes
  • Linting passes

Security Considerations

  • Defaults to secure settings (rejectUnauthorized: true)
  • Documentation includes clear warnings about development-only settings
  • Proper error handling for certificate file loading

Documentation

Added comprehensive documentation in docs/mcp-certificate-trust.md including:

  • Configuration examples for all scenarios
  • Security best practices
  • Certificate format conversion instructions
  • Troubleshooting guide

roomote and others added 19 commits September 28, 2025 18:43
- Add certificateTrust configuration options for SSE and StreamableHTTP transports
- Support allowSelfSigned, caCertPath, and rejectUnauthorized options
- Implement HTTPS agent configuration for Node.js fetch operations
- Add comprehensive tests for certificate trust configuration
- Add documentation explaining usage and security considerations

Fixes #8355
- Use spread operator with type assertion for Node.js-specific agent property
- Ensures compatibility with standard RequestInit type while allowing HTTPS agent
- Certificate trust settings only apply to SSE and StreamableHTTP transports
- STDIO transport servers do not use HTTPS and therefore don't need certificate configuration
- The configuration requires Node.js environment; browser-based implementations may have different requirements
- Test webhook commit 17
Copy link

Choose a reason for hiding this comment

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

The documentation contains a test commit message - Test webhook commit 17 that should be removed before merging to production.

@daniel-lxs daniel-lxs closed this Oct 9, 2025
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.

3 participants