Documentation
¶
Overview ¶
Package mcpserver provides a Model Context Protocol (MCP) server for Jira. It enables AI assistants to interact with Jira through standardized tool calls.
Index ¶
Constants ¶
const ( ErrorCodeParseError = -32700 ErrorCodeInvalidRequest = -32600 ErrorCodeMethodNotFound = -32601 ErrorCodeInvalidParams = -32602 ErrorCodeInternalError = -32603 )
Standard JSON-RPC error codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentBlock ¶
ContentBlock represents a content block in tool results.
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
ServerInfo ServerInfo `json:"serverInfo"`
Capabilities map[string]any `json:"capabilities"`
}
InitializeResult is returned from initialize method.
type JSONRPCError ¶
type JSONRPCError struct {
Code int `json:"code"`
Message string `json:"message"`
Data any `json:"data,omitempty"`
}
JSONRPCError represents a JSON-RPC 2.0 error.
type JSONRPCRequest ¶
type JSONRPCRequest struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
JSONRPCRequest represents an incoming JSON-RPC 2.0 request.
type JSONRPCResponse ¶
type JSONRPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID any `json:"id"`
Result any `json:"result,omitempty"`
Error *JSONRPCError `json:"error,omitempty"`
}
JSONRPCResponse represents an outgoing JSON-RPC 2.0 response.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles MCP protocol requests for Jira operations.
func (*Server) Handle ¶
func (s *Server) Handle(ctx context.Context, req JSONRPCRequest) JSONRPCResponse
Handle processes a JSON-RPC request and returns a response.
type ServerInfo ¶
ServerInfo describes the MCP server capabilities.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema map[string]any `json:"inputSchema"`
}
Tool describes an available tool.
type ToolCallParams ¶
type ToolCallParams struct {
Name string `json:"name"`
Arguments map[string]any `json:"arguments"`
}
ToolCallParams are the parameters for tools/call method.
type ToolCallResult ¶
type ToolCallResult struct {
Content []ContentBlock `json:"content"`
IsError bool `json:"isError,omitempty"`
}
ToolCallResult is returned from tools/call method.
type ToolsListResult ¶
type ToolsListResult struct {
Tools []Tool `json:"tools"`
}
ToolsListResult is returned from tools/list method.