mcp

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPServer

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

MCPServer wraps the mcp-go server with Faucet-specific tool and resource registrations. It exposes database services as MCP tools so AI agents can discover schemas, query data, and perform CRUD operations.

func NewMCPServer

func NewMCPServer(registry *connector.Registry, store *config.Store, logger *slog.Logger) *MCPServer

NewMCPServer creates an MCPServer pre-loaded with all Faucet tools and resources. The returned server is ready to serve over stdio or HTTP.

func (*MCPServer) HTTPHandler

func (s *MCPServer) HTTPHandler() http.Handler

HTTPHandler returns an http.Handler implementing the Streamable HTTP MCP transport. This is suitable for mounting on an existing HTTP server/router so the MCP endpoint runs alongside the REST API on the same port.

func (*MCPServer) ServeHTTP

func (s *MCPServer) ServeHTTP(addr string) error

ServeHTTP starts the MCP server in Streamable HTTP mode, listening on the given address (e.g. ":3001"). This is suitable for remote MCP clients.

func (*MCPServer) ServeStdio

func (s *MCPServer) ServeStdio() error

ServeStdio starts the MCP server in stdio mode. This is the primary integration path for Claude Code, Claude Desktop, and other MCP clients that launch the server as a subprocess.

func (*MCPServer) Server

func (s *MCPServer) Server() *server.MCPServer

Server returns the underlying mcp-go MCPServer instance. Useful for advanced configuration or testing.

Jump to

Keyboard shortcuts

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