Documentation
¶
Overview ¶
Package mcpserver serves search, describe, and invoke over one catalog.
Index ¶
- Constants
- Variables
- func Handler(srv *Server, opt Options, ids []Identity) (http.Handler, error)
- func Listen(ctx context.Context, addr string, h http.Handler) (string, error)
- func RegisterTools(cat *catalog.Catalog, opt Options) []string
- func RunStdio(ctx context.Context, srv *Server, opt Options) error
- func Serve(ctx context.Context, addr string, h http.Handler) error
- func ToolNames(cat *catalog.Catalog, pins []string, directPins, grouped bool) []string
- func ValidatePins(cat *catalog.Catalog, pins []string) error
- type Identity
- type InvokeResult
- type Options
- type Server
- func (s *Server) Call(ctx context.Context, req runtime.Request) (InvokeResult, error)
- func (s *Server) Describe(operationID string) ([]byte, error)
- func (s *Server) Invoke(ctx context.Context, operationID string, params map[string]string, ...) (InvokeResult, error)
- func (s *Server) Preview(ctx context.Context, req runtime.Request) (runtime.Preview, error)
- func (s *Server) Search(query string, offset, limit int) []catalog.Match
Constants ¶
View Source
const ( // CallerHeader is the credential of the process calling veto. // The value identifies that caller. It is not an upstream API token. CallerHeader = "Veto-Caller" // DefaultAddr is the listen address for serve --http. DefaultAddr = "127.0.0.1:7433" )
Variables ¶
View Source
var Version = "dev"
Version is the MCP server build. A release sets it with -X.
Functions ¶
func Handler ¶
Handler is the Streamable HTTP MCP endpoint. A request without a known caller credential is rejected first.
Types ¶
type Identity ¶
Identity is one caller of the HTTP server. Token is the credential. ID is the name stored with an approval.
type InvokeResult ¶
type InvokeResult struct {
Status string `json:"status"`
ApprovalID string `json:"approval_id,omitempty"`
OperationID string `json:"operation_id,omitempty"`
HTTPStatus int `json:"http_status,omitempty"`
Body string `json:"body,omitempty"`
Code string `json:"code,omitempty"`
Retryable bool `json:"retryable"`
RetryAfter string `json:"retry_after,omitempty"`
Error string `json:"error,omitempty"`
Truncated bool `json:"truncated,omitempty"`
Page *result.Page `json:"page,omitempty"`
}
type Server ¶
func (*Server) Invoke ¶
func (s *Server) Invoke(ctx context.Context, operationID string, params map[string]string, approvalID string) (InvokeResult, error)
Invoke adapts string parameters at the MCP boundary and calls the shared runtime.
Click to show internal directories.
Click to hide internal directories.