Documentation
¶
Overview ¶
Package mcp provides Model Context Protocol integration for kodelet.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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 ¶
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 ¶
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. |