mcp

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPHandler

func NewHTTPHandler(version string) *mcp.StreamableHTTPHandler

func NewServer

func NewServer(version string) *mcp.Server

Types

type DatabasesInput

type DatabasesInput struct {
}

type DatabasesOutput

type DatabasesOutput struct {
	Databases []string `json:"databases" jsonschema:"The list of database identifiers.,example=[\"ha.db\", \"test.db\"]"`
}

func Databases

func Databases(ctx context.Context, req *mcp.CallToolRequest, input DatabasesInput) (result *mcp.CallToolResult, output DatabasesOutput, err error)

type HistoryInput added in v0.15.6

type HistoryInput struct {
	DatabaseID string `json:"database_id,omitempty" jsonschema:"The identifier of the database (empty uses default).,example=ha.db"`
	Param      string `json:"param" jsonschema:"Sequence number (e.g. '10') or duration (e.g. '5m').,example=5m"`
}

type HistoryOutput added in v0.15.6

type HistoryOutput struct {
	History []haconnect.HistoryItem `json:"history" jsonschema:"List of committed transaction history items."`
}

func History added in v0.15.6

func History(ctx context.Context, req *mcp.CallToolRequest, input HistoryInput) (result *mcp.CallToolResult, output HistoryOutput, err error)

type QueryInput

type QueryInput struct {
	DatabaseID string `json:"database_id" jsonschema:"The identifier of the database to query.,example=ha.db"`
	// The query string to be executed.
	Query string `json:"query" jsonschema:"The query string to be executed.,example=SELECT * FROM users WHERE active = true"`
	// Optional parameters for the query.
	Params map[string]any `json:"params,omitempty" jsonschema:"Optional parameters for the query.,example={\"limit\": 10, \"offset\": 0}"`
}

type QueryOutput

type QueryOutput struct {
	// The column names of the query result.
	Columns []string `json:"columns" jsonschema:"The column names of the query result.,example=[\"id\", \"name\"]"`
	// The results of the query.
	Results [][]any `json:"results" jsonschema:"The results of the query.,example=[[1, \"Alice\"], [2, \"Bob\"]]"`
}

func Query

func Query(ctx context.Context, req *mcp.CallToolRequest, input QueryInput) (result *mcp.CallToolResult, output QueryOutput, err error)

type SchemaInput added in v0.15.6

type SchemaInput struct {
	DatabaseID string `json:"database_id,omitempty" jsonschema:"The identifier of the database to inspect (empty uses default).,example=ha.db"`
}

type SchemaItem added in v0.15.6

type SchemaItem struct {
	Name string `json:"name" jsonschema:"Object name"`
	Type string `json:"type" jsonschema:"Object type (table, view, index, trigger)"`
	SQL  string `json:"sql" jsonschema:"DDL statement used to create the object"`
}

type SchemaOutput added in v0.15.6

type SchemaOutput struct {
	Items []SchemaItem `json:"items" jsonschema:"Schema objects in the database."`
}

func Schema added in v0.15.6

func Schema(ctx context.Context, req *mcp.CallToolRequest, input SchemaInput) (result *mcp.CallToolResult, output SchemaOutput, err error)

type UndoInput added in v0.15.6

type UndoInput struct {
	DatabaseID string `json:"database_id,omitempty" jsonschema:"The identifier of the database (empty uses default).,example=ha.db"`
	Param      string `` /* 131-byte string literal not displayed */
	Filter     string `json:"filter,omitempty" jsonschema:"Optional undo filter: 'none', 'entity', or 'transaction'.,example=none"`
}

type UndoOutput added in v0.15.6

type UndoOutput struct {
	Status string `json:"status" jsonschema:"Undo result status message."`
}

func Undo added in v0.15.6

func Undo(ctx context.Context, req *mcp.CallToolRequest, input UndoInput) (result *mcp.CallToolResult, output UndoOutput, err error)

Jump to

Keyboard shortcuts

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