mcpserver

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mcpserver exposes pgtransfer functionality as Model Context Protocol (MCP) tools, so an AI host (Claude Desktop, Cursor, an agent runtime, …) can drive database transfers as native typed tools.

The server speaks MCP over stdio and is started by hosts as a subprocess:

pgtransfer mcp

Each tool returns a structured JSON payload (also rendered as text content so human-readable clients remain useful).

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the server implementation version reported during initialisation. It is set from the CLI version at startup.

Functions

func New

func New() *mcp.Server

New builds an MCP server with every pgtransfer tool registered.

func Run

func Run(ctx context.Context, stdout io.Writer) error

Run serves MCP over stdio until the context is cancelled or stdin closes.

The real stdout must be passed in because the process-level os.Stdout is redirected to stderr for the duration of the server (see output.EnableMCPMode) to keep stray library output off the protocol stream.

Types

This section is empty.

Jump to

Keyboard shortcuts

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