mcp

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

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

	DefaultListenAddr = "127.0.0.1:7474"

	DefaultSessionFlushInterval = 30 * time.Second
)

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 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) FlushSessions added in v0.3.5

func (s *Server) FlushSessions()

FlushSessions forces a ledger flush — used at shutdown and in tests.

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

func (*Server) RunSessionLedger added in v0.3.5

func (s *Server) RunSessionLedger(ctx context.Context)

RunSessionLedger flushes the session ledger on its interval until ctx ends.

Directories

Path Synopsis
Package jsonlsink is the shared append-only JSONL file primitive.
Package jsonlsink is the shared append-only JSONL file primitive.
Package ledger persists per-MCP-client session metrics to .remindb/sessions/ as append-only JSONL.
Package ledger persists per-MCP-client session metrics to .remindb/sessions/ as append-only JSONL.
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 rescan periodically recompiles a source tree into the store.
Package rescan periodically recompiles a source tree into the store.
Package rescanlog appends each serve source-rescan tick to an append-only .remindb/rescan.jsonl.
Package rescanlog appends each serve source-rescan tick to an append-only .remindb/rescan.jsonl.
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.
Package sessionlog tees a session's records into an append-only per-session file under .remindb/logs/.
Package sessionlog tees a session's records into an append-only per-session file under .remindb/logs/.

Jump to

Keyboard shortcuts

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