mcp

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package mcp provides a simplified MCP server that calls internal packages directly.

This implementation uses the MCP SDK (github.com/modelcontextprotocol/go-sdk/mcp) and calls internal services directly without gRPC overhead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreReflectionReport added in v0.3.0

func StoreReflectionReport(report *reflection.ReflectionReport, projectPath string) (string, error)

StoreReflectionReport stores a reflection report to disk for later retrieval.

Types

type Config

type Config struct {
	// Name is the server implementation name (default: "contextd-v2")
	Name string

	// Version is the server version (default: "1.0.0")
	Version string

	// Logger for structured logging
	Logger *zap.Logger

	// IgnoreFiles is the list of ignore file names to parse from project root.
	// Default: [".gitignore", ".dockerignore", ".contextdignore"]
	IgnoreFiles []string

	// FallbackExcludes are used when no ignore files are found.
	// Default: [".git/**", "node_modules/**", "vendor/**", "__pycache__/**"]
	FallbackExcludes []string
}

Config configures the MCP server.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns sensible defaults.

type Server

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

Server is a simplified MCP server that calls internal packages directly.

func NewServer

func NewServer(
	cfg *Config,
	checkpointSvc checkpoint.Service,
	remediationSvc remediation.Service,
	repositorySvc *repository.Service,
	troubleshootSvc *troubleshoot.Service,
	reasoningbankSvc *reasoningbank.Service,
	foldingSvc *folding.BranchManager,
	distiller *reasoningbank.Distiller,
	scrubber secrets.Scrubber,
) (*Server, error)

NewServer creates a new MCP server with the given services.

func (*Server) Close

func (s *Server) Close() error

Close closes the server and all services.

func (*Server) Run

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

Run starts the MCP server on the stdio transport.

func (*Server) SetConversationService added in v0.3.0

func (s *Server) SetConversationService(svc conversation.ConversationService)

SetConversationService sets the optional conversation service. Must be called before Run() to enable conversation tools.

Directories

Path Synopsis
internal/mcp/handlers/memory.go
internal/mcp/handlers/memory.go

Jump to

Keyboard shortcuts

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