Skip to main content
Glama
Protocol-X-01

The Toolbox MCP

README.md
# The Toolbox MCP

๐Ÿš€ **AI Agent Tool Discovery via Librarian + Tavily**

An MCP (Model Context Protocol) server that enables AI agents to discover installed tools and packages using Librarian's system-wide index, enriched with real-time web intelligence from Tavily.

---

## โœจ Features

- **Tool Discovery:** Query 9,236+ tools across 14 package managers
- **Full-Text Search:** Millisecond-fast FTS5 queries
- **Tavily Integration:** Real-time tool research and descriptions
- **Safe:** Read-only, bounded, no tool execution
- **MCP Native:** Works with Claude, Bifang, and other MCP clients

---

## ๐Ÿ› ๏ธ Tools Provided

### 1. `toolbox_search`
Search for tools by keywords with pagination.

### 2. `toolbox_describe`  
Get detailed info for a specific tool.

### 3. `toolbox_inventory`
Overview of indexed tools, sources, and categories.

### 4. `toolbox_research` ๐Ÿ†• (Tavily)
Enrich tool information with real-time web search via Tavily.

---

## ๐Ÿš€ Quick Start

### Prerequisites

- Python 3.11+
- `uv` package manager
- Librarian index database
- Tavily API key (optional, for enrichment)

### Setup

```bash
# Clone this repo
git clone https://github.com/Protocol-X-01/toolbox-mcp.git
cd toolbox-mcp

# Install dependencies
uv sync --locked

# Set environment variables
export TAVILY_API_KEY='tvly_your_key_here'

# Run the server
uv run --frozen the-toolbox --db /path/to/librarian/index.db
```

---

## ๐Ÿ” Tavily Integration

The Toolbox MCP uses **Tavily** instead of Bright Data for tool enrichment:

### Benefits

โœ… **Real-time Research:** Current documentation and examples  
โœ… **High Quality:** LLM-optimized results  
โœ… **Affordable:** Pay-per-use, no subscription  
โœ… **Simple:** One API key, works everywhere  
โœ… **Transparent:** Clear sources and citations  

### How It Works

When `toolbox_research` is called:

1. Search Librarian index for tool
2. Query Tavily for latest info
3. Combine indexed + web data
4. Return enriched result

### Example

```python
# Search for a tool
result = toolbox_search("sql injection")

# Enrich with Tavily
enriched = toolbox_research("sqlmap")
# Returns:
{
  "name": "sqlmap",
  "source": "pacman",
  "category": "webapp",
  "version": "1.10.5-1",
  "path": "/usr/bin/sqlmap",
  "tavily_enriched": {
    "description": "Automatic SQL injection and database takeover tool",
    "github": "https://github.com/sqlmapproject/sqlmap",
    "documentation": "https://sqlmap.org",
    "last_updated": "2026-10-29"
  }
}
```

---

## ๐Ÿ“Š Stats

**Current Index (as of 2026-10-29):**
- **Total Tools:** 9,236
- **Sources:** 14 package managers
- **Categories:** 60+ types
- **Query Time:** <8ms average

---

## ๐Ÿ”— Integration

### With Bifang

```bash
export BIFANG_MCP_SERVERS=[{
  "name":"the-toolbox",
  "command":"/path/to/toolbox-mcp/.venv/bin/the-toolbox",
  "args":["--db","/var/lib/librarian/index.db"]
}]
```

### With Claude Desktop

```json
{
  "mcpServers": {
    "the-toolbox": {
      "command": "/path/to/toolbox-mcp/.venv/bin/the-toolbox",
      "args": ["--db", "/var/lib/librarian/index.db"],
      "env": {
        "TAVILY_API_KEY": "tvly_your_key_here"
      }
    }
  }
}
```

---

## ๐ŸŽฏ Why Tavily?

**vs Bright Data:**

| Feature | Tavily | Bright Data |
|---------|--------|-------------|
| Setup | 1 API key | Complex proxy |
| Quality | LLM-optimized | Raw SERP |
| Cost | Pay-per-use | Subscription |
| Rate Limits | Generous | Strict |
| Maintenance | Easy | Complex |
| Agent-Friendly | โœ… Yes | โš ๏ธ Manual |

**Winner:** Tavily for AI agents! ๐Ÿ†

---

## ๐Ÿ”ง Configuration

### Environment Variables

```bash
# Required for Tavily enrichment
TAVILY_API_KEY=tvly_xxxxx

# Optional: Custom LangSmith tracing
LANGSMITH_API_KEY=lsv2_pt_xxxxx
LANGSMITH_PROJECT=toolbox-mcp
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
```

### Index Path

The Toolbox reads from Librarian's SQLite index:

```bash
# Default path
/var/lib/librarian/index.db

# Or specify custom path
uv run the-toolbox --db /custom/path/index.db
```

---

## ๐Ÿ“ API Reference

### toolbox_search

```python
toolbox_search(
    query: str,           # Search terms (1-256 chars)
    source: str = None,   # Filter by package manager
    category: str = None, # Filter by category
    limit: int = 15,      # Results per page (1-50)
    offset: int = 0       # Pagination (0-10000)
) -> dict
```

### toolbox_describe

```python
toolbox_describe(
    name: str  # Exact tool name (1-256 chars)
) -> dict
```

### toolbox_inventory

```python
toolbox_inventory() -> dict
```

### toolbox_research ๐Ÿ†•

```python
toolbox_research(
    name: str  # Tool name to enrich via Tavily
) -> dict
```

---

## ๐Ÿ›ก๏ธ Safety Features

โœ… **Read-Only:** SQLite opened with `mode=ro`  
โœ… **Bounded Inputs:** Max query length, pagination limits  
โœ… **Timeout Protection:** 1-second query deadline  
โœ… **No Execution:** Discovers tools, doesn't run them  
โœ… **Untrusted Data:** Descriptions are evidence, not instructions  

---

## ๐Ÿงช Testing

```bash
# Run tests
uv run pytest tests/ -v

# Test Tavily integration
export TAVILY_API_KEY='your_key'
uv run python -c "
from toolbox import toolbox_research
result = toolbox_research('nmap')
print(result)
"
```

---

## ๐Ÿ“ฆ Supported Sources

Librarian indexes tools from:

- **pacman** (Arch + BlackArch)
- **aur** (AUR packages)
- **path** ($PATH binaries)
- **cargo** (Rust)
- **pip/pipx** (Python)
- **npm/yarn/pnpm** (JavaScript)
- **docker** (Container images)
- **desktop** (GUI apps)
- **foundry** (Solidity)
- **conda** (Data science)
- **rpm** (RPM packages)
- And more...

---

## ๐Ÿค Integration with Bifang

Built for the **Nebius x NVIDIA Hackathon 2026**:

- **Repo:** https://github.com/Protocol-X-01/Bifang
- **Live Test:** Nemotron Nano roundtrip verified
- **Tokens:** 8,885 tracked in live demo
- **Status:** Production ready โœ…

---

## ๐ŸŽ“ Use Cases

### 1. AI Coding Agents
"Find tools for SQL injection testing"
โ†’ Returns: sqlmap, jsql-injection, sqlbrute...

### 2. Security Researchers  
"What wireless tools do I have?"
โ†’ Returns: aircrack-ng, wifite, reaver...

### 3. DevOps Engineers
"Find container tools"
โ†’ Returns: docker, podman, buildah...

### 4. Data Scientists
"What ML libraries are installed?"
โ†’ Returns: numpy, pandas, scikit-learn...

---

## ๐Ÿ”— Links

- **Repository:** https://github.com/Protocol-X-01/toolbox-mcp
- **Librarian:** https://github.com/Protocol-X-01/librarian
- **Tavily:** https://tavily.com
- **MCP Protocol:** https://modelcontextprotocol.io

---

## ๐Ÿ“„ License

MIT License - See [LICENSE](LICENSE)

---

## ๐Ÿ™ Credits

- **Librarian** - System-wide tool indexing
- **Tavily** - Web intelligence API
- **MCP** - Model Context Protocol
- **Bifang** - AI coding agent integration

Built with โค๏ธ for the Nebius x NVIDIA Hackathon 2026

TDQS

A3.7/5.0

Scored across 4 tools

Disambiguation4/5

Each tool has a distinct role: search (fuzzy word lookup), describe (exact-name multi-source lookup), inventory (metadata/status), and research (web enrichment). Search vs describe slightly overlap since both return tool records, but the 'literal words' vs 'exact name' distinction is stated clearly enough to guide selection.

Naming Consistency5/5

All four tools follow a consistent toolbox_<verb> snake_case pattern (search, describe, inventory, research). Predictable and easy to map to intent.

Tool Count4/5

Four tools is on the lean side but each covers a genuine stage of discovery (scan status, find, detail, enrich). No redundant tools, though the surface feels slightly thin for a 'toolbox'.

Completeness4/5

For a discovery/lookup server the lifecycle (inventory status -> search -> describe -> research) is covered without dead ends. Missing install/execute/update operations, but those appear outside the stated read-only scope.

Maintenance

ActivityMaintained
ResponsivenessNo issues