mcp

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mcp implements a small stdio JSON-RPC 2.0 server that speaks the Model Context Protocol. Only the subset prowl needs is implemented: initialize, tools/list, tools/call (plus the initialized notification).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Config         *config.Config
	Store          *store.Store
	Client         data.PRClient
	In             io.Reader
	Out            io.Writer
	AllowMutations bool
	DiffFetcher    func(context.Context, string) (string, error)
	Version        string
}

Options is the dependency bag for NewServer.

type Server

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

Server holds the wiring for a single MCP session.

func NewServer

func NewServer(opts Options) *Server

NewServer constructs a Server from Options. Defaults are filled in for In (stdin), Out (stdout) and DiffFetcher (data.FetchDiff).

func (*Server) Run

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

Run reads JSON-RPC messages line-by-line from In and writes responses to Out. Returns when In is closed or an unrecoverable error happens.

Jump to

Keyboard shortcuts

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