mcpserver

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcpserver serves agni's analysis to an LLM client over the Model Context Protocol (agni issue 910). It is a transport adapter beside internal/server's Connect one (C13), so it asks the same services and adds no analysis.

The query language's tools come from jaala's MCP server (frontends/mcp). They are query, explain, schema, look and values, and they answer over the fact base of the design a call names. This package adds the rest of agni's questions as tools of its own (check, trace, diff, design, checklists, review, query_set and designs) and the catalogs as resources. Every answer carries the question that produced it, its rows as TableService projects them (C35), the citations behind those rows, and a link that opens the answer in the viewer. So a client shows evidence rather than the model's say-so.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPHandler

func HTTPHandler(srv *mcpkit.Server, prefix string, origins ...string) http.Handler

HTTPHandler serves srv over streamable HTTP at prefix, the path where a mux mounts it. Only a localhost Origin is accepted, so a page on another site can't drive a local server (DNS rebinding). origins adds others.

It accepts both MCP wires on one URL (Wire), so each host speaks the one it prefers. A host can ask for the stateless 2026-07-28 wire, and a host that never asks for it gets the session wire.

func New

func New(api server.API, o Options) (*mcpkit.Server, error)

New is the MCP server over api's services. api is the same value `agni serve` registers on its Connect mux, so the two transports ask the same services and hold the same snapshots.

func Wire added in v0.3.10

func Wire() stateless.Mode

Wire names the MCP wires agni's HTTP endpoint accepts, which is both (stateless.ModeDual). It is set here rather than left to mcpkit's default, so a change of that default can't drop the wire a host speaks (agni issue 1172). MCPKIT_STATELESS_MODE still overrides it, to force one wire while debugging a host.

Types

type FolderDesigns added in v0.9.0

type FolderDesigns interface {
	Designs(ctx context.Context) ([]*webapi.Design, error)
}

FolderDesigns lists the designs mounted folders declare, as internal/projects.MountedDesigns does.

type Options

type Options struct {
	// Version is the server's version, as initialize reports it.
	Version string
	// URLBase is where the viewer is served, such as "http://localhost:8080", so an answer carries a
	// link that opens it there. Empty withholds every link, and each answer says why.
	URLBase string
	// NoLinks says why URLBase is empty, for the answers to repeat. Empty says the server was started
	// with no viewer to link to.
	NoLinks string
	// Budget caps the work of every query and query-backed rule a call evaluates, as `agni serve
	// --query-budget` caps the Connect API's (agni issue 792). Zero caps nothing.
	Budget int64
	// Timeout is the longest one call may take; zero is no limit.
	Timeout time.Duration
	// Folders lists the designs the mounted folders declare in a design.yaml. A tool names a design by
	// its path, and a read by path honours the folder's design.yaml, so the designs tool lists these
	// beside the server's stored designs (agni issue 1736). Nil lists none.
	Folders FolderDesigns
	// SignedIn says agni's gate wraps /mcp, as it does under `agni serve --auth`. Each call then acts
	// for the gate's caller, and the room bridge and room events act for that person. It stays off
	// without the gate, since mcpkit lets a request carrying a bearer header past its Origin check
	// once the server checks callers.
	SignedIn bool
}

Options configure New.

Jump to

Keyboard shortcuts

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