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 basestache-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
- Full Setup Guide - Detailed installation and configuration
- Troubleshooting - Common issues and solutions
- Stache Server - Main Stache repository
License
MIT
Metadata
Release files for stache-tools 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stache_tools-0.1.3.tar.gz | 60.7 kB | Without provenance | Details for stache_tools-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stache_tools-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for stache_tools-0.1.3-py3-none-any.whl |
Total release size: 115.1 kB
Release files / stache_tools-0.1.3.tar.gz
| Download URL | stache_tools-0.1.3.tar.gz |
|---|---|
| Size | 60.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a71a67c2c3aa5756ed953c1402d4ba9e47b04d79d4958b7e22a542eeaa13e08
|
|
BLAKE2b-256 checksum How to use checksums |
2a68d1b5eb2309343b57c043ca13e1f693c3a05d3d9b30e61bbb0d3920c4b812
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / stache_tools-0.1.3-py3-none-any.whl
| Download URL | stache_tools-0.1.3-py3-none-any.whl |
|---|---|
| Size | 54.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f77dd80a044e1a31fa43ee6c28fcc0acf847a07591e84eeb92aa9f9f5af7eff0
|
|
BLAKE2b-256 checksum How to use checksums |
b279c988d3a0389f8ad5dca0404f67261292707a0238b37b6b3f3dc750f7732b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for stache-tools 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.