Documentation
¶
Index ¶
Constants ¶
const ( ErrMCPInitializeFailed greet.ErrorCode = "mcp_initialize_failed" ErrMCPUnexpectedStatus greet.ErrorCode = "mcp_unexpected_status" ErrMCPMissingSession greet.ErrorCode = "mcp_missing_session" ErrMCPAuthFailed greet.ErrorCode = "mcp_auth_failed" ErrMCPUnsupportedOAuth greet.ErrorCode = "mcp_unsupported_oauth" ErrMCPListResourcesFailed greet.ErrorCode = "mcp_list_resources_failed" ErrMCPListToolsFailed greet.ErrorCode = "mcp_list_tools_failed" ErrMCPListPromptsFailed greet.ErrorCode = "mcp_list_prompts_failed" ErrMCPListTemplatesFailed greet.ErrorCode = "mcp_list_templates_failed" )
MCP-specific error codes.
const DefaultMCPPort = 443
DefaultMCPPort is the well-known HTTPS port for the MCP streamable transport.
const ProtocolName = "mcp"
ProtocolName is the registered name for the MCP application layer.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MCP ¶
type MCP struct{}
MCP implements an MCP streamable HTTP application-layer probe.
func (*MCP) BaseTransport ¶
func (*MCP) DefaultPort ¶
func (*MCP) Description ¶
func (*MCP) Handshake ¶
func (m *MCP) Handshake(ctx context.Context, start time.Time, conn net.Conn, host string, port int, cfg *greet.GreetConfig) (net.Conn, greet.LayerData, greet.LayerTiming, error)
Handshake performs the MCP initialize handshake and optional list probes over the supplied TLS connection.
type MCPConfig ¶
type MCPConfig struct {
// ClientInfo is sent in the initialize request.
ClientInfo mcp.Implementation
// Path is the request path for MCP streamable HTTP requests (e.g. "/mcp").
// Defaults to "/" when empty.
Path string
// BearerToken is an optional OAuth 2.0 Bearer token sent in the
// Authorization header on every request. When a server returns
// 401 with a Bearer WWW-Authenticate challenge, greet probes the
// resource metadata well-known endpoint for diagnostic information.
BearerToken string
// ListResources also runs resources/list after the handshake.
ListResources bool
// ListTools also runs tools/list after the handshake.
ListTools bool
// ListPrompts also runs prompts/list after the handshake.
ListPrompts bool
// ListResourceTemplates also runs resources/templates/list after the handshake.
ListResourceTemplates bool
}
MCPConfig holds protocol-specific configuration for an MCP probe.
func (*MCPConfig) LayerConfigName ¶
LayerConfigName returns the layer name for config lookup.
type MCPResult ¶
type MCPResult struct {
ProtocolVersion string `json:"protocolVersion"`
ServerInfo *mcp.Implementation `json:"serverInfo,omitempty"`
Capabilities *mcp.ServerCapabilities `json:"capabilities,omitempty"`
Resources []*ResourceInfo `json:"resources,omitempty"`
ResourceTemplates []*ResourceTemplateInfo `json:"resourceTemplates,omitempty"`
Tools []*ToolInfo `json:"tools,omitempty"`
Prompts []*PromptInfo `json:"prompts,omitempty"`
}
MCPResult holds the outcome of an MCP handshake and optional list probes.
func (*MCPResult) LayerDataName ¶
LayerDataName returns the layer name for result aggregation.
type PromptInfo ¶
type PromptInfo struct {
Name string `json:"name"`
}
PromptInfo is a compact view of an MCP prompt.
type ResourceInfo ¶
ResourceInfo is a compact view of an MCP resource.
type ResourceTemplateInfo ¶
type ResourceTemplateInfo struct {
Name string `json:"name"`
URITemplate string `json:"uriTemplate"`
}
ResourceTemplateInfo is a compact view of an MCP resource template.