mcp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunRouter

func RunRouter(config Config, logger *slog.Logger, regs map[string]ToolRegistrationFunc) error

RunRouter runs the MCP server with the given configuration and logger.

func SetDatabase

func SetDatabase(conn *sql.DB) error

SetDatabase sets the DuckDB connection for the MCP server.

Types

type Config

type Config struct {
	Name    string // Service Name
	Version string // Service Version

	UseSSE      bool   // Use SSE Transport instead of STDIO
	SSEHostPort string // HostPort to use for SSE
}

Config is configuration for our MCP server

type ToolMap

type ToolMap map[string]ToolRegistrationFunc

ToolMap is a map of names to ToolRegistrationFunc registration functions.

type ToolRegistrationFunc

type ToolRegistrationFunc func(mcpServer *mcp_server.MCPServer, conn *sql.DB) error

ToolRegistrationFunc is a function type for registering tools with the MCP server. It takes an MCPServer and a database, returning an error if any.

Jump to

Keyboard shortcuts

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