deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Coral: open-source gateway lets AI agents write, save and reuse their own tools

Coral is a self-hosted, Apache-licensed gateway where AI agents call tools by writing TypeScript programs, save working code as reusable custom tools, and have every call checked against policy before credentials are attached.

Coral: open-source gateway lets AI agents write, save and reuse their own tools

An open-source gateway for agent-built tools

Coral, introduced through a Show HN post linking to its GitHub repository, is an open-source, self-hosted gateway that sits between AI agents and the services those agents need to touch. Instead of handing an agent a fixed menu of API calls, Coral has the agent do its work by writing short TypeScript programs. When a program succeeds, the agent can save it as a custom tool and invoke it in a single step the next time the same task comes up. Before any call goes out to an external service, Coral checks it against the workspace's policy, then attaches credentials and forwards it.

The project frames this as fixing two problems at once: permission models that are too coarse, and agents that redo identical work from scratch on every run.

How the code-based tool calls work

According to the project's README, an agent interacts with Coral over MCP. It sends programs through an exec tool, first calling a search function to discover which tools exist and read their TypeScript signatures, then sending a program that performs the task. One program can chain several services together — the README's example pulls open GitHub pull requests, filters for ones with no reviewer, posts a summary to Slack, and returns only the pull request numbers to the agent rather than the full API response.

Each program executes in a fresh V8 isolate without network access, credentials or imports. Tool calls inside the program are intercepted by Coral, checked against policy, and only then given credentials and passed to the provider. If a call needs human approval, the run pauses at that point. Runs happen on the Coral server, so they continue even if the agent client disconnects.

When a program works, the agent saves it as a private tool and calls it later in one step. Custom tools show up in the same search as provider tools, and workspace owners can share them across a team.

Policy checks and approvals

Coral's core argument against existing MCP gateways is that most of them only decide which tools an agent can see. That is binary: an agent allowed to call a record-update endpoint can update any record in any way the endpoint permits. Because a Coral custom tool is code, it can embed rules an allow/block list cannot express — the README's example is a tool that closes stale tickets by changing one field, and only on tickets with no activity for 30 days.

Every provider tool and custom tool can be set to Allow, Ask or Block. Approval requests show the exact call and its arguments, so a security reviewer can green-light a single refund lookup without opening up the whole payments API. Providers can also be configured to use the caller's own account, which the project says lets teammates share tools without sharing API tokens.

Deployment and ecosystem

Coral is written in Rust and licensed under Apache 2.0, with no limits on users, agents or volume; a separate Coral Enterprise edition sits alongside the open-source release. It ships as a desktop app for macOS (Apple silicon), Windows (x64) and Linux (x86_64), or as a shared server deployed with Docker Compose or Kubernetes. The server route requires an OIDC identity provider, a reverse proxy for TLS, and SQLite or Postgres.

Any MCP-capable client can connect — the documentation shows commands for Claude Code and Codex and lists Cursor, VS Code and OpenCode as options. Providers come from a catalog, an OpenAPI document or an existing MCP server, which the project says reaches more than 5,000 databases and SaaS tools. Each run also leaves a structured trace of the goal, the tools used and the outcome, which the project pitches as material for post-training your own models.

Vendor-reported numbers

The adoption and performance figures come from the project itself and are not independently verified. The README says Coral is used by thousands of developers at more than 450 companies, in areas including SRE, customer support, business intelligence and SecOps. In the project's own testing — 34 tasks against GitHub, Linear and Slack using Opus 5.5 — custom tools reportedly cut token use by 37%, cost by 31% and time by 29%. The project also claims that a smaller model (Haiku 5.5) can match a larger one's accuracy (Opus 5.5) when given custom tools, and that Coral outperformed other MCP gateways in blind benchmarks of 100 enterprise tasks, though the README does not detail the methodology.

Why it matters

Most agent tooling today treats tools as static, hand-written artifacts. Coral pushes the other direction: let agents build their own tools, but run that code inside a sandboxed, policy-checked gateway the operator controls. If the approach holds up, it addresses three recurring agent complaints at once — bloated context from raw API responses, coarse all-or-nothing permissions, and wasted tokens re-deriving solutions to already-solved problems. The self-hosted, Apache-licensed packaging also lowers the barrier for organisations that will not send credentials or telemetry through a third-party SaaS. The benchmarks are the vendor's own, so the numbers are best treated as directional until third parties test them.

  • #open-source
  • #ai-agents
  • #mcp
  • #developer-tools
  • #security

Related posts