mcp

package
v0.30.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// SandboxByMCPConnectionIndex indexes Sandboxes by MCP connection name.
	SandboxByMCPConnectionIndex = "spec.mcpConnectionRefs.name"
	// MCPConnectionFinalizer retains connections until runtime cleanup completes.
	MCPConnectionFinalizer = "agentz.accuknox.com/mcpconnection"
	// SandboxFinalizer retains Sandboxes while their MCP resources exist.
	SandboxFinalizer = "agentz.accuknox.com/sandbox-protection"
	// OpenCodeGatewayToolsetName names the gateway toolset in OpenCode config.
	OpenCodeGatewayToolsetName = "gateway"
	// SecretPathDir is the OpenBao directory for MCP credential records.
	SecretPathDir = "mcp-connections"
	// GatewayClassName selects the AgentGateway controller.
	GatewayClassName = "agentgateway"
	// GatewayName names the namespace-local MCP Gateway.
	GatewayName = "mcp"
	// ExtAuthServiceName names the credential injection Service.
	ExtAuthServiceName = "extauth"
	// ExtAuthRolePrefix prefixes namespace-specific OpenBao roles.
	ExtAuthRolePrefix = "extauth-"
	// ExtAuthPort is the ext_authz gRPC port.
	ExtAuthPort int32 = 18081
	// ExtAuthMCPPort is the internal MCP helper HTTP port.
	ExtAuthMCPPort int32 = 18082
	// ExtAuthMCPPath is the internal MCP helper route.
	ExtAuthMCPPath = "/mcp"
	// MCPHelperTargetName identifies the internal helper in MCP targets.
	MCPHelperTargetName = "agentz-internal"
	// AppProtocolMCP marks Services that expose the MCP protocol.
	AppProtocolMCP = "agentgateway.dev/mcp"
	// AgentgatewayParametersName is the name of the AgentgatewayParameters
	// resource that configures the Gateway proxy Service type.
	AgentgatewayParametersName = "mcp-clusterip"
)
View Source
const (
	ConditionAccepted              = "Accepted"
	ConditionReady                 = "Ready"
	ConditionDegraded              = "Degraded"
	ConditionExtAuthReady          = "ExtAuthReady"
	ConditionProbeHealthy          = "ProbeHealthy"
	ConditionConnectionUnreachable = "ConnectionUnreachable"
	ConditionCredentialsInvalid    = "CredentialsInvalid"
	ConditionInternalError         = "InternalError"
	ConditionProtocolError         = "ProtocolError"
)

MCPConnection condition types shared by the controller, observer, and gateway.

View Source
const (
	ReasonAccepted              = "Accepted"
	ReasonReady                 = "Ready"
	ReasonReconcileFailed       = "ReconcileFailed"
	ReasonProbePending          = "ProbePending"
	ReasonConnectionUnreachable = "ConnectionUnreachable"
	ReasonCredentialsInvalid    = "CredentialsInvalid"
	ReasonInternalError         = "InternalError"
	ReasonProtocolError         = "ProtocolError"
)

MCPConnection condition reasons shared by the controller and observer.

View Source
const SecretRecordKey = "credentials"

SecretRecordKey is the OpenBao field key for stored MCP credentials.

Variables

This section is empty.

Functions

func AgentRoutePath

func AgentRoutePath(sandboxName, agentNamespace, agentName string) string

AgentRoutePath returns the stable path that gateway policy binds to one Agent identity before forwarding traffic to its Sandbox backend.

func ExtAuthOpenBaoName

func ExtAuthOpenBaoName(namespace string) string

ExtAuthOpenBaoName returns the shared OpenBao role and policy name.

func Gateway

func Gateway(namespace string) *gwv1.Gateway

Gateway returns the desired namespace-local Gateway.

func IndexSandboxMCPConnections

func IndexSandboxMCPConnections(ctx context.Context, idx client.FieldIndexer) error

IndexSandboxMCPConnections registers the sandbox MCP ref index.

func LoadConnections

LoadConnections returns live MCPConnection objects referenced by env.

Missing references are ignored so callers can converge runtime state from currently resolvable connections.

func MCPConnectionRefNames

func MCPConnectionRefNames(env *agentzv1alpha1.Sandbox) []string

MCPConnectionRefNames returns trimmed, non-empty MCP connection names.

func ManagedRef

func ManagedRef(namespace, name string) *agentzv1alpha1.MCPConnectionManagedResourceRef

ManagedRef returns a status reference for one namespaced object.

func SandboxAuthPolicyName

func SandboxAuthPolicyName(sandboxName, connectionName string) string

SandboxAuthPolicyName returns the auth policy name for one sandbox and connection pair.

func SandboxBackendName

func SandboxBackendName(name string) string

SandboxBackendName returns the MCP backend name for one sandbox.

func SandboxRouteName

func SandboxRouteName(name string) string

SandboxRouteName returns the HTTPRoute name for one sandbox.

func SecretPath

func SecretPath(namespace, name string) string

SecretPath returns the stable namespace-scoped OpenBao path for one MCP credential record.

Types

type BearerSecretRecord

type BearerSecretRecord struct {
	Token     string    `json:"token"`
	UpdatedAt time.Time `json:"updatedAt"`
}

BearerSecretRecord stores one bearer credential in OpenBao.

type OAuthSecretRecord

type OAuthSecretRecord struct {
	oauth.Record
}

OAuthSecretRecord stores one OAuth credential record in OpenBao.

type Target

type Target struct {
	Host     string
	Port     int32
	Path     *string
	Protocol *agentgatewayv1alpha1.MCPProtocol
	Secure   bool
}

Target describes one resolved MCP upstream target.

func ParseTarget

func ParseTarget(conn *agentzv1alpha1.MCPConnection) (Target, error)

ParseTarget resolves one MCPConnection into the runtime target shape.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL