mcp

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 14 Imported by: 1 module, 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 exposes the stack use cases as MCP tools over stdio so coding agents can drive git-stack. Stdout belongs to JSON-RPC: everything here logs to stderr and every subprocess is captured.

Index

Constants

View Source
const Instructions = `` /* 1547-byte string literal not displayed */

Instructions is sent to clients at initialisation. Codex weighs the start of it most, so the key guidance comes first.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Version string
	// Cwd is the fallback repository location.
	Cwd string
	Git *git.Client
	// NewApp builds the use cases for a repository. It must never produce
	// an App that prompts or hands over a terminal.
	NewApp func(ctx context.Context, repo git.Repo) (*app.App, error)
	Log    *slog.Logger
}

Options wires the server.

type Server

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

Server is the MCP server.

func New

func New(o Options) *Server

New builds the server and registers every tool.

func (*Server) MCP

func (s *Server) MCP() *mcp.Server

MCP exposes the underlying server (tests connect it to in-memory transports).

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run serves over stdio until the client disconnects or ctx is cancelled.

Jump to

Keyboard shortcuts

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