mcpruntime

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

@index Shared MCP runtime assembly for stdio and HTTP server entry points.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlushQueryCache

func FlushQueryCache(cache *mcp.Cache)

FlushQueryCache clears the MCP query cache if it exists. @intent let graph updates invalidate shared MCP cache without coupling to transport packages. @sideEffect cache가 있으면 저장된 질의 결과를 비운다.

func RunStdio

func RunStdio(components Components, opts Options) error

RunStdio assembles and serves MCP over stdio. @intent keep the local ccg binary on a stdio-only runtime without importing HTTP/webhook server code. @sideEffect starts a long-running stdio MCP process and handles SIGINT/SIGTERM shutdown.

Types

type Components

type Components struct {
	Logger            *slog.Logger
	Store             *graphgorm.Store
	UnitOfWork        ingest.UnitOfWork
	Search            ingest.SearchWriter
	SearchMaintenance document.Maintenance
	SearchReader      *searchsql.Reader
	Walkers           map[string]*treesitter.Walker
	Syncer            *incremental.Syncer
}

Components is the runtime-owned application and adapter set required to assemble MCP. @intent share one MCP assembly path without making the MCP runtime import its parent composition package.

type Instance

type Instance struct {
	Server *mcpgo.MCPServer
	Cache  *mcp.Cache
	Deps   *mcp.Deps
	// contains filtered or unexported fields
}

Instance is a fully assembled MCP server plus runtime resources. @intent share MCP server construction while keeping stdio and HTTP transports in separate packages.

func New

func New(components Components, opts Options) (*Instance, error)

New assembles MCP handlers, cache, and telemetry. @intent centralize common MCP dependency wiring without linking webhook/HTTP code into the local CLI binary. @sideEffect initializes telemetry and optional in-memory cache.

func (*Instance) Close

func (i *Instance) Close()

Close releases MCP cache and telemetry resources. @intent provide one idempotent cleanup path for transport-specific runners. @sideEffect closes the cache and shuts down telemetry with a bounded context.

type Options

type Options struct {
	CacheTTL            time.Duration
	NoCache             bool
	OTELEndpoint        string
	NamespaceRoot       string
	RepoRoot            string
	MaxFileBytes        int64
	MaxTotalParsedBytes int64
	ServiceVersion      string
	RagIndexDir         string
	RagProjectDesc      string
}

Options controls shared MCP runtime setup independent of transport. @intent pass cache, telemetry, namespace, RAG, and parse-limit settings without importing HTTP server code.

Jump to

Keyboard shortcuts

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