mcp

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransportStdio = "stdio"
	TransportHttp  = "http"

	DefaultListenAddr = "127.0.0.1:7474"
)

Variables

This section is empty.

Functions

func MaybeInitialCompile

func MaybeInitialCompile(ctx context.Context, st *store.Store, dir string, logger *slog.Logger) error

Run an initial compile when the store is empty; no-op otherwise.

Types

type Option added in v0.1.3

type Option func(*options)

func WithListen added in v0.2.0

func WithListen(addr string) Option

func WithListener added in v0.2.0

func WithListener(l net.Listener) Option

func WithLogBuffer added in v0.3.4

func WithLogBuffer(b *logbuf.Buffer) Option

func WithLogger added in v0.1.3

func WithLogger(l *slog.Logger) Option

func WithRedactor added in v0.3.2

func WithRedactor(r *redaction.Redactor) Option

func WithRescanStatus added in v0.3.4

func WithRescanStatus(s *rescanstat.Status) Option

func WithSourceDir added in v0.1.3

func WithSourceDir(dir string) Option

func WithTransport added in v0.2.0

func WithTransport(t string) Option

func WithWorkspaceConfig added in v0.3.2

func WithWorkspaceConfig(c config.Config) Option

type RescanLoop

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

func NewRescanLoop

func NewRescanLoop(st *store.Store, dir string, interval time.Duration, cc config.CompileConfig, logger *slog.Logger, status *rescanstat.Status) (*RescanLoop, error)

func (*RescanLoop) Run

func (r *RescanLoop) Run(ctx context.Context)

func (*RescanLoop) SetChangeObserver added in v0.3.4

func (r *RescanLoop) SetChangeObserver(fn func())

SetChangeObserver sets a callback fired after a scan that mutated the store, set before Run (nil disables).

type Server

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

func NewServer

func NewServer(st *store.Store, tracker *temperature.Tracker, cfg temperature.Config, opts ...Option) (*Server, error)

func (*Server) Connect

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

func (*Server) NotifyColdNodes

func (s *Server) NotifyColdNodes(ctx context.Context, cold []*store.Node) []string

Send a cold-node warning and return the IDs that reached at least one session.

func (*Server) NotifyLogRecord added in v0.3.4

func (s *Server) NotifyLogRecord()

NotifyLogRecord signals a new server log record (heavily coalesced).

func (*Server) NotifyRescan added in v0.3.4

func (s *Server) NotifyRescan()

NotifyRescan signals that a source rescan reshaped the compiled set.

func (*Server) NotifyTemperatureTick added in v0.3.4

func (s *Server) NotifyTemperatureTick()

NotifyTemperatureTick signals that a temperature tick mutated heat values.

func (*Server) Run

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

Directories

Path Synopsis
Package notify coalesces resource-change events into debounced notifications/resources/updated, keyed per resource URI.
Package notify coalesces resource-change events into debounced notifications/resources/updated, keyed per resource URI.
Package rescanstat holds the latest source-rescan tick result for the rescan resource to project.
Package rescanstat holds the latest source-rescan tick result for the rescan resource to project.
Package resources serves read-only MCP resources.
Package resources serves read-only MCP resources.
Package session tracks active MCP client sessions for the bound database.
Package session tracks active MCP client sessions for the bound database.

Jump to

Keyboard shortcuts

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