GXtract is a MCP server designed to integrate with VS Code and other compatible editors (documentation: sascharo.github.io/gxtract). It provides a suite of tools for interacting with the GroundX platform, enabling you to leverage its powerful document understanding capabilities directly within your development environment.
GXtract is a Model Context Protocol (MCP) server designed to integrate with VS Code and other compatible editors. It provides a suite of tools for interacting with the GroundX platform, enabling you to leverage its powerful document understanding capabilities directly within your development environment.
The high-level system architecture of GXtract illustrates how the components interact:
graph TB
subgraph "Client"
VSC[VS Code / Editor]
end
subgraph "GXtract MCP Server"
MCP[MCP Interface<br>stdio/http]
Server[GXtract Server]
Cache[Metadata Cache]
Tools[Tool Implementations]
end
subgraph "External Services"
GXAPI[GroundX API]
end
VSC -->|MCP Protocol| MCP
MCP --> Server
Server --> Tools
Tools -->|Query| GXAPI
Tools -->|Read/Write| Cache
Cache -.->|Refresh| GXAPI
This diagram shows:
For more detailed architecture information, see the full documentation.
Before you can use GXtract, you need to install UV (version 0.7.6 or higher), a modern Python package manager written in Rust that offers significant performance improvements over traditional tools.
Windows (PowerShell 7):
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Using pip:
pip install --upgrade uv
Using Homebrew (macOS):
brew install uv
Using pipx (isolated environment):
pipx install uv
After installation, verify that UV is working correctly:
uv --version
This should display version 0.7.6 or higher. For more information about UV, visit the official documentation.
Clone the GXtract Repository:
git clone <repository_url> # Replace <repository_url> with the actual URL
cd gxtract
Install Dependencies using UV:
Open a terminal in the gxtract
project directory and run:
uv sync
This command creates a virtual environment (if one doesn't exist or isn't active) and installs all necessary dependencies specified in pyproject.toml
and uv.lock
.
Set GroundX API Key:
The GXtract server requires your GroundX API key. You need to make this key available as an environment variable named GROUNDX_API_KEY
.
VS Code will pass this environment variable to the server based on the configuration below. Ensure GROUNDX_API_KEY
is set in the environment where VS Code is launched, or configure your shell profile (e.g., .bashrc
, .zshrc
, PowerShell Profile) to set it.
Option 1: Using Environment Variables (as shown above)
This approach reads the API key from your system environment variables:
"env": {
"GROUNDX_API_KEY": "${env:GROUNDX_API_KEY}"
}
Option 2: Using VS Code's Secure Inputs
VS Code can prompt for your API key and store it securely. Add this to your settings.json
:
"inputs": [
{
"type": "promptString",
"id": "groundx-api-key",
"description": "GroundX API Key",
"password": true
}
]
Then reference it in your server configuration:
"env": {
"GROUNDX_API_KEY": "${input:groundx-api-key}"
}
With this approach, VS Code will prompt you for the API key the first time it launches the server, then store it securely in your system's credential manager (Windows Credential Manager, macOS Keychain, or similar).
Configure VS Code settings.json
:
Open your VS Code settings.json
file (Ctrl+Shift+P, then search for "Preferences: Open User Settings (JSON)"). Add or update the mcp.servers
configuration:
"mcp": {
"servers": {
"gxtract": { // You can name this server entry as you like, i.e. GXtract
"command": "uv",
"type": "stdio", // 💡 http is also supported but VS Code only supports stdio currently
"args": [
// Adjust the path to your gxtract project directory if it's different
"--directory",
"DRIVE:\\path\\to\\your\\gxtract", // Example: C:\\Users\\yourname\\projects\\gxtract
"--project",
"DRIVE:\\path\\to\\your\\gxtract", // Example: C:\\Users\\yourname\\projects\\gxtract
"run",
"gxtract", // This matches the script name in pyproject.toml
"--transport",
"stdio" // 💡 Ensure this matches the "type" above
],
"env": {
// Option 1: Using environment variables (system-wide)
"GROUNDX_API_KEY": "${env:GROUNDX_API_KEY}"
// Option 2: Using secure VS Code input (uncomment to use)
// "GROUNDX_API_KEY": "${input:groundx-api-key}"
}
}
}
}
If using Option 2 (secure inputs), add this section (settings.json
):
// 💡 Only needed for Option 2 (secure inputs)
"inputs": [
{
"type": "promptString",
"id": "groundx-api-key",
"description": "GroundX API Key",
"password": true
}
]
Important:
"DRIVE:\\path\\to\\your\\gxtract"
with the absolute path to the gxtract
directory on your system."command": "uv"
assumes uv
is in your system's PATH. If not, you might need to provide the full path to the uv
executable."GXtract"
in settings.json
is how it will appear in VS Code's MCP interface.Reload VS Code:
After saving settings.json
, you might need to reload VS Code (Ctrl+Shift+P, "Developer: Reload Window") for the changes to take effect.
Using GXtract Tools:
Once configured, you can access GXtract's tools through VS Code's MCP features (e.g., via chat @
mentions if your VS Code version supports it, or other MCP integrations).
GXtract provides the following tools for interacting with GroundX:
groundx/searchDocuments
: Search for documents within your GroundX projects.groundx/queryDocument
: Ask specific questions about a document in GroundX.groundx/explainSemanticObject
: Get explanations for diagrams, tables, or other semantic objects within documents.cache/refreshMetadataCache
: Manually refresh the GroundX metadata cache.cache/refreshCachedResources
: Manually refresh the GroundX projects and buckets cache.cache/getCacheStatistics
: Get statistics about the cached metadata.cache/listCachedResources
: List all currently cached GroundX resources (projects, buckets).The server can be configured via command-line arguments when run directly. When used via VS Code, these are typically set in the args
array in settings.json
.
--transport {stdio|http}
: Communication transport type (default: http
, but stdio
is used for VS Code).--host TEXT
: Host address for HTTP transport (default: 127.0.0.1
).--port INTEGER
: Port for HTTP transport (default: 8080
).--log-level {DEBUG|INFO|WARNING|ERROR|CRITICAL}
: Logging level (default: INFO
).--log-format {text|json}
: Log output format (default: text
).--disable-cache
: Disable the GroundX metadata cache.--cache-ttl INTEGER
: Cache Time-To-Live in seconds (default: 3600
).The GroundX API key is sensitive information that should be handled securely. GXtract supports several approaches to provide this key:
Environment Variables (recommended for development):
GROUNDX_API_KEY
in your system or shell environment${env:GROUNDX_API_KEY}
in settings.jsonVS Code Secure Storage (recommended for shared workstations):
inputs
section in settings.json as shown in the Quick StartDirect Environment Variable in VS Code settings (not recommended):
"GROUNDX_API_KEY": "your-api-key-here"
Always ensure your API key is not committed to source control or shared with unauthorized users.
To set up for development:
gxtract
directory.uv
:
uv venv # Create virtual environment in .venv
.\.venv\Scripts\Activate.ps1
source .venv/bin/activate
uv sync # Install main dependencies from pyproject.toml
Development tools (like Ruff, Pytest, Sphinx, etc.) are managed by Hatch and will be installed automatically
into a separate environment when you run Hatch scripts (see below).
Alternatively, to explicitly create or ensure the Hatch 'default' development environment is set up:
hatch env create default # Ensure your main .venv is active first
If you need to force a complete refresh of this environment, you can remove it first
with 'hatch env remove default' before running 'hatch env create default'.Run linters/formatters (this will also install them via Hatch if not already present):
uv run lint
uv run format
The full documentation for GXtract is available at https://sascharo.github.io/gxtract/.
If you want to build and view the documentation locally:
Ensure you have installed all development dependencies:
uv sync
Build the documentation:
uv run hatch -e default run docs-build
Serve the documentation locally:
uv run hatch -e default run docs-serve
Open your browser and navigate to http://127.0.0.1:8000
The project documentation is built using Sphinx. The following Hatch scripts are available to manage the documentation:
Build Documentation:
uv run docs-build
This command generates the HTML documentation in the docs/sphinx/build/html
directory.
Serve Documentation Locally:
uv run docs-serve
This starts a local HTTP server (usually at http://127.0.0.1:8000
) to preview the documentation. You can specify a different port if needed, e.g., uv run docs-serve 8081
.
Clean Documentation Build:
uv run docs-clean
This command removes the docs/sphinx/build
directory, cleaning out old build artifacts.
Ensure your virtual environment is active before running these commands.
GXtract maintains an in-memory cache of GroundX metadata (projects and buckets) to improve performance and reduce API calls. While this cache is automatically populated during server startup and periodically refreshed, there are situations when you may need to manually refresh the cache.
You should manually refresh the cache when:
If your VS Code version supports MCP chat interfaces:
@GXtract
mention (or whatever name you assigned to the server in your settings).@GXtract Please refresh the GroundX metadata cache
If you have access to the server through HTTP (when not using stdio transport), you can make direct requests:
curl -X POST http://127.0.0.1:8080/jsonrpc -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "cache/refreshMetadataCache",
"params": {},
"id": "refresh-req-001"
}'
This warning indicates that:
Solution:
This warning appears during server startup if the initial cache population failed.
Solution:
cache/refreshMetadataCache
tool to manually populate the cache.You can check the current status of the cache with:
{
"jsonrpc": "2.0",
"method": "cache/getCacheStatistics",
"params": {},
"id": "stats-req-001"
}
Or list the currently cached resources:
{
"jsonrpc": "2.0",
"method": "cache/listCachedResources",
"params": {},
"id": "list-req-001"
}
GXtract uses uv for dependency management. Dependencies are specified in pyproject.toml
and locked in uv.lock
to ensure reproducible installations.
uv sync
to install all dependencies according to the lockfile.pyproject.toml
and run uv pip compile pyproject.toml -o uv.lock
to update the lockfile.pyproject.toml
, run uv pip compile pyproject.toml -o uv.lock --upgrade
to update the lockfile with newest compatible versions.The uv.lock
file is committed to the repository to ensure that everyone working on the project uses exactly the same dependency versions. This prevents "works on my machine" problems and ensures consistent behavior across development environments and CI/CD pipelines.
When making changes to dependencies, always commit both the updated pyproject.toml
and the uv.lock
file.
This project adheres to Semantic Versioning (SemVer 2.0.0).
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.
GitLab API, enabling project management
Create crafted UI components inspired by the best 21st.dev design engineers.
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.
MCP to interface with multiple blockchains, staking, DeFi, swap, bridging, wallet management, DCA, Limit Orders, Coin Lookup, Tracking and more.
Enable AI agents to interact with the Atla API for state-of-the-art LLMJ evaluation.
Get prescriptive CDK advice, explain CDK Nag rules, check suppressions, generate Bedrock Agent schemas, and discover AWS Solutions Constructs patterns.
Query and analyze your Axiom logs, traces, and all other event data in natural language
Bring the full power of BrowserStack’s Test Platform to your AI tools, making testing faster and easier for every developer and tester on your team.
Flag features, manage company data, and control feature access using Bucket