Documentation
¶
Overview ¶
Package mcp implements the MCP server logic for Agent Browser.
Index ¶
Constants ¶
View Source
const ( AgentName = "CoBrowser Agent 🚀" AgentVersion = "1.0.0" )
Version information
Variables ¶
View Source
var ( // Connection metrics MCPConnectionsTotal = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "mcp_connections_total", Help: "Total number of MCP server connections by state", }, []string{"state"}) // Tool metrics MCPToolsTotal = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "mcp_tools_total", Help: "Total number of tools by server", }, []string{"server_url"}) MCPToolSyncLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "mcp_tool_sync_latency_seconds", Help: "Latency of tool synchronization operations", Buckets: prometheus.DefBuckets, }, []string{"operation"}) )
Metrics exposed by the MCP package
Functions ¶
func RegisterEventSubscribers ¶
RegisterEventSubscribers registers event handlers with the event bus
func RegisterMCPServerHooks ¶
func RegisterMCPServerHooks(p MCPHookParams)
RegisterMCPServerHooks registers the OnStart and OnStop hooks for the MCP server
Types ¶
type MCPHookParams ¶
type MCPHookParams struct { fx.In Lifecycle fx.Lifecycle MCPServer *server.MCPServer SSEServer *server.SSEServer ConnManager *manager.ConnectionManager Config config.ServerConfig Logger log.Logger }
MCPHookParams contains the parameters needed for MCP hooks
Directories
¶
Path | Synopsis |
---|---|
Package client implements the MCP client logic.
|
Package client implements the MCP client logic. |
Package config provides configuration structures for the MCP component.
|
Package config provides configuration structures for the MCP component. |
Package connection implements MCP connection handling.
|
Package connection implements MCP connection handling. |
Package handlers provides event handler functionality for MCP.
|
Package handlers provides event handler functionality for MCP. |
Package health provides health check functionality for MCP connections.
|
Package health provides health check functionality for MCP connections. |
Package manager provides the ConnectionManager implementation.
|
Package manager provides the ConnectionManager implementation. |
Package tools provides functionality for managing MCP tools.
|
Package tools provides functionality for managing MCP tools. |
Click to show internal directories.
Click to hide internal directories.