Documentation
¶
Overview ¶
Package server implements the MCP (Model Context Protocol) server for database operations.
Index ¶
- type MCPServer
- func (ms *MCPServer) AddCustomTool(name, description, sourceName, query string, parameters []string) error
- func (ms *MCPServer) AddSource(name string, src core.Source, readOnly bool)
- func (ms *MCPServer) ConfigureSecurity(maxRowLimit int, enablePIIMasking bool, piiPatterns []security.MaskPattern, ...) error
- func (ms *MCPServer) GetSchemaContext() string
- func (ms *MCPServer) LoadSchemas(ctx context.Context) error
- func (ms *MCPServer) StartStdio() error
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 represents the MCP server instance that handles database queries.
func NewMCPServer ¶
NewMCPServer creates a new MCP server instance with the specified name and version. It automatically registers the query_database tool for executing SQL queries.
func (*MCPServer) AddCustomTool ¶ added in v0.2.0
func (ms *MCPServer) AddCustomTool(name, description, sourceName, query string, parameters []string) error
AddCustomTool registers a custom tool with a predefined query.
func (*MCPServer) AddSource ¶
AddSource registers a database source with the given name. This makes the source available for query execution via the MCP protocol.
func (*MCPServer) ConfigureSecurity ¶ added in v0.2.0
func (ms *MCPServer) ConfigureSecurity(maxRowLimit int, enablePIIMasking bool, piiPatterns []security.MaskPattern, allowedKeywords, blockedKeywords []string) error
ConfigureSecurity initializes security components with config values.
func (*MCPServer) GetSchemaContext ¶ added in v0.2.0
GetSchemaContext returns the pre-built schema context for use in AI prompts.
func (*MCPServer) LoadSchemas ¶ added in v0.2.0
LoadSchemas loads database schemas from all sources and builds the context prompt. This should be called after all sources are added and connected.
func (*MCPServer) StartStdio ¶
StartStdio starts the MCP server using stdio transport. This is the standard transport for Claude Desktop integration.