[FEATURE] RemoteMCPServer: trust a custom CA for the upstream MCP server

Aperta
#3,662 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
security

Direzione di ricerca

Start from spec.tls on RemoteMCPServer and the commented-out caCertSecretRef in TLSConfig, then check how controller tool discovery builds its trusted roots. The issue leaves open which part belongs in kagent and which in the Substrate gateway, so settle that split with maintainers (see #3258) before writing code. Done means a CA referenced from a ConfigMap or Secret is trusted during discovery and tool calls, with verification still on.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

📋 Prerequisites
📝 Feature Summary

Let a RemoteMCPServer name a CA bundle (Secret or ConfigMap) that the components connecting to it trust, so MCP servers with a private or cluster CA can be used with verification on.

❓ Problem Statement / Motivation

Some MCP servers sit behind a certificate from a private CA. One case: Kubescape's storage serves a read-only MCP endpoint through the Kubernetes API (https://kubernetes.default.svc/apis/spdx.softwarecomposition.kubescape.io/v1beta1/namespaces/<ns>/mcpservers/default/mcp), so kube-apiserver does authentication and RBAC for the agent. Its certificate is signed by the cluster CA (the kube-root-ca.crt ConfigMap in every namespace).

As #3258 describes, Kagent v1.0.1 has no way to reach such a server: tool discovery ignores spec.tls, and Substrate's gateway verifies the upstream certificate against its own trust store, so even disableVerify does not help. The commented-out caCertSecretRef in TLSConfig is deferred for the same reason.

💡 Proposed Solution

An optional CA reference on the RemoteMCPServer, used by every component that connects to the upstream:

spec:
  tls:
    caCertRef:
      kind: ConfigMap   # or Secret
      name: kube-root-ca.crt
      key: ca.crt
  • Controller tool discovery adds it to the trusted roots.
  • Substrate's gateway trusts it for that destination (passed with the egress policy).

Which part belongs in kagent and which in substrate is your call; happy to follow the split you prefer.

🔄 Alternatives Considered
  • disableVerify: does not reach the gateway (#3258), and turns verification off anyway.
  • A proxy with a public certificate in front of the server: an extra component only to work around trust.
  • Earlier attempts: #1110, #1215, #1424 (all closed before the v1alpha3 / Substrate design).
🎯 Affected Service(s)

Controller (MCP discovery), Substrate gateway (tool calls).

📚 Additional Context

Related: #3258. Kubescape design: https://github.com/kubescape/designs-and-proposals/blob/main/proposals/storage-mcp-endpoint.md

🙋 Are you willing to contribute?
  • I am willing to submit a PR for this feature
Lingua principale
Go
Stelle
4.5k
Fork
937
Merge medio
1g 10h
PR unite (30g)
150

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kagent-dev/kagent

Tutte le issue di kagent-dev/kagent

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.