Help us shape the future of Go! Take the 2026 Go Developer Survey

mcp

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package mcp implements a Model Context Protocol server over stdio that exposes acurl checks as tools for AI assistants.

Index

Constants

View Source
const ProtocolVersion = "2025-06-18"

ProtocolVersion is the newest MCP revision this server implements.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

Content is one content block of a tool result.

type Server

type Server struct {
	Name, Version string
	Instructions  string
	// contains filtered or unexported fields
}

Server is an MCP server.

func New

func New(base acurl.Options, version string) (*Server, error)

New returns an MCP server exposing acurl tools. base holds the network options for every check; set base.BlockPrivate unless every caller is trusted.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, r io.Reader, w io.Writer) error

Serve reads newline-delimited JSON-RPC messages from r and writes responses to w until r is closed or ctx is done. Tool calls run concurrently; responses may arrive out of order, as JSON-RPC allows.

type Tool

type Tool struct {
	Name        string         `json:"name"`
	Title       string         `json:"title,omitempty"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"inputSchema"`
	Annotations map[string]any `json:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Tool is an MCP tool definition plus its handler.

type ToolResult

type ToolResult struct {
	Content           []Content `json:"content"`
	StructuredContent any       `json:"structuredContent,omitempty"`
	IsError           bool      `json:"isError,omitempty"`
}

ToolResult is the result of tools/call.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL