// agent infrastructure [Open source · flagship]
Toolport
A local MCP gateway that cuts standing tool tokens ~99%
Agent infrastructure engineering
Every MCP server an agent connects dumps its whole tool list into context on every request. Three servers can cost about 24k tokens before you ask anything, and a real Stripe catalog is 415k. Toolport is a local gateway (Rust + Tauri v2) that every AI client points at instead. It advertises a handful of compact meta-tools the agent searches on demand so standing context stays flat, authenticates each server once for every client, keeps credentials in the OS keychain, and screens the tools themselves for rug-pulls and poisoning before a client can call them. It is the SouthForge flagship: 91 GitHub stars, MIT, with a paid Teams control plane on top.
- Rust
- Tauri v2
- Model Context Protocol
- OS keychain
- Axum
- Neon Postgres
- TypeScript
// architecture
AI client ──► Toolport gateway (few meta-tools) ──► search / call on demand ──► N MCP servers · keys in OS keychain · every call audited
// how it's built
A desktop app ships a `toolport-gateway` binary that speaks MCP to every client (Claude, Cursor, Codex, and the rest). Each client points at one gateway, a server is authenticated once and appears in all of them, and new servers propagate without touching each app config.
Instead of the full catalog, the gateway advertises four compact meta-tools (`toolport_status`, `toolport_search_tools`, `toolport_call_tool`, `toolport_fetch_result`) and the agent searches and calls on demand. That meta-tool set is a constant 781 tokens regardless of how many downstream tools exist. A couple more appear only when approvals or agent-control features are on.
A separate benchmark repo runs one command against committed fixtures with a deterministic tiktoken tokenizer, no keys and no network. Standing-context reduction: 99.8% on Stripe (587 tools, 415k down to 781), 99.8% on GitHub (1194 tools), 99.7% on OpenAI. On a frontier model, up to 91% fewer total tokens at the same graded task success (correct answers, not just completion).
The headline is the standing cost, the tokens tools occupy on every request just by being available. Lazy mode adds per-search result tokens, so a session touching 30 distinct tools pays for about 30 tools worth of search results, still far below loading all 587 every turn. The docs report the standing reduction and state this plainly instead of claiming it as a whole-session saving.
Each client sees only the servers in its profile, so a coding agent literally cannot call a tool outside its scope. Any tool can be toggled off, or every destructive tool hidden at once, and every call is recorded with per-server latency and error rates.
Clients only ever say "talk to Toolport." OAuth tokens and API keys live in the OS keychain and are injected at runtime, never written into client config files where they leak into dotfiles and backups.
Because every call flows through one gateway, Toolport screens tools for rug-pulls and tool-poisoning and can require human-in-the-loop approval (`toolport_confirm`) before a destructive or newly changed tool runs. That is detection a per-client config could never enforce.
A paid multi-tenant service (Rust + Axum on Neon Postgres) syncs one set of servers, policies, and agent instructions to every member client, with seats, invites, SSO/RBAC, complete audit history, and Stripe billing. The desktop app stays MIT and free; Teams is source-available (BSL) and self-hostable free for up to five people.
// highlights
A 781-token meta-tool footprint whether you connect one server or a 1,000-tool catalog. Context stays flat as you add servers.
Reproducible from committed fixtures with a deterministic tokenizer: 99.7 to 99.8% standing-context reduction across Stripe, GitHub, and OpenAI catalogs.
Graded for correct answers, not just completion, at up to 91% fewer total tokens on a frontier model.
One call path means rug-pull and tool-poisoning detection plus human approval before destructive tools run.
Credentials are injected at runtime from the OS keychain, never stored in client config files.
MIT desktop app (91 stars) with a source-available control plane for organizations that need policy sync and RBAC.
// components
The Rust/Tauri app and `toolport-gateway` binary that front every MCP server and expose the meta-tool interface to clients.
The search, call, and fetch meta-tools and per-agent profiles that keep standing context flat and scope each client to its own servers.
The multi-tenant Axum + Postgres service for org config sync, seats, SSO/RBAC, audit history, and billing.
// related work