mcp

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mcp implements a Model Context Protocol (MCP) server for Creel.

The server exposes Creel operations as MCP tools, allowing AI agents to interact with the Creel memory platform via the MCP stdio protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an MCP server that exposes Creel tools.

func NewServer

func NewServer(handler *ToolHandler) *Server

NewServer creates a new MCP server backed by the given tool handler.

func (*Server) Run

func (s *Server) Run(ctx context.Context, r io.Reader, w io.Writer) error

Run reads JSON-RPC requests from r and writes responses to w. It blocks until r is closed or ctx is cancelled.

func (*Server) RunStdio

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

RunStdio is a convenience method that runs the server on stdin/stdout. coverage:ignore - wraps Run with os.Stdin/Stdout; tested via Run directly

type Tool

type Tool struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	InputSchema json.RawMessage `json:"inputSchema"`
}

Tool describes an MCP tool.

type ToolHandler

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

ToolHandler executes MCP tool calls against Creel gRPC services.

func NewToolHandler

NewToolHandler creates a tool handler with gRPC service clients.

func (*ToolHandler) Execute

func (h *ToolHandler) Execute(ctx context.Context, name string, args json.RawMessage) (string, error)

Execute runs a tool by name with the given JSON arguments.

Jump to

Keyboard shortcuts

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