mcpserver

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package mcpserver exposes dbterm's saved database profiles to trusted local agent clients over the Model Context Protocol. The server is stdio-only and read-only by default.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options Options) *mcp.Server

New builds a configured MCP server without starting a transport.

func RunStdio

func RunStdio(ctx context.Context, options Options) error

RunStdio serves MCP over this process's stdin/stdout. Protocol output must remain on stdout; audit events and diagnostics go to stderr.

Types

type Options

type Options struct {
	Version            string
	ConnectionScope    string
	AllowProfileWrites bool
	MaxRows            int
	QueryTimeout       time.Duration
	AuditWriter        io.Writer
	StoreLoader        func() (*config.Store, error)
	Connector          func(*config.ConnectionConfig) (*sql.DB, error)
}

Options controls the local MCP server. Zero values select conservative defaults. StoreLoader and Connector exist so the safety boundary can be tested without using a person's real profile.

Jump to

Keyboard shortcuts

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