mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mcp implements a Model Context Protocol server over stdio so an AI agent can operate Interceptor as a set of tools. It is a thin, well-described front end over the running control API (REST) — every tool maps to an endpoint the web UI also uses, so the human and the agent drive the same engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is an MCP stdio server backed by the control API at base.

func New

func New(baseURL string) *Server

New builds an MCP server that talks to the control API at baseURL (e.g. http://127.0.0.1:9966).

func (*Server) Serve

func (s *Server) Serve(in io.Reader, out io.Writer) error

Serve runs the JSON-RPC loop over newline-delimited messages until EOF.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the MCP "Streamable HTTP" transport over a single endpoint. A client POSTs a JSON-RPC message (or batch) and receives the JSON-RPC response as application/json. The server is stateless — no Mcp-Session-Id is required — and offers no server-initiated SSE stream, so GET returns 405 (per spec). This lets a hosted/remote agent drive Interceptor without launching the `interceptor mcp` stdio subcommand. Bind localhost-only; it shares the (unauthenticated, local) trust model of the control API it fronts.

Jump to

Keyboard shortcuts

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