mcpserver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 28 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

Index

Constants

View Source
const MaxCachedProjects = 128

MaxCachedProjects bounds process-lifetime project services. Entries are never evicted because remote registration and queue state is load-bearing.

Variables

View Source
var (
	ErrInvalidProject       = errors.New("invalid project")
	ErrProjectFactoryClosed = errors.New("project service factory is closed")
	ErrProjectCapacity      = errors.New("project capacity reached")
)

Functions

func Handler

func Handler(server *mcp.Server) http.Handler

func New

func New(backend Backend, memories MemoryBackend, version ...string) *mcp.Server

func ProjectHandler

func ProjectHandler(servers ProjectServers) http.Handler

Types

type Backend

type Backend interface {
	ListSessions(context.Context) ([]broker.Session, error)
	GetSession(context.Context, string) (broker.Session, error)
	SendMessage(context.Context, broker.Message) (broker.SendResult, error)
	WaitForMessage(context.Context, string) (broker.Message, error)
	StopSession(context.Context, string) error
}

type ProjectFactory

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

func NewManagedProjectFactory

func NewManagedProjectFactory(registry ProjectRegistry, newRemote func(groups.ProjectDirectory) (Backend, error), version ...string) *ProjectFactory

NewManagedProjectFactory lets the server select durable project storage while compatibility callers retain their existing in-memory remote services.

func NewRemoteProjectFactory

func NewRemoteProjectFactory(registry ProjectRegistry, version ...string) *ProjectFactory

NewRemoteProjectFactory keeps shared memory on A and agent execution on B/C. No local harness driver is constructed or called for remote registrations.

func (*ProjectFactory) Close

func (f *ProjectFactory) Close() error

func (*ProjectFactory) CloseProject

func (f *ProjectFactory) CloseProject(ctx context.Context, project string) error

CloseProject evicts a managed project's stores after the HTTP owner has stopped admission and drained its requests. Unmanaged project state must never be evicted using this method.

func (*ProjectFactory) RemoteBackend

func (f *ProjectFactory) RemoteBackend(ctx context.Context, project string) (Backend, error)

RemoteBackend returns the same project service used by the MCP transport.

func (*ProjectFactory) Server

func (f *ProjectFactory) Server(ctx context.Context, project string) (*mcp.Server, error)

type ProjectRegistry

type ProjectRegistry interface {
	ProjectStorage(context.Context, string) (groups.ProjectDirectory, error)
}

type ProjectServers

type ProjectServers interface {
	Server(context.Context, string) (*mcp.Server, error)
}

Jump to

Keyboard shortcuts

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