Skip to main content

Overview

The OpenGround MCP server can be customized through configuration files, environment variables, and runtime settings. This guide covers all configuration options and best practices.

Configuration File

Location

OpenGround uses a JSON configuration file located at: Linux/macOS:
Windows:
Custom location (via XDG_CONFIG_HOME):

Structure

Configuration Options

Database Settings

string
default:"~/.local/share/openground/lancedb"
Path to the LanceDB database directory. All documentation vectors and metadata are stored here.Example: "/Users/john/.local/share/openground/lancedb"
string
default:"documents"
Name of the LanceDB table containing documentation chunks.Example: "documents", "docs_v2"
string
default:"~/.local/share/openground/raw_data"
Base directory for storing raw downloaded documentation HTML/markdown files.Example: "/Users/john/.local/share/openground/raw_data"

Extraction Settings

integer
default:"50"
Maximum number of concurrent HTTP requests when downloading documentation.Range: 1-200
Recommended: 20-100 depending on network bandwidth

Embedding Settings

integer
default:"32"
Number of text chunks to process in a single embedding batch.Range: 1-128
Memory impact: Higher = more memory usage
Speed impact: Higher = faster processing
integer
default:"800"
Maximum number of characters per documentation chunk.Range: 200-2000
Recommended: 600-1000 for balanced context
integer
default:"200"
Number of overlapping characters between adjacent chunks.Range: 0-500
Purpose: Ensures context continuity across chunk boundaries
string
default:"BAAI/bge-small-en-v1.5"
Hugging Face model identifier for generating embeddings.Popular options:
  • "BAAI/bge-small-en-v1.5" - Fast, 384 dimensions (default)
  • "BAAI/bge-base-en-v1.5" - Balanced, 768 dimensions
  • "BAAI/bge-large-en-v1.5" - Highest quality, 1024 dimensions
integer
default:"384"
Dimensionality of the embedding vectors. Must match the model’s output dimension.Model dimensions:
  • BGE-small: 384
  • BGE-base: 768
  • BGE-large: 1024
string
default:"fastembed"
Backend library for generating embeddings.Options:
  • "fastembed" - Fast, optimized for CPU (default)
  • "sentence-transformers" - More models, GPU support

Query Settings

integer
default:"5"
Number of search results returned by search_documents_tool.Range: 1-100
Recommended: 3-10 for most use cases

Source Settings

boolean
default:"true"
Automatically detect and add project-local source definitions.Purpose: Enables project-specific documentation sources via .openground/sources.json

Environment Variables

System Environment

These environment variables are set automatically by the MCP server at startup:
string
default:"false"
Disables tokenizer parallelism to prevent stdout pollution.Purpose: Ensures clean JSON-RPC communication with MCP clients
string
default:"error"
Reduces transformers library logging to errors only.Purpose: Prevents debug logs from interfering with MCP protocol
string
default:"1"
Suppresses fastembed transformers logging.Purpose: Clean server output

User Environment Variables

You can set these before running the MCP server:
string
Overrides the default config directory location.Example: export XDG_CONFIG_HOME=/custom/config
Result: Config file at /custom/config/openground/config.json
string
Overrides the default data directory location.Example: export XDG_DATA_HOME=/custom/data
Result: Database at /custom/data/openground/lancedb

MCP Server Configuration

FastMCP Settings

The server is built using FastMCP with these settings:

Server Startup Process

  1. Environment setup: Set silence environment variables
  2. Background initialization: Start daemon thread to pre-load resources
  3. Cache warming: Load library metadata and embedding model
  4. MCP transport: Initialize stdio transport
  5. Ready signal: Log “Server is fully ready” message

Pre-loading Behavior

The server pre-loads resources in a background thread:
Benefits:
  • First tool call is instant (no cold start)
  • Embedding model is in memory
  • Library metadata is cached
Startup time: 0.5-3 seconds depending on:
  • Number of libraries in database
  • Embedding model size
  • Disk I/O speed

Managing Configuration

View Current Config

Set Individual Values

Reset to Defaults

Edit Manually

Performance Tuning

For Fast Search (Low Latency)

Characteristics:
  • Search: < 100ms
  • Model size: ~90MB
  • Memory usage: ~200MB

For High Accuracy (Better Results)

Characteristics:
  • Search: 200-500ms
  • Model size: ~1.3GB
  • Memory usage: ~2GB
  • Better semantic understanding

For Large Documentation Sets

Characteristics:
  • Faster ingestion
  • Smaller chunks = more granular search
  • Higher batch size = faster embedding

For Memory-Constrained Systems

Characteristics:
  • Lower memory footprint
  • Slower processing
  • Still good search quality

Advanced Configuration

Custom Database Location

Move database to SSD for better performance:

Multiple Environments

Use different configs for development vs. production: Development:
Production:

Project-Local Sources

Create project-specific documentation sources:
.openground/sources.json:
With sources.auto_add_local: true, this source is automatically available when working in this directory.

Troubleshooting

Config File Not Found

Symptom: Server uses all defaults Solution: Create config file:

Invalid JSON

Error: Invalid JSON in config file Solution: Validate JSON syntax:
Or reset:

Changes Not Taking Effect

Symptom: Modified config but server still uses old values Solution: Configuration is cached at server startup. Restart your MCP client to reload the server with new config.

Database Path Issues

Error: Database not found or Table doesn't exist Solution: Verify paths are correct and accessible:

Embedding Model Download Fails

Symptom: Server hangs or errors during initialization Solution:
  1. Check internet connection
  2. Manually download model:
  3. Use alternative model:

Best Practices

Start with defaults, tune incrementally:
  1. Use default config initially
  2. Monitor search quality and performance
  3. Adjust one parameter at a time
  4. Measure impact before further changes
Don’t change embedding model after ingesting libraries:Changing embedding_model or embedding_dimensions after libraries are added will cause search to fail. If you need to change these:
  1. Export your library list: openground list > libraries.txt
  2. Delete database: rm -rf ~/.local/share/openground/lancedb
  3. Update config
  4. Re-add all libraries

Configuration Checklist

  • Config file is valid JSON
  • db_path points to accessible directory
  • embedding_dimensions matches embedding_model
  • chunk_size > chunk_overlap
  • top_k is reasonable (3-20)
  • concurrency_limit doesn’t overwhelm network
  • Environment variables don’t conflict
  • Server restarts after config changes

Next Steps

Search Documents

Learn how to effectively search documentation with your configured server

List Libraries

Understand available libraries and versions