mcp_data

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	ViewName  string `json:"view_name"`
	Dataset   string `json:"dataset"`
	Schema    string `json:"schema"`
	FileCount int    `json:"file_count"`
	TotalSize int64  `json:"total_size_bytes"`
}

CacheEntry describes a cached dataset/schema in the cache directory.

type Server

type Server struct {
	*mcp_meta.Server
	// contains filtered or unexported fields
}

Server holds state for MCP data tool handlers. It embeds *mcp_meta.Server for access to MaxCost and Logger.

func NewServer

func NewServer(config ServerConfig, logger *slog.Logger) *Server

NewServer creates a new Server with the given API key, and logger.

func (*Server) Close

func (s *Server) Close() error

Close closes the DuckDB connection.

func (*Server) GetCacheDB

func (s *Server) GetCacheDB() string

func (*Server) GetCacheDir

func (s *Server) GetCacheDir() string

func (*Server) GetMaxCost

func (s *Server) GetMaxCost() float64

func (*Server) InitCache

func (s *Server) InitCache() error

InitCache opens an in-memory DuckDB database and creates views for any existing cached parquet files.

func (*Server) RegisterDataTools

func (s *Server) RegisterDataTools(mcpServer *mcp_server.MCPServer)

RegisterDataTools registers data-specific MCP tools (fetch_range + cache tools).

type ServerConfig

type ServerConfig struct {
	ApiKey   string  // Databento API key
	MaxCost  float64 // Max cost for a query
	CacheDir string  // Directory for cached data files
	CacheDB  string  // Path to DuckDB database file (reserved for future use)
}

Jump to

Keyboard shortcuts

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