Skip to content

feat: add TLS configuration support to consolidated GrafanaConfig #175

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

Merged
merged 1 commit into from
Jun 19, 2025

Conversation

sd2k
Copy link
Collaborator

@sd2k sd2k commented Jun 12, 2025

This commit adds TLS configuration capabilities to the consolidated GrafanaConfig struct, allowing custom certificates for all HTTP clients used by the MCP server.

Changes:

  • Add TLSConfig struct with CertFile, KeyFile, CAFile, and SkipVerify fields
  • Integrate TLSConfig into GrafanaConfig struct
  • Add TLS CLI flags to cmd/mcp-grafana/main.go
  • Update all HTTP clients (Grafana, Incident, Loki, Prometheus, Sift, Asserts) to use custom TLS configuration when available
  • Add TLS helper methods: CreateTLSConfig() and HTTPTransport()
  • Include TLS example and test files
  • Update README with comprehensive TLS configuration documentation

The TLS configuration is applied consistently across all clients, providing a unified approach to certificate management for secure Grafana environments.

Fixes #164.
Fixes #72.

@sd2k sd2k requested a review from a team as a code owner June 12, 2025 09:30
@sd2k sd2k marked this pull request as draft June 12, 2025 09:31
@sd2k
Copy link
Collaborator Author

sd2k commented Jun 12, 2025

Whoops, noticed some merge conflict markers, fixing

This commit adds TLS configuration capabilities to the consolidated
GrafanaConfig struct, allowing custom certificates for all HTTP clients
used by the MCP server.

Changes:
- Add TLSConfig struct with CertFile, KeyFile, CAFile, and SkipVerify fields
- Integrate TLSConfig into GrafanaConfig struct
- Add TLS CLI flags to cmd/mcp-grafana/main.go
- Update all HTTP clients (Grafana, Incident, Loki, Prometheus, Sift, Asserts)
  to use custom TLS configuration when available
- Add TLS helper methods: CreateTLSConfig() and HTTPTransport()
- Include TLS example and test files
- Update README with comprehensive TLS configuration documentation

The TLS configuration is applied consistently across all clients, providing
a unified approach to certificate management for secure Grafana environments.
@sd2k sd2k marked this pull request as ready for review June 12, 2025 10:05
@sd2k sd2k added the enhancement New feature or request label Jun 12, 2025
Copy link

@gerboland gerboland left a comment

Choose a reason for hiding this comment

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

This appears to work for me, and code looks sensible.

@sd2k sd2k merged commit 4f7f9b4 into main Jun 19, 2025
12 checks passed
@sd2k sd2k deleted the tls-config branch June 19, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants