mcp

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcp implements a thin stdio MCP server over the local gadak mirror.

It is the access path for clients without a shell (Claude Desktop and similar). Agents that can run commands should prefer `gadak sql` / `gadak issue` / `gadak search` instead — see docs/MCP.md and contracts/agent.md.

Protocol surface is deliberately small and implemented with the Go stdlib only: initialize, tools/list, tools/call, notifications/initialized, ping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logf

func Logf(format string, args ...any)

Logf writes a diagnostic line to stderr. Never use the process logger against stdout while serving MCP — that corrupts the JSON-RPC stream.

Types

type Server

type Server struct {
	DBPath  string
	Profile string
	// Version is the gadak binary version reported in serverInfo.
	Version string
	// contains filtered or unexported fields
}

Server is a stdio MCP session bound to one mirror database. Callers build it as a literal; the database is opened on first tool call, so initialize / tools/list work even when the mirror is missing (the tool then returns a clear isError message).

func (*Server) Serve

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

Serve reads newline-delimited JSON-RPC messages from in and writes responses to out. Logs must never go to out — callers should leave log output on stderr. Returns when in is exhausted or a fatal I/O error occurs.

type Tool

type Tool struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"inputSchema"`
}

Tool is one entry in tools/list.

Jump to

Keyboard shortcuts

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