mcp

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mcp serves Arnakoff over the Model Context Protocol: an AI assistant checks an input or lists the sources with the same use cases, the same fields and the same wording as the HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTP added in v0.47.0

func HTTP(s *sdk.Server) http.Handler

HTTP returns the remote endpoint of s, over the Streamable HTTP transport. It keeps no session: each POST carries one message, answered in JSON, and GET and DELETE are refused. A body is bounded by maxFrameBytes, a JSON-RPC batch and a browser's cross-origin request are refused, and the SDK logs nothing: a tool's arguments may be personal data. The caller checks the API key and spends its quota, one unit a request.

func NewServer

func NewServer(opts Options) *sdk.Server

NewServer returns the MCP server of opts, with its check and list_sources tools. The SDK logs nothing: a tool's arguments may be personal data.

func Stdio

func Stdio() *sdk.StdioTransport

Stdio returns the transport of a server run by its client, on stdin and stdout, each message bounded by maxFrameBytes.

Types

type Checker

type Checker interface {
	// Check returns the report of in; a source it could not consult is
	// reported unavailable, never an error.
	Check(ctx context.Context, in domain.Input) domain.Report
}

Checker checks an input against the sources.

type Options

type Options struct {
	// Check backs the check tool.
	Check Checker
	// Sources backs the list_sources tool.
	Sources SourceLister
}

Options configures the server.

type SourceLister

type SourceLister interface {
	// Sources returns every source and the state of its data in service.
	Sources() []app.ListedSource
}

SourceLister lists the sources a check consults.

Jump to

Keyboard shortcuts

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