localvectordb_server.mcp.config module

MCP Server Configuration

Simple configuration management for LocalVectorDB MCP server that maps directly to LocalVectorDB constructor parameters.

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: object

Configuration for MCP server operation

mode: Literal['read-only', 'read-write'] = 'read-only'
databases_root: str = './databases'
databases_map: Dict[str, str]
db_defaults: Dict[str, Any]
remote_defaults: Dict[str, Any]
max_concurrent_operations: int = 10
operation_timeout: int = 300
log_operations: bool = True
log_level: str = 'INFO'
read_only_tools: List[str]
write_tools: List[str]
check_write_permission(operation: str)

Check if write operations are allowed

get_database_path(name: str) str

Get the path or URL for a database

get_enabled_tools() List[str]

Get list of tools enabled for current mode

classmethod from_env() MCPConfig

Load configuration from environment variables

classmethod from_file(path: str) MCPConfig

Load configuration from TOML file

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