GXtract API Reference¶
This section provides auto-generated API documentation for the GXtract server modules and classes.
- gxtract.main.setup_logging(log_level, log_format)[source]¶
Configures the root logger based on server configuration.
- Return type:
- gxtract.main.cli_entry_point()[source]¶
Command-line interface entry point for the {APP_NAME}. Parses arguments, loads configuration, and starts the server.
- Return type:
Core server logic for initializing and running the FastMCP server.
- gxtract.server.run_server(config)[source]¶
Initializes and runs the MCP server based on the provided configuration. Lets KeyboardInterrupt propagate to the caller (main.py) for handling.
- Return type:
Handles server configuration from CLI arguments and environment variables.
- class gxtract.config.ServerConfig(transport='http', host='127.0.0.1', port=8080, log_level='INFO', log_format='text', groundx_api_key=None, disable_cache=False, fail_on_cache_init_error=False, is_vscode=False, default_bucket_id=None, friendly_errors=True, cli_args=<factory>)[source]¶
Bases:
object
Holds all server configuration settings.
-
transport: ``'stdio'`` |
'http'
= 'http'¶
-
log_level: ``'DEBUG'`` |
'INFO'
|'WARNING'
|'ERROR'
|'CRITICAL'
= 'INFO'¶
-
log_format: ``'text'`` |
'json'
= 'text'¶
- __init__(transport='http', host='127.0.0.1', port=8080, log_level='INFO', log_format='text', groundx_api_key=None, disable_cache=False, fail_on_cache_init_error=False, is_vscode=False, default_bucket_id=None, friendly_errors=True, cli_args=<factory>)¶
-
transport: ``'stdio'`` |
- gxtract.config.load_configuration(args)[source]¶
Loads configuration, prioritizing CLI arguments over environment variables, and then defaults.
- Return type:
Cache for GroundX metadata, such as projects and buckets.
This module provides an in-memory cache for frequently accessed GroundX metadata to reduce API calls and improve performance. The cache is populated on server startup and can be refreshed periodically or manually.
- class gxtract.cache.ProjectDetail[source]¶
Bases:
TypedDict
Structure for cached project details.
-
buckets:
list
[BucketDetail
]¶
-
buckets:
- class gxtract.cache.CacheStatistics[source]¶
Bases:
TypedDict
Structure for tracking cache performance metrics.
- class gxtract.cache.GroundXMetadataCache[source]¶
Bases:
TypedDict
Structure for the GroundX metadata cache.
-
projects:
list
[ProjectDetail
]¶
-
statistics:
CacheStatistics
¶
-
projects:
- gxtract.cache.get_cache_statistics()[source]¶
Returns the current cache statistics.
- Returns:
A dictionary containing cache hit/miss counts and other statistics.
- Return type:
Dict
- async gxtract.cache.refresh_groundx_metadata_cache()[source]¶
Refreshes the GroundX metadata cache by fetching projects and their buckets.
- Returns:
True if the cache was refreshed successfully, False otherwise.
- Return type:
- async gxtract.cache.get_cached_projects()[source]¶
Returns the list of cached projects.
If the cache is empty (possibly because it was disabled), this will still return an empty list. The calling code should handle this appropriately.
- Return type:
- async gxtract.cache.get_cached_project_by_id(project_id)[source]¶
Returns a specific project from cache by its ID.
If the cache is disabled, this will return None. The calling code should handle this by making a direct API call if needed.
- Return type: