mcp

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mcp provides the Model Context Protocol (MCP) tool implementations for the artifact service. These handlers allow LLMs to interact with the artifact store via the MCP framework.

Index

Constants

This section is empty.

Variables

View Source
var MCPListLimit = 100

MCPListLimit defines the default maximum number of artifacts returned via MCP.

Functions

func DeleteArtifact

func DeleteArtifact(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

DeleteArtifact is an MCP tool handler that removes an artifact from the store.

func ListArtifacts

func ListArtifacts(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

ListArtifacts is an MCP tool handler that returns a list of available artifacts.

func ReadArtifact

func ReadArtifact(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

ReadArtifact is an MCP tool handler that retrieves an artifact's content.

func SetMCPListLimit

func SetMCPListLimit(limit int)

SetMCPListLimit updates the default limit for listing artifacts.

func SetStore

func SetStore(s *storage.Store)

SetStore updates the global store instance used by all MCP handlers.

func WriteArtifact

func WriteArtifact(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)

WriteArtifact is an MCP tool handler that saves a file to the artifacts store. It returns a JSON response containing the artifact ID and a reference tag.

Types

type DeleteArtifactArgs

type DeleteArtifactArgs struct {
	ID     string `json:"id"`                // The ID or filename of the artifact to delete
	UserID string `json:"user_id,omitempty"` // The user scope
}

DeleteArtifactArgs defines the input for deleting an artifact via MCP.

type ListArtifactsArgs

type ListArtifactsArgs struct {
	UserID string `json:"user_id,omitempty"` // Optional user scope to filter results
}

ListArtifactsArgs defines the input for listing artifacts via MCP.

type ReadArtifactArgs

type ReadArtifactArgs struct {
	ID     string `json:"id"`                // The ID or filename of the artifact
	UserID string `json:"user_id,omitempty"` // The user scope
}

ReadArtifactArgs defines the input for reading an artifact via MCP.

type WriteArtifactArgs

type WriteArtifactArgs struct {
	Filename       string                 `json:"filename"`                   // Desired filename (e.g. "report.md")
	Content        string                 `json:"content"`                    // Text content to store
	Description    string                 `json:"description,omitempty"`      // Optional human-readable description
	MimeType       string                 `json:"mime_type,omitempty"`        // Optional MIME type (autodetected if empty)
	ExpiresInHours int                    `json:"expires_in_hours,omitempty"` // Hours until auto-deletion (default 24)
	Metadata       map[string]interface{} `json:"metadata,omitempty"`         // Arbitrary key-value pairs
	UserID         string                 `json:"user_id,omitempty"`          // Scopes the artifact to a specific user
}

WriteArtifactArgs defines the input for saving an artifact via MCP.

Jump to

Keyboard shortcuts

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