Documentation
¶
Overview ¶
Package mcp implements the Model Context Protocol (MCP) server for protolint.
Package mcp implements the Model Context Protocol (MCP) server for protolint.
Package mcp implements the Model Context Protocol (MCP) server for protolint.
Index ¶
- type CallToolPayload
- type CallToolResponse
- type ClientCapabilities
- type ClientInfo
- type ContentItem
- type Error
- type InitializeParams
- type InitializeResult
- type LintFilesArgs
- type LintFilesTool
- type ListToolsResponse
- type Request
- type Response
- type Server
- type ServerCapabilities
- type ServerInfo
- type Tool
- type ToolInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallToolPayload ¶
type CallToolPayload struct {
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments"`
}
CallToolPayload represents the payload for call_tool request
type CallToolResponse ¶
type CallToolResponse struct {
Content []ContentItem `json:"content"`
IsError bool `json:"isError"`
}
CallToolResponse represents the response for call_tool request
type ClientCapabilities ¶
type ClientCapabilities struct {
Roots map[string]interface{} `json:"roots,omitempty"`
Sampling map[string]interface{} `json:"sampling,omitempty"`
Experimental map[string]interface{} `json:"experimental,omitempty"`
}
ClientCapabilities represents client capabilities
type ClientInfo ¶
ClientInfo represents information about the client
type ContentItem ¶
type ContentItem struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Data string `json:"data,omitempty"`
MimeType string `json:"mimeType,omitempty"`
Resource interface{} `json:"resource,omitempty"`
}
ContentItem represents a content item in a tool result
type Error ¶
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
Error represents a JSON-RPC 2.0 error
type InitializeParams ¶
type InitializeParams struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities ClientCapabilities `json:"capabilities"`
ClientInfo ClientInfo `json:"clientInfo,omitempty"`
}
InitializeParams represents the parameters for initialize request
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
Capabilities ServerCapabilities `json:"capabilities"`
ServerInfo ServerInfo `json:"serverInfo"`
Instructions string `json:"instructions,omitempty"`
}
InitializeResult represents the response for initialize request
type LintFilesArgs ¶
type LintFilesArgs struct {
Files []string `json:"files"`
ConfigPath string `json:"config_path,omitempty"`
Fix bool `json:"fix,omitempty"`
}
LintFilesArgs represents arguments for lint-files tool
type LintFilesTool ¶
type LintFilesTool struct{}
LintFilesTool is a tool for linting Proto files
func NewLintFilesTool ¶
func NewLintFilesTool() *LintFilesTool
NewLintFilesTool creates a new LintFilesTool
func (*LintFilesTool) Execute ¶
func (t *LintFilesTool) Execute(args json.RawMessage) (any, error)
Execute runs the lint-files tool
func (*LintFilesTool) GetInfo ¶
func (t *LintFilesTool) GetInfo() ToolInfo
GetInfo returns the tool information
type ListToolsResponse ¶
type ListToolsResponse struct {
Tools []ToolInfo `json:"tools"`
}
ListToolsResponse represents the response for list_tools request
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
ID interface{} `json:"id"`
}
Request represents a JSON-RPC 2.0 request
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
Result interface{} `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
ID interface{} `json:"id"`
}
Response represents a JSON-RPC 2.0 response
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an MCP server
type ServerCapabilities ¶
type ServerCapabilities struct {
Prompts map[string]interface{} `json:"prompts,omitempty"`
Resources map[string]interface{} `json:"resources,omitempty"`
Tools map[string]interface{} `json:"tools,omitempty"`
Logging map[string]interface{} `json:"logging,omitempty"`
Experimental map[string]interface{} `json:"experimental,omitempty"`
}
ServerCapabilities represents the server's capabilities
type ServerInfo ¶
ServerInfo represents information about the server