mcp

package
v0.3.28-beta Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mcp provides Model Context Protocol integration for kodelet.

Index

Constants

This section is empty.

Variables

View Source
var ErrDirectMode = errors.New("MCP configured for direct mode")

ErrDirectMode is returned when MCP is configured for direct mode instead of code execution mode

Functions

func DefaultWorkspaceDir

func DefaultWorkspaceDir(projectDir string) (string, error)

DefaultWorkspaceDir returns the default cache directory for generated MCP code. The cache is isolated per project and stored under ~/.kodelet to keep Kodelet-owned artifacts in a single discoverable location.

func GetSocketPath

func GetSocketPath(sessionID string) (string, error)

GetSocketPath returns the absolute path to the MCP socket file for a given session. Each session gets its own socket to prevent conflicts when multiple kodelet instances run concurrently. The socket path can be explicitly overridden via mcp.code_execution.socket_path config.

func GetStandaloneSocketPath

func GetStandaloneSocketPath(projectDir string) (string, error)

GetStandaloneSocketPath returns the default socket path for `kodelet mcp serve`. Standalone servers are isolated per workspace so separate projects can run side by side.

func ResolveWorkspaceDir

func ResolveWorkspaceDir(projectDir string) (string, error)

ResolveWorkspaceDir returns the configured MCP workspace directory, falling back to the per-project cache directory when no explicit override is provided.

Types

type ExecutionSetup

type ExecutionSetup struct {
	RPCServer *rpc.MCPRPCServer
	StateOpts []tools.BasicStateOption
}

ExecutionSetup contains the result of setting up MCP code execution mode

func SetupExecutionMode

func SetupExecutionMode(ctx context.Context, mcpManager *tools.MCPManager, sessionID string, projectDir string) (*ExecutionSetup, error)

SetupExecutionMode sets up MCP code execution mode and returns the necessary components. Returns ErrDirectMode if execution mode is not "code" or mcpManager is nil. The sessionID is used to create a unique socket path for this session, preventing conflicts when multiple kodelet instances run concurrently.

Directories

Path Synopsis
Package codegen provides code generation for MCP tools.
Package codegen provides code generation for MCP tools.
Package rpc provides an RPC server for code execution to call MCP tools.
Package rpc provides an RPC server for code execution to call MCP tools.
Package runtime provides code execution runtime implementations.
Package runtime provides code execution runtime implementations.

Jump to

Keyboard shortcuts

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