mcp

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package mcp implements a Model Context Protocol server over stdio, exposing the CLI's verbs as tools so an MCP-capable agent (Claude, etc.) can drive the Privasys platform natively. Transport is newline-delimited JSON-RPC 2.0 on stdin/stdout (the MCP stdio transport).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Client   *api.Client
	Token    string
	Issuer   string
	Endpoint string
	Authed   bool
}

Deps is the per-call context a tool handler needs. It is rebuilt per call so tokens refresh transparently. Issuer/Endpoint are always populated; Client + Token are set and Authed is true only when the user is signed in (so onboarding tools can run before there is a session).

type DepsFunc

type DepsFunc func(ctx context.Context) (Deps, error)

DepsFunc returns a fresh Deps. It errors only on hard failures (config load), not on "not signed in" — that surfaces as Authed=false.

type Server

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

Server serves MCP over the given reader/writer.

func NewServer

func NewServer(deps DepsFunc, version string) *Server

NewServer builds the server with the full tool surface.

func (*Server) Serve

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

Serve runs the read/dispatch/write loop until EOF or ctx cancellation.

Jump to

Keyboard shortcuts

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