Skip to content

Configuration

VariableDescriptionDefault
TOOL_COMPASS_BASE_PATHProject root directoryAuto-detected from module location
TOOL_COMPASS_PYTHONPython executable pathCurrent interpreter or venv auto-detect
TOOL_COMPASS_CONFIGPath to config JSON file./compass_config.json
OLLAMA_URLOllama server URLhttp://localhost:11434
COMFYUI_URLComfyUI server URL (used by the comfy backend)http://localhost:8188
PORTSet to enable HTTP (streamable-http) transport instead of stdiounset (stdio mode)
HOSTHTTP bind address (only used when PORT is set)127.0.0.1 (loopback)
GRADIO_AUTHuser:pass required when launching tool-compass ui --share (also settable via --auth user:pass)unset (refuses --share without it)
HYPOTHESIS_PROFILEdev / ci / nightly profile for fuzz testsdev

Tool Compass reads settings from a JSON file at startup. The resolution order for the config path is:

  1. TOOL_COMPASS_CONFIG environment variable
  2. ./compass_config.json in the tool-compass directory

If no config file is found, built-in defaults are used. See compass_config.example.json in the repository for a complete example.

KeyTypeDefaultDescription
backendsobject(built-in defaults)Backend server connections keyed by name
embedding_modelstringnomic-embed-textOllama embedding model name
ollama_urlstringhttp://localhost:11434Ollama API base URL
index_dirstring./dbDirectory for HNSW index and SQLite databases
auto_syncbooltrueEnable automatic tool discovery from backends
default_top_kint5Default number of results for compass searches
min_confidencefloat0.3Default minimum similarity threshold
progressive_disclosurebooltrueReturn summaries only from compass (use describe for full schemas)
sync_check_on_startupbooltrueCheck for backend changes on first compass call
sync_polling_intervalint300Background polling interval in seconds (0 = disabled)
analytics_enabledbooltrueTrack search queries and tool calls in local SQLite
hot_cache_sizeint10Number of frequently used tools to keep in memory
chain_indexing_enabledbooltrueEnable tool chain detection and indexing
chain_detection_min_occurrencesint3Minimum pattern occurrences before promoting to a chain
top_chains_cache_sizeint5Number of top chains to keep in memory cache (clamped to ≥ 0; 0 disables the cache)
ollama_breaker_failure_thresholdint3Consecutive Ollama failures before the circuit breaker opens (clamped 120)
ollama_breaker_open_secondsfloat30.0How long the breaker stays open before a trial request, in seconds (clamped 1.0600.0)
ollama_retry_attemptsint3Retry attempts for a failed embedding request (clamped 010)
ollama_retry_backoffsfloat[][0.5, 1.0, 2.0]Per-retry backoff delays in seconds; resets to the default if not a list of non-negative numbers
hnsw_mint16HNSW graph connectivity (M); higher = better recall, more memory (clamped 464)
hnsw_ef_constructionint200HNSW build-time search width; higher = better index quality, slower build (clamped 40800)
hnsw_ef_searchint50HNSW query-time search width; higher = better recall, slower search (clamped 10400)
KeyTypeDefaultDescription
hybrid_searchbooltrueFuse the semantic (HNSW) and lexical signals with Reciprocal Rank Fusion on the healthy path. false = pure-semantic ordering.
exact_name_boostbooltrueAn exact tool-name match (full server:tool or the bare tool name) is boosted to rank #1.
exact_match_confidencefloat1.0Confidence assigned to an exact-name match (clamped 0.01.0).
analytics_retention_daysint30Prune analytics rows older than this on startup sync (0 = keep forever).
gateway_auth_tokenstring | nullnullBearer token required on the HTTP transport (opt-in). Set here or via TOOL_COMPASS_GATEWAY_AUTH_TOKEN (env wins). Redacted in doctor output. Never affects stdio.

Per-backend options (set inside a backends.<name> object):

KeyTypeApplies toDescription
default_timeoutfloat | nullstdio, httpPer-backend tool-call timeout in seconds, overriding the 15 s default (clamped 1.0600.0).
tool_timeoutsobjectstdio, httpPer-tool timeout override, keyed by the bare tool name (e.g. {"generate_image": 120}).
allow_toolsstring[]stdio, http, importGlob allowlist — only matching tools are indexed/executed (empty = allow all).
deny_toolsstring[]stdio, http, importGlob denylist — matching tools are never indexed/executed (deny wins over allow).

Backend names must not contain : — it is the reserved backend:tool separator. A colon in a backend name is rejected at config load.

Beyond local stdio subprocess servers, a backend can be a remote MCP server spoken over streamable-http:

{
"backends": {
"remote-fs": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer ${REMOTE_MCP_TOKEN}" },
"default_timeout": 30,
"deny_tools": ["*delete*", "*write*"]
}
}
}

Response headers are redacted in doctor/show_config output. To require a token on your gateway’s HTTP endpoint (as opposed to an upstream backend), set gateway_auth_token.

The config file supports ${VAR} substitution. Values are resolved from environment variables first, then from a defaults block in the config file:

{
"defaults": {
"BASE": "/home/user/project"
},
"backends": {
"bridge": {
"type": "stdio",
"command": "python",
"args": ["-u", "${BASE}/app/mcp/bridge_mcp_server.py"]
}
}
}
Terminal window
# Start with Docker Compose
docker-compose up
# Include Ollama in the stack
docker-compose --profile with-ollama up

The Gradio UI is available at http://localhost:7860 when running in Docker.

If Claude Desktop logs show JSON parse errors like:

Unexpected token 'S', "Starting T"... is not valid JSON

Cause: print() statements corrupt the JSON-RPC protocol.

Fix: Use logging or write to stderr:

import sys
print("Debug message", file=sys.stderr)
Terminal window
# Check Ollama is running
curl http://localhost:11434/api/tags
# Pull the embedding model
ollama pull nomic-embed-text

Rebuild the index using the v2.2 canonical CLI:

Terminal window
tool-compass sync

If a backend fails to connect, verify:

  1. The command in your config file is correct and the script exists
  2. The backend MCP server starts successfully when run standalone
  3. Check gateway logs with --verbose for detailed connection errors
  • Data touched: Tool descriptions indexed in local HNSW vector DB, search queries logged to local SQLite, embeddings generated via local Ollama
  • Data NOT touched: No user code, no file contents, no credentials. Tool call arguments are hashed, not stored in plain text
  • Network: Connects to local Ollama for embeddings. Optional Gradio UI binds to localhost. No external telemetry