mcp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mcp implements a minimal stdio JSON-RPC 2.0 server that exposes read-only db-catalyst tools to AI agents via the Model Context Protocol (MCP).

Framing

The server uses newline-delimited JSON: each request and each response is a single JSON object followed by a newline character ('\n'). There is no Content-Length header framing. Clients must send one complete JSON object per line and must read complete lines from the server.

Tools

  • schema_list – returns a summary of all tables and their columns.
  • query_check – validates + types a single SQL statement using the static analyzer and the SQLite verify oracle; returns columns and diagnostics.
  • query_preview – returns a preview of the generated Go method signature and row struct derived from a SQL statement.

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 the MCP stdio server. Construct with NewServer, then call Serve.

func NewServer

func NewServer(catalog *model.Catalog, eng engine.Engine, plan config.JobPlan) *Server

NewServer constructs a Server with the given read-only collaborators.

func (*Server) Serve

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

Serve reads newline-delimited JSON-RPC 2.0 requests from in and writes responses to out. It returns when in is exhausted (EOF) or ctx is cancelled.

Jump to

Keyboard shortcuts

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