Semantic MCP tool discovery gateway - find tools by intent, not memory
Project description
日本語 | 中文 | Español | Français | हिन्दी | Italiano | Português (BR)
Semantic navigator for MCP tools - Find the right tool by intent, not memory
95% fewer tokens. Find tools by describing what you want to do.
Installation • Usage • Docker • Handbook • Performance • Contributing
The Problem
MCP servers expose dozens or hundreds of tools. Loading all tool definitions into context wastes tokens and slows down responses.
Before: 77 tools × ~500 tokens = 38,500 tokens per request
After: 1 compass tool + 3 results = ~2,000 tokens per request
Savings: 95%
The Solution
Tool Compass uses semantic search to find relevant tools from a natural language description. Instead of loading all tools, Claude calls compass() with an intent and gets back only the relevant tools.
Quick Start
📖 Full documentation: See the Tool Compass Handbook for installation, configuration, and architecture deep-dives.
Option 1: Local Installation
# Prerequisites: Ollama with nomic-embed-text
ollama pull nomic-embed-text
# Clone and setup
git clone https://github.com/mcp-tool-shop-org/tool-compass.git
cd tool-compass
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Build the search index
python gateway.py --sync
# Run the MCP server
python gateway.py
# Or launch the Gradio UI
python ui.py
Option 2: Docker
# Clone the repo
git clone https://github.com/mcp-tool-shop-org/tool-compass.git
cd tool-compass
# Start with Docker Compose (requires Ollama running locally)
docker-compose up
# Or include Ollama in the stack
docker-compose --profile with-ollama up
# Access the UI at http://localhost:7860
The GHCR image (
ghcr.io/mcp-tool-shop-org/tool-compass) supportslinux/amd64andlinux/arm64, so the same tag runs on x86_64 servers and Apple Silicon / ARM workstations.
Features
- Semantic Search - Find tools by describing what you want to do
- Progressive Disclosure -
compass()→describe()→execute() - Hot Cache - Frequently used tools are pre-loaded
- Chain Detection - Automatically discovers common tool workflows
- Analytics - Track usage patterns and tool performance
- Cross-Platform - Windows, macOS, Linux
- Docker Ready - One-command deployment
Architecture
┌─────────────────────────────────────────────────────────────┐
│ TOOL COMPASS │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Ollama │ │ hnswlib │ │ SQLite │ │
│ │ Embedder │───▶│ HNSW │◀───│ Metadata │ │
│ │ (nomic) │ │ Index │ │ Store │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Gateway (9 tools)│ │
│ │ compass, describe│ │
│ │ execute, etc. │ │
│ └──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Usage
The compass() Tool
compass(
intent="I need to generate an AI image from a text description",
top_k=3,
category=None, # Optional: "file", "git", "database", "ai", etc.
min_confidence=0.3
)
Returns:
{
"matches": [
{
"tool": "comfy:comfy_generate",
"description": "Generate image from text prompt using AI",
"category": "ai",
"confidence": 0.912
}
],
"total_indexed": 44,
"tokens_saved": 20500,
"hint": "Found: comfy:comfy_generate. Use describe() for full schema."
}
Available Tools
| Tool | Description |
|---|---|
compass(intent) |
Semantic search for tools |
describe(tool_name) |
Get full schema for a tool |
execute(tool_name, args) |
Run a tool on its backend |
compass_categories() |
List categories and servers |
compass_status() |
System health and config |
compass_analytics(timeframe) |
Usage statistics |
compass_chains(action) |
Manage tool workflows |
compass_sync(force) |
Rebuild index from backends |
compass_audit() |
Full system report |
Progressive Disclosure Pattern
Tool Compass uses a three-step progressive disclosure pattern to minimize token usage:
1. compass("your intent") → Get tool name + short description (~100 tokens)
2. describe("tool:name") → Get full parameter schema (~500 tokens)
3. execute("tool:name", args) → Run the tool
Why this matters:
- Loading 77 tools upfront = ~38,500 tokens
- Progressive disclosure = ~600 tokens per tool used
- Savings: 95%+ for typical workflows
Example workflow:
# Step 1: Find the right tool
compass("generate an image from text")
# Returns: comfy:comfy_generate (confidence: 0.91)
# Step 2: Get the schema (only if needed)
describe("comfy:comfy_generate")
# Returns: Full parameter definitions, types, examples
# Step 3: Execute
execute("comfy:comfy_generate", {"prompt": "a sunset over mountains"})
The hint field in compass results guides this flow, suggesting when to use describe().
Configuration
| Variable | Description | Default |
|---|---|---|
TOOL_COMPASS_BASE_PATH |
Project root | Auto-detected |
TOOL_COMPASS_PYTHON |
Python executable | Auto-detected |
TOOL_COMPASS_CONFIG |
Config file path | ~/.config/tool-compass/compass_config.json |
TOOL_COMPASS_DATA_DIR |
Data directory | Platform-specific (see below) |
OLLAMA_URL |
Ollama server URL | http://localhost:11434 |
COMFYUI_URL |
ComfyUI server | http://localhost:8188 |
PORT |
Set to enable HTTP transport (e.g., for Fly.io) | unset (stdio) |
Default data directories:
- Windows:
%LOCALAPPDATA%\tool-compass\ - macOS:
~/Library/Application Support/tool-compass/ - Linux:
~/.config/tool-compass/(or$XDG_CONFIG_HOME/tool-compass/)
See .env.example for all options.
Performance
| Metric | Value |
|---|---|
| Index build time | ~5s for 44 tools |
| Query latency | ~15ms (including embedding) |
| Token savings | ~95% (38K → 2K) |
| Accuracy@3 | ~95% (correct tool in top 3) |
Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=. --cov-report=html
# Skip integration tests (no Ollama required)
pytest -m "not integration"
Troubleshooting
MCP Server Not Connecting
If Claude Desktop logs show JSON parse errors:
Unexpected token 'S', "Starting T"... is not valid JSON
Cause: print() statements corrupt JSON-RPC protocol.
Fix: Use logging or file=sys.stderr:
import sys
print("Debug message", file=sys.stderr)
Ollama Connection Failed
# Check Ollama is running
curl http://localhost:11434/api/tags
# Pull the embedding model
ollama pull nomic-embed-text
Index Not Found
python gateway.py --sync
Related Projects
Part of the Compass Suite for AI-powered development:
- File Compass - Semantic file search
- Integradio - Vector-embedded Gradio components
- Backpropagate - Headless LLM fine-tuning
- Comfy Headless - ComfyUI without the complexity
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Security & Data Scope
Tool Compass is a local-first development tool. See SECURITY.md for full policy.
- Data touched: tool descriptions indexed in local HNSW vector DB, search queries logged to local SQLite (
compass_analytics.db), 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.
- No telemetry: collects nothing externally. Analytics are local-only.
Scorecard
| Category | Score | Notes |
|---|---|---|
| A. Security | 10/10 | SECURITY.md, local-only, no telemetry, parameterized SQL |
| B. Error Handling | 10/10 | Structured results, graceful Ollama fallback |
| C. Operator Docs | 10/10 | README, CHANGELOG, CONTRIBUTING, API docs |
| D. Shipping Hygiene | 10/10 | CI (lint + tests + coverage + pip-audit + Docker), verify script |
| E. Identity | 10/10 | Logo, translations, landing page |
| Total | 50/50 |
License
MIT - see LICENSE file for details.
Built by MCP Tool Shop
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tool_compass-2.2.2.tar.gz.
File metadata
- Download URL: tool_compass-2.2.2.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea997ec85b1d340cd3249fcc910fa56fe0a5690ae1d6cfb9d8bdb177c751f1a2
|
|
| MD5 |
eb5b03dda8c39aab2c5e0627b553e488
|
|
| BLAKE2b-256 |
cf0d6cec2e3940ca39e1bfca449a01ad5b00fcf176fcf41c8f81c3fdde148301
|
Provenance
The following attestation bundles were made for tool_compass-2.2.2.tar.gz:
Publisher:
publish.yml on mcp-tool-shop-org/tool-compass
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tool_compass-2.2.2.tar.gz -
Subject digest:
ea997ec85b1d340cd3249fcc910fa56fe0a5690ae1d6cfb9d8bdb177c751f1a2 - Sigstore transparency entry: 1365825829
- Sigstore integration time:
-
Permalink:
mcp-tool-shop-org/tool-compass@e2633a2028c76b99854ca4352ff1eac2c96dbcc4 -
Branch / Tag:
refs/tags/v2.2.2 - Owner: https://github.com/mcp-tool-shop-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2633a2028c76b99854ca4352ff1eac2c96dbcc4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tool_compass-2.2.2-py3-none-any.whl.
File metadata
- Download URL: tool_compass-2.2.2-py3-none-any.whl
- Upload date:
- Size: 99.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e590f3a767a0cd40df6a84688525c7d2fdb6ddc78aa6848076e9ab066ef8d381
|
|
| MD5 |
d1fdfffc7346d24c96251935d9d05e01
|
|
| BLAKE2b-256 |
42cd856b2fcd60fbe49d97d1170e3719502c5fc5a20ac15091a0322aef4ab10b
|
Provenance
The following attestation bundles were made for tool_compass-2.2.2-py3-none-any.whl:
Publisher:
publish.yml on mcp-tool-shop-org/tool-compass
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tool_compass-2.2.2-py3-none-any.whl -
Subject digest:
e590f3a767a0cd40df6a84688525c7d2fdb6ddc78aa6848076e9ab066ef8d381 - Sigstore transparency entry: 1365825917
- Sigstore integration time:
-
Permalink:
mcp-tool-shop-org/tool-compass@e2633a2028c76b99854ca4352ff1eac2c96dbcc4 -
Branch / Tag:
refs/tags/v2.2.2 - Owner: https://github.com/mcp-tool-shop-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2633a2028c76b99854ca4352ff1eac2c96dbcc4 -
Trigger Event:
release
-
Statement type: