Documentation
¶
Overview ¶
Package mcp defines the expression types used to represent MCP server configuration during Goa design evaluation. These types are populated during DSL execution and form the schema used for MCP protocol code generation.
Package mcp defines the expression types used to represent MCP server configuration during Goa design evaluation. These types are populated during DSL execution and form the schema used for MCP protocol code generation.
Index ¶
- type CapabilitiesExpr
- type DynamicPromptExpr
- type MCPExpr
- type MessageExpr
- type NotificationExpr
- type PromptExpr
- type ResourceExpr
- type RootExpr
- func (r *RootExpr) DependsOn() []eval.Root
- func (r *RootExpr) EvalName() string
- func (r *RootExpr) GetMCP(svc *expr.ServiceExpr) *MCPExpr
- func (r *RootExpr) HasMCP(svc *expr.ServiceExpr) bool
- func (r *RootExpr) Packages() []string
- func (r *RootExpr) RegisterDynamicPrompt(svc *expr.ServiceExpr, prompt *DynamicPromptExpr)
- func (r *RootExpr) RegisterMCP(svc *expr.ServiceExpr, mcp *MCPExpr)
- func (r *RootExpr) ServiceMCP(service, toolset string) *MCPExpr
- func (r *RootExpr) WalkSets(walk eval.SetWalker)
- type SubscriptionExpr
- type SubscriptionMonitorExpr
- type ToolExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapabilitiesExpr ¶
type CapabilitiesExpr struct {
eval.Expression
// EnableTools indicates whether the server exposes tool
// invocation.
EnableTools bool
// EnableResources indicates whether the server exposes resource
// access.
EnableResources bool
// EnablePrompts indicates whether the server exposes prompt
// templates.
EnablePrompts bool
// EnableLogging indicates whether the server supports logging.
EnableLogging bool
// EnableProgress indicates whether the server supports progress
// notifications.
EnableProgress bool
// EnableCancellation indicates whether the server supports
// request cancellation.
EnableCancellation bool
// EnableNotifications indicates whether the server can send
// notifications.
EnableNotifications bool
// EnableCompletion indicates whether the server supports
// completion suggestions.
EnableCompletion bool
// EnablePagination indicates whether the server supports
// paginated responses.
EnablePagination bool
// EnableSubscriptions indicates whether the server supports
// resource subscriptions.
EnableSubscriptions bool
}
CapabilitiesExpr defines which MCP protocol capabilities a server supports.
func (*CapabilitiesExpr) EvalName ¶
func (c *CapabilitiesExpr) EvalName() string
EvalName returns the name used for evaluation.
type DynamicPromptExpr ¶
type DynamicPromptExpr struct {
eval.Expression
// Name is the unique identifier for this dynamic prompt.
Name string
// Description provides a human-readable explanation of the prompt's
// purpose.
Description string
// Method is the Goa service method that generates this prompt.
Method *expr.MethodExpr
}
DynamicPromptExpr defines a dynamic prompt generated at runtime by a service method.
func (*DynamicPromptExpr) EvalName ¶
func (d *DynamicPromptExpr) EvalName() string
EvalName returns the name used for evaluation.
type MCPExpr ¶
type MCPExpr struct {
eval.Expression
// Name is the MCP server name as advertised to MCP clients.
Name string
// Version is the server implementation version.
Version string
// Description provides a human-readable explanation of the
// server's purpose.
Description string
// ProtocolVersion is the MCP protocol version this server
// implements.
ProtocolVersion string
// Transport is the transport mechanism (e.g., "jsonrpc",
// "sse").
Transport string
// Capabilities defines which MCP capabilities this server
// supports.
Capabilities *CapabilitiesExpr
// Tools is the collection of tool expressions exposed by this
// server.
Tools []*ToolExpr
// Resources is the collection of resource expressions exposed
// by this server.
Resources []*ResourceExpr
// Prompts is the collection of static prompt expressions
// exposed by this server.
Prompts []*PromptExpr
// Notifications is the collection of notification expressions
// this server can send.
Notifications []*NotificationExpr
// Subscriptions is the collection of resource subscription
// expressions this server supports.
Subscriptions []*SubscriptionExpr
// SubscriptionMonitors is the collection of subscription
// monitor expressions for SSE.
SubscriptionMonitors []*SubscriptionMonitorExpr
// Service is the Goa service expression this MCP server is
// bound to.
Service *expr.ServiceExpr
}
MCPExpr defines MCP server configuration for a Goa service.
type MessageExpr ¶
type MessageExpr struct {
eval.Expression
// Role is the message sender role (e.g., "user", "assistant").
Role string
// Content is the message text content or template.
Content string
}
MessageExpr defines a single message within a prompt template.
func (*MessageExpr) EvalName ¶
func (m *MessageExpr) EvalName() string
EvalName returns the name used for evaluation.
type NotificationExpr ¶
type NotificationExpr struct {
eval.Expression
// Name is the unique identifier for this notification type.
Name string
// Description provides a human-readable explanation of the
// notification.
Description string
// Method is the Goa service method that sends this notification.
Method *expr.MethodExpr
}
NotificationExpr defines a notification that the server can send to clients.
func (*NotificationExpr) EvalName ¶
func (n *NotificationExpr) EvalName() string
EvalName returns the name used for evaluation.
type PromptExpr ¶
type PromptExpr struct {
eval.Expression
// Name is the unique identifier for this prompt.
Name string
// Description provides a human-readable explanation of the
// prompt's purpose.
Description string
// Arguments defines the parameter schema for this prompt
// template.
Arguments *expr.AttributeExpr
// Messages is the collection of message templates in this
// prompt.
Messages []*MessageExpr
}
PromptExpr defines a static MCP prompt template exposed by the server.
func (*PromptExpr) EvalName ¶
func (p *PromptExpr) EvalName() string
EvalName returns the name used for evaluation.
func (*PromptExpr) Validate ¶
func (p *PromptExpr) Validate() error
Validate validates a prompt expression
type ResourceExpr ¶
type ResourceExpr struct {
eval.Expression
// Name is the unique identifier for this resource.
Name string
// Description provides a human-readable explanation of the
// resource.
Description string
// URI is the resource identifier used for access.
URI string
// MimeType is the MIME type of the resource content.
MimeType string
// Method is the Goa service method that provides this resource.
Method *expr.MethodExpr
// Watchable indicates whether this resource supports change
// notifications.
Watchable bool
}
ResourceExpr defines an MCP resource that the server exposes for access.
func (*ResourceExpr) EvalName ¶
func (r *ResourceExpr) EvalName() string
EvalName returns the name used for evaluation.
func (*ResourceExpr) Validate ¶
func (r *ResourceExpr) Validate() error
Validate validates a resource expression
type RootExpr ¶
type RootExpr struct {
// MCPServers maps service names to their MCP server configurations.
MCPServers map[string]*MCPExpr
// DynamicPrompts maps service names to their dynamic prompt
// expressions.
DynamicPrompts map[string][]*DynamicPromptExpr
}
RootExpr is the top-level root expression for all MCP server declarations.
var Root *RootExpr
Root is the plugin root instance holding all MCP server configurations.
func (*RootExpr) GetMCP ¶
func (r *RootExpr) GetMCP(svc *expr.ServiceExpr) *MCPExpr
GetMCP returns the MCP configuration for a service.
func (*RootExpr) HasMCP ¶
func (r *RootExpr) HasMCP(svc *expr.ServiceExpr) bool
HasMCP returns true if the service has an MCP configuration.
func (*RootExpr) Packages ¶
Packages returns the DSL packages that should be recognized for error reporting.
func (*RootExpr) RegisterDynamicPrompt ¶
func (r *RootExpr) RegisterDynamicPrompt(svc *expr.ServiceExpr, prompt *DynamicPromptExpr)
RegisterDynamicPrompt registers a dynamic prompt for a service
func (*RootExpr) RegisterMCP ¶
func (r *RootExpr) RegisterMCP(svc *expr.ServiceExpr, mcp *MCPExpr)
RegisterMCP registers an MCP server configuration for a service
func (*RootExpr) ServiceMCP ¶
ServiceMCP returns the MCP configuration for a service name and optional toolset (server name) filter. When toolset is empty, it returns the MCP server for the service if present.
type SubscriptionExpr ¶
type SubscriptionExpr struct {
eval.Expression
// ResourceName is the name of the resource being subscribed to.
ResourceName string
// Method is the Goa service method that handles this subscription.
Method *expr.MethodExpr
}
SubscriptionExpr defines a subscription to resource change events.
func (*SubscriptionExpr) EvalName ¶
func (s *SubscriptionExpr) EvalName() string
EvalName returns the name used for evaluation.
type SubscriptionMonitorExpr ¶
type SubscriptionMonitorExpr struct {
eval.Expression
// Name is the unique identifier for this monitor.
Name string
// Method is the Goa service method that implements the monitor.
Method *expr.MethodExpr
}
SubscriptionMonitorExpr defines a subscription monitor for SSE-based subscriptions.
func (*SubscriptionMonitorExpr) EvalName ¶
func (s *SubscriptionMonitorExpr) EvalName() string
EvalName returns the name used for evaluation.
type ToolExpr ¶
type ToolExpr struct {
eval.Expression
// Name is the unique identifier for this tool.
Name string
// Description provides a human-readable explanation of what the
// tool does.
Description string
// Method is the Goa service method that implements this tool.
Method *expr.MethodExpr
// InputSchema defines the parameter schema for this tool.
InputSchema *expr.AttributeExpr
}
ToolExpr defines an MCP tool that the server exposes for invocation.