Skip to main content

Utilities and tools for the Stache RAG system

Project description

stache-tools

CLI and MCP server for the Stache knowledge base.

Installation

pip install stache-tools

This provides two commands:

  • stache - CLI for interacting with your knowledge base
  • stache-mcp - MCP server for Claude Desktop/Claude Code integration

Quick Start

1. Start Stache Server

See the Stache repository for full setup instructions, or quick start:

git clone https://github.com/stache-ai/stache-ai.git
cd stache
docker compose -f docker-compose.yml -f docker-compose.local.yml up -d

2. Configure MCP Server

Add to your Claude config file:

Claude Code (~/.claude.json or %APPDATA%\.claude\config.json on Windows):

{
  "mcpServers": {
    "stache-local": {
      "command": "stache-mcp",
      "env": {
        "STACHE_API_URL": "http://localhost:8000"
      }
    }
  }
}

Claude Desktop (~/.config/claude/claude_desktop_config.json or %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "stache-local": {
      "command": "python",
      "args": ["-m", "stache_tools.mcp"],
      "env": {
        "STACHE_API_URL": "http://localhost:8000"
      }
    }
  }
}

3. Restart Claude

Restart Claude Code/Desktop to load the MCP server.

MCP Tools

Tool Description
search Semantic search in your knowledge base
ingest_text Add text content
list_namespaces List all namespaces
list_documents List documents (optionally filtered by namespace)
get_document Get document by ID
update_document Update document metadata (filename, namespace, custom metadata)
delete_document Delete document
create_namespace Create namespace
get_namespace Get namespace details
update_namespace Update namespace properties
delete_namespace Delete namespace

CLI Usage

# Set API URL
export STACHE_API_URL=http://localhost:8000

# Health check
stache health

# Search
stache search "your query" -n namespace -k 10

# Ingest
stache ingest ./document.pdf -n research
stache ingest ./docs/ -n documentation -r  # Recursive
stache ingest -t "Some text content" -n notes

# Namespaces
stache namespace list
stache namespace create mba/finance --name "Finance Notes"

# Documents
stache doc list -n research
stache doc get DOC_ID
stache doc update DOC_ID --filename "new-name.pdf"
stache doc update DOC_ID --new-namespace archive
stache doc update DOC_ID --metadata '{"author": "Jane Doe", "year": 2026}'
stache doc delete DOC_ID

Configuration

Variable Description Default
STACHE_API_URL API base URL http://localhost:8000
STACHE_TRANSPORT Transport: auto, http, lambda auto
STACHE_TIMEOUT Request timeout (seconds) 60

AWS Lambda Transport

For direct Lambda invocation (bypasses API Gateway):

pip install stache-tools[lambda]
{
  "mcpServers": {
    "stache": {
      "command": "stache-mcp",
      "env": {
        "STACHE_LAMBDA_FUNCTION": "stache-api",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Python API

from stache_tools import StacheAPI

with StacheAPI() as api:
    # Ingest
    api.ingest_text("Your content here", namespace="examples")

    # Search
    results = api.search("query", namespace="examples")
    for source in results.get("sources", []):
        print(f"{source['score']:.3f}: {source['content'][:100]}")

    # Document management
    docs = api.list_documents(namespace="examples")

    # Update document metadata
    api.update_document(
        doc_id="abc-123",
        namespace="default",
        updates={"filename": "renamed.pdf", "metadata": {"year": 2026}}
    )

Documentation

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stache_tools-0.1.3.tar.gz (60.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stache_tools-0.1.3-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

Details for the file stache_tools-0.1.3.tar.gz.

File metadata

  • Download URL: stache_tools-0.1.3.tar.gz
  • Upload date:
  • Size: 60.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for stache_tools-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6a71a67c2c3aa5756ed953c1402d4ba9e47b04d79d4958b7e22a542eeaa13e08
MD5 1b3988a3d5bd0aa9a79bd3fa04aa6c87
BLAKE2b-256 2a68d1b5eb2309343b57c043ca13e1f693c3a05d3d9b30e61bbb0d3920c4b812

See more details on using hashes here.

File details

Details for the file stache_tools-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: stache_tools-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 54.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for stache_tools-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f77dd80a044e1a31fa43ee6c28fcc0acf847a07591e84eeb92aa9f9f5af7eff0
MD5 b8df9ec12e219f6ce7f4ba821eef0010
BLAKE2b-256 b279c988d3a0389f8ad5dca0404f67261292707a0238b37b6b3f3dc750f7732b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page