mcpruntime

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 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(rt *core.Runtime, 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 Instance

type Instance struct {
	Server             *mcpgo.MCPServer
	Cache              *mcp.Cache
	Deps               *mcp.Deps
	PostprocessSummary func(context.Context) (*postprocesspolicy.StatusSummary, error)
	// 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(rt *core.Runtime, opts Options) (*Instance, error)

New assembles MCP handlers, cache, telemetry, and postprocess policy. @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 MCPPostprocessPolicy

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

MCPPostprocessPolicy manages post-processing policies for the MCP runtime. @intent MCP 실행 경로가 후처리 정책 결정을 공통 래퍼로 호출하게 한다.

func NewPostprocessPolicy

func NewPostprocessPolicy(db *gorm.DB) *MCPPostprocessPolicy

NewPostprocessPolicy creates a new MCP post-processing policy wrapper. @intent MCP 실행 경로에서 후처리 정책 엔진과 저장소를 함께 묶어 제공한다.

func (*MCPPostprocessPolicy) RecordRun

RecordRun logs the results of a post-processing run. @intent 후처리 실행 결과를 정책 저장소에 기록해 후속 판단에 반영한다. @sideEffect ccg_postprocess_run_logs 상태를 갱신한다.

func (*MCPPostprocessPolicy) Reset

func (p *MCPPostprocessPolicy) Reset(ctx context.Context, tool string) error

Reset clears the state of a specific post-processing tool. @intent 실패 누적 상태를 초기화해 특정 후처리 도구를 다시 정상 정책으로 돌린다. @sideEffect 해당 도구의 정책 상태를 재설정한다.

func (*MCPPostprocessPolicy) Resolve

Resolve decides the policy for a given tool and input. @intent 요청된 후처리 도구에 적용할 정책과 출처를 계산한다.

func (*MCPPostprocessPolicy) Status

Status returns the current status summary of post-processing. @intent 운영 상태 엔드포인트가 후처리 건강 상태를 요약해서 볼 수 있게 한다.

type Options

type Options struct {
	CacheTTL            time.Duration
	NoCache             bool
	OTELEndpoint        string
	NamespaceRoot       string
	WorkspaceRoot       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