mcpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 14 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 mcpserver exposes the preview lifecycle as MCP tools over a transport. It is the only package that imports the MCP SDK and holds no lifecycle logic: handlers decode, call one preview.Service method and encode.

Index

Constants

View Source
const Name = "provr"

Name is the MCP server name clients see.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is the provr MCP server.

func New

func New(svc *preview.Service, logger *slog.Logger) *Server

New builds a server over svc. A nil logger discards server logs.

func (*Server) Run

func (s *Server) Run(ctx context.Context, t mcp.Transport) error

Run serves on t until the client disconnects or ctx is canceled.

func (*Server) Serve

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

Serve speaks the protocol over in and out (newline-delimited JSON-RPC). Nothing but protocol frames is written to out.

func (*Server) WithWorkdir

func (s *Server) WithWorkdir(dir string) *Server

WithWorkdir sets the directory preview_up uses when no worktree is given (default: the working directory at New). It returns s.

Jump to

Keyboard shortcuts

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