Documentation
¶
Overview ¶
Package mcpserver implements an MCP stdio server that exposes Dowse's diagnostics and definition capabilities as tools for AI hosts.
Index ¶
- type ContentBlock
- type DaemonClient
- type HTTPDaemonClient
- func (h *HTTPDaemonClient) GetBatchDiagnostics(ctx context.Context, files []string) ([]byte, error)
- func (h *HTTPDaemonClient) GetDefinition(ctx context.Context, file string, line, character int) ([]byte, error)
- func (h *HTTPDaemonClient) GetDiagnostics(ctx context.Context, file string) ([]byte, error)
- type Implementation
- type InitializeParams
- type InitializeResult
- type InputSchema
- type PropertySchema
- type Server
- type ServerCapability
- type ToolDef
- type ToolsCallParams
- type ToolsCallResult
- type ToolsCapability
- type ToolsListResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentBlock ¶
type DaemonClient ¶
type DaemonClient interface {
GetDiagnostics(ctx context.Context, file string) ([]byte, error)
GetBatchDiagnostics(ctx context.Context, files []string) ([]byte, error)
GetDefinition(ctx context.Context, file string, line, character int) ([]byte, error)
}
DaemonClient abstracts communication with the dowse daemon.
type HTTPDaemonClient ¶
type HTTPDaemonClient struct {
// contains filtered or unexported fields
}
HTTPDaemonClient talks to the daemon over its Unix socket HTTP API.
func NewHTTPDaemonClient ¶
func NewHTTPDaemonClient(socketPath string) *HTTPDaemonClient
NewHTTPDaemonClient creates a client that connects to the daemon at socketPath.
func (*HTTPDaemonClient) GetBatchDiagnostics ¶
func (*HTTPDaemonClient) GetDefinition ¶
func (*HTTPDaemonClient) GetDiagnostics ¶
type Implementation ¶
type InitializeParams ¶
type InitializeParams struct {
ProtocolVersion string `json:"protocolVersion"`
ClientInfo Implementation `json:"clientInfo"`
Capabilities map[string]any `json:"capabilities,omitempty"`
}
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
ServerInfo Implementation `json:"serverInfo"`
Capabilities ServerCapability `json:"capabilities"`
}
type InputSchema ¶
type InputSchema struct {
Type string `json:"type"`
Properties map[string]PropertySchema `json:"properties"`
Required []string `json:"required"`
}
type PropertySchema ¶
type PropertySchema struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Items *PropertySchema `json:"items,omitempty"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an MCP server that bridges tool calls to the dowse daemon.
func New ¶
func New(client DaemonClient, allowedTools []string) *Server
New creates an MCP server backed by the given DaemonClient. allowedTools controls which tools are exposed: nil means all tools, a non-nil slice restricts to only the named tools.
type ServerCapability ¶
type ServerCapability struct {
Tools *ToolsCapability `json:"tools,omitempty"`
}
type ToolDef ¶
type ToolDef struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema InputSchema `json:"inputSchema"`
}
type ToolsCallParams ¶
type ToolsCallParams struct {
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments"`
}
type ToolsCallResult ¶
type ToolsCallResult struct {
Content []ContentBlock `json:"content"`
IsError bool `json:"isError,omitempty"`
}
type ToolsCapability ¶
type ToolsCapability struct{}
type ToolsListResult ¶
type ToolsListResult struct {
Tools []ToolDef `json:"tools"`
}
Click to show internal directories.
Click to hide internal directories.