Documentation
¶
Index ¶
- func EnhanceToolsList(cfg *config.Config, agentID, backendID string, result *model.ToolsListResult) *model.ToolsListResult
- func HealthCheck(cfgMgr *config.Manager) http.HandlerFunc
- func NewMux(handler *Handler, healthCheck http.HandlerFunc, approvalCallback http.Handler, ...) *http.ServeMux
- func ParseToolsListResult(resp *model.Response) (*model.ToolsListResult, error)
- type Forwarder
- type Handler
- type SessionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnhanceToolsList ¶
func EnhanceToolsList(cfg *config.Config, agentID, backendID string, result *model.ToolsListResult) *model.ToolsListResult
EnhanceToolsList filters and enhances tools/list responses per agent.
func HealthCheck ¶
func HealthCheck(cfgMgr *config.Manager) http.HandlerFunc
HealthCheck returns a handler that checks backend health.
func NewMux ¶
func NewMux( handler *Handler, healthCheck http.HandlerFunc, approvalCallback http.Handler, apiRouter http.Handler, ) *http.ServeMux
NewMux creates the main HTTP router.
func ParseToolsListResult ¶
func ParseToolsListResult(resp *model.Response) (*model.ToolsListResult, error)
ParseToolsListResult unmarshals the tools/list result from a JSON-RPC response.
Types ¶
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder sends JSON-RPC requests to backend MCP servers.
func NewForwarder ¶
NewForwarder creates a forwarder that sends requests to backend MCP servers.
func (*Forwarder) Forward ¶
func (f *Forwarder) Forward(ctx context.Context, backendID string, rpcReq *model.Request, sessionID string) (*model.Response, string, error)
Forward sends a JSON-RPC request to the specified backend and returns the response. sessionID is the MCP session ID to include in the request; respSessionID is the session ID returned by the backend (if any).
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the main MCP proxy HTTP handler. Routes: /agents/{agentID}/mcp
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager tracks MCP sessions (mcp-session-id) per agent.
func NewSessionManager ¶
func NewSessionManager() *SessionManager
NewSessionManager creates a session manager for tracking MCP sessions.
func (*SessionManager) Get ¶
func (sm *SessionManager) Get(agentID string) string
Get returns the backend session ID for an agent, or empty string if none.
func (*SessionManager) Set ¶
func (sm *SessionManager) Set(agentID, sessionID string)
Set stores the backend session ID for an agent.