localvectordb_server.mcp.config module
MCP Server Configuration
Simple configuration management for LocalVectorDB MCP server that maps directly to LocalVectorDB constructor parameters.
- localvectordb_server.mcp.config.validate_database_name(name: str) None
Reject database names that could escape databases_root when joined into a filesystem path.
Names explicitly listed in
databases_mapare trusted operator configuration and are not subject to this check; callers should consult the map first (MCPConfig.get_database_pathdoes).- Raises:
ValueError – If the name is not a 1-128 character string starting with a letter or digit and containing only letters, digits, dots, underscores, and hyphens.
- class localvectordb_server.mcp.config.MCPConfig(mode: Literal['read-only', 'read-write']='read-only', databases_root: str = './databases', databases_map: Dict[str, str]=<factory>, db_defaults: Dict[str, ~typing.Any]=<factory>, remote_defaults: Dict[str, ~typing.Any]=<factory>, max_concurrent_operations: int = 10, operation_timeout: int = 300, log_operations: bool = True, log_level: str = 'INFO', read_only_tools: List[str] = <factory>, write_tools: List[str] = <factory>)
Bases:
objectConfiguration for MCP server operation
- classmethod load(config_path: str | None = None) MCPConfig
Load configuration from file or environment
- __init__(mode: Literal['read-only', 'read-write']='read-only', databases_root: str = './databases', databases_map: Dict[str, str]=<factory>, db_defaults: Dict[str, ~typing.Any]=<factory>, remote_defaults: Dict[str, ~typing.Any]=<factory>, max_concurrent_operations: int = 10, operation_timeout: int = 300, log_operations: bool = True, log_level: str = 'INFO', read_only_tools: List[str] = <factory>, write_tools: List[str] = <factory>) None