Skip to main content

ToolRecall — Deterministic Execution Layer for Agent Tools

You run agents. Every session spawns its own MCP servers, every test run hits live APIs, every tool call is unrepeatable, and your agent can read ~/.ssh if it feels like it.

ToolRecall is one shared daemon that pools your MCP servers, records and replays tool results, caches repeated API calls, and enforces filesystem/terminal policy for any agent framework.

One warm daemon instead of five cold Node processes. ~132 KB install. Python 3.11+ stdlib only.

pipx install toolrecall
toolrecall setup          # One-shot: config -> systemd -> daemon start

Zero config mode: Every toolrecall command auto-starts the daemon if it isn't running. You never need to think about it.


Quickstart — MCP Bridge (30 seconds)

Connect any MCP agent by registering one server:

// ~/.claude/settings.json  or  ~/.cursor/mcp.json  or  ~/.config/cline/mcp_settings.json
{
  "mcpServers": {
    "toolrecall": {
      "command": "toolrecall",
      "args": ["mcp"]
    }
  }
}
# ~/.config/toolrecall/toolrecall.toml
[mcp_multiplex]
servers = ["time", "github", "fetch"]

That's it. Your agent now has access to all multiplexed MCP servers, caching, and security — with zero per-agent configuration.

Before: 5 agents x 3 MCP servers = 15 cold Node processes, ~25 MB RAM per server
After:  5 agents x 1 toolrecall mcp = 3 warm subprocesses, shared across all agents

Features:

  • Lazy loading: servers boot on first call, not at daemon start
  • Idle timeout: inactive subprocesses killed after 15 min (configurable)
  • Failure isolation: one server crash doesn't affect others (auto-reconnect)
  • Auto-resolution: server names resolve from built-in registry

See MCP Multiplexer for full configuration.


What ToolRecall Does

Feature What it solves
MCP Multiplexer One shared pool of MCP servers instead of N processes per agent session
Forward API Proxy Cache API responses by body hash — hit = zero tokens to provider
Replay Mode Record agent sessions, replay deterministically in CI
Security Gate Path allowlist, terminal policy, sensitive-file blocklist — any agent
File / Terminal Cache Reduce redundant reads within a turn. Static commands only
Context Tracker Track dirty/clean files, auto-hint agents what to drop from context
Framework Adapters Drop-in wrappers for ADK, LangChain, herdr, Odysseus

Full detail in Architecture.


How It Works

flowchart LR
    subgraph Agents
        A1["Claude Code"]
        A2["Cursor"]
        A3["Aider"]
        A4["Hermes"]
    end
    subgraph Daemon["ToolRecall Daemon"]
        MP["MCP Multiplexer"]
        CA["Cache (LRU + SQLite)"]
        SG["Security Gate"]
        FP["Forward Proxy"]
    end
    subgraph OS["OS Layer"]
        FS["Filesystem / Network"]
    end

    A1 --> MP
    A2 --> MP
    A3 --> MP
    A4 --> MP
    MP --> CA
    MP --> SG
    MP <--> FS
    A1 --> FP
    FP --> CA
    FP <--> FS

One daemon, five access paths: Python client, MCP bridge, HTTP bridge, forward proxy, OS-level shim. All share one cache, one security gate, one multiplexer. See Architecture.


When To Use It

You want this... Use this...
Warm MCP servers across sessions MCP Multiplexer
$0 dev loops — repeated API calls cost nothing Forward Proxy
Deterministic CI tests for agent behavior Replay Mode
Guardrails between agents and your machine Security Gate
All of the above toolrecall setup then add the MCP bridge

Installation

One-time setup

pipx install toolrecall
toolrecall setup                # config -> systemd service -> daemon start

toolrecall setup creates ~/.config/toolrecall/toolrecall.toml with default-deny security, generates a systemd user unit, and starts the daemon. After this, every toolrecall command "just works".

Daemon auto-start fallback: systemd -> os.fork() -> DETACHED_PROCESS (Linux -> Docker/macOS -> Windows).

Per-agent integration

Method How When to use
MCP Bridge toolrecall mcp in agent's MCP config Any MCP-capable agent (recommended)
Go Client (tr) tr read file.py, tr term "hostname" Shell scripts, CI, any language
Python Shim toolrecall shim --install Every Python process auto-caches open/subprocess
Python Client from toolrecall.client import cached_read Direct embedding in Python code
HTTP Bridge toolrecall serve on :8569 Any HTTP client (curl, Go, Rust...)
Forward Proxy Set OPENAI_BASE_URL=http://localhost:8569/v1 Cache API responses, zero tokens on hit

Extra storage backends

pip install toolrecall[libsql]       # libSQL local backend
pip install toolrecall[libsql-sync]  # libSQL + Turso Cloud sync

CLI Quick Reference

toolrecall setup          One-shot: config + systemd + daemon start  [required once]
toolrecall status         Cache status and stats                     [auto-starts]
toolrecall stats          Detailed cache statistics (JSON)           [auto-starts]
toolrecall invalidate     Clear all caches                           [auto-starts]
toolrecall mcp            Start MCP Bridge                           [auto-starts]
toolrecall serve          Forward proxy (cache API responses)        [auto-starts]
toolrecall serve --9000   Forward proxy on custom port
toolrecall replay         Record/replay agent sessions
toolrecall shim --install Install OS-level cache shim (.pth file)
toolrecall turso          Turso Cloud sync: init, enable, disable, status
toolrecall init           Create default config.toml and .env
toolrecall config-set     Set a config value

Full reference: CLI.md


Configuration

# ~/.config/toolrecall/toolrecall.toml
[mcp]
allowed_paths = ["/home/user/projects"]  # Default-deny!
allow_terminal = false

[cache]
terminal_default_ttl = 60

[mcp_multiplex]
enabled = true
servers = ["time", "sequential-thinking"]

[forward_proxy]
# Starts on :8569 automatically with the daemon

TOOLRECALL_* env vars override TOML. Full reference: Configuration Reference


Platform Support

Platform Transport Status
Linux Unix Domain Sockets Tested in CI
macOS Unix Domain Sockets Should work (POSIX)
Windows TCP localhost:8568 Experimental

Documentation


Contributing

git clone https://github.com/whiskybeer/toolrecall.git
cd toolrecall
make setup    # one-time dev deps
make test     # run tests
make check    # lint + format

See Testing Guide and Makefile.

Uninstall

systemctl --user stop toolrecall-daemon
systemctl --user disable toolrecall-daemon
pipx uninstall toolrecall
rm -rf ~/.toolrecall ~/.config/toolrecall

Download files

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

Source Distribution

toolrecall-0.8.15.tar.gz (225.0 kB view details)

Uploaded Source

Built Distribution

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

toolrecall-0.8.15-py3-none-any.whl (161.4 kB view details)

Uploaded Python 3

File details

Details for the file toolrecall-0.8.15.tar.gz.

File metadata

  • Download URL: toolrecall-0.8.15.tar.gz
  • Upload date:
  • Size: 225.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for toolrecall-0.8.15.tar.gz
Algorithm Hash digest
SHA256 1d5fe9f8f7aed0a03208e2644434085c88e6d1af709576569d5b0ab0daea9ff2
MD5 1281c7f3f41614e69c77b6b8faf4400c
BLAKE2b-256 04ec51ff6f8ce4ddccc8d93044571931606777de52b4a17d04e52495d641c899

See more details on using hashes here.

File details

Details for the file toolrecall-0.8.15-py3-none-any.whl.

File metadata

  • Download URL: toolrecall-0.8.15-py3-none-any.whl
  • Upload date:
  • Size: 161.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for toolrecall-0.8.15-py3-none-any.whl
Algorithm Hash digest
SHA256 5d1554c33e20202e3d27b58728b81ab72fdf7a05ddb9032237d48a7c10b4a95e
MD5 637b017ae23aae80145ac22a89de0c39
BLAKE2b-256 710d043b1f5e8bde626bd4dcde4f032dda2967e3ef331a543baf2dc1160571d2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.21

2 files

0.8.20

2 files

0.8.19

2 files

0.8.18

2 files

0.8.17

1 file

0.8.16

2 files

This release

0.8.15 This release

2 files

0.8.14

1 file

0.8.13

1 file

0.8.12

2 files

0.8.11

2 files

0.8.10

2 files

0.8.9

1 file

0.8.8

1 file

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.3

1 file

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.5

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.3

2 files

0.5.1

2 files

0.5.0

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

1 file

0.3.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page