Open Source Tool Compiler
Forge once.
Run everywhere.
Define your tools once. Compile to MCP servers, TypeScript SDKs, OpenAPI specs, docs, eval harnesses, and agent‑optimized schemas.
anvil: "1.0"
service:
name: weather-tools
version: "1.0.0"
tools:
get_current_weather:
description: Get current weather for a location
agent:
when_to_use:
- User asks about current weather
tips:
- Prefer city names over coordinates
parameters:
location:
type: string
required: true
units:
type: enum
values: [celsius, fahrenheit]
permissions:
- type: network
target: api.weather.com
side_effects: none
cost: lowThe tool layer is fragmented.
Every agent runtime has its own schema format. Every integration needs its own docs, permissions, and tests. You maintain seven versions of the same definition that drift apart.
Anvil replaces all of them with a single source of truth.
One schema. Full semantics.
Anvil captures everything agents need — not just types. Descriptions optimized for LLMs, cost indicators, side effects, permissions, and examples that become test cases.
agent.description
Rich context for LLM tool selection — separate from human docs
when_to_use
Explicit scenarios where this tool is the right choice
when_not_to_use
Anti-patterns — redirect agents to better alternatives
permissions
Declared per-tool, enforced at runtime. Network, filesystem, env, db
side_effects
none / read / write / destructive — agents know the blast radius
cost
free / low / medium / high / variable — agents can budget
examples
Input/output pairs that become eval test cases automatically
errors + agent_hint
Known failure modes with recovery instructions for agents
Ten targets. Zero config.
anvil compile --target mcp — no config file needed. All targets are built into the CLI. Or use --all for everything.
MCP Server
Fully typed Model Context Protocol server with tool handlers and annotations.
@anvil-tools/target-mcpOpenAPI 3.1
Complete spec with schemas, security, examples, and error responses.
@anvil-tools/target-openapiDocumentation
Markdown docs with parameter tables, examples, and agent guidance.
@anvil-tools/target-docsAgent Schema
LLM-optimized tool schema with agent descriptions and few-shot examples.
@anvil-tools/target-agent-schemaEval Harness
Test suite with schema validation, contract testing, and agent eval.
@anvil-tools/target-evalTypeScript SDK
Typed client class with Zod runtime validation.
@anvil-tools/target-sdk-tsCLI Application
Commander-based CLI with subcommands and JSON output.
@anvil-tools/target-cli-genClaude · GPT · Vercel AI
Native tool formats for Anthropic, OpenAI, and Vercel AI SDK.
target-anthropic / target-openai / target-vercel-aiTry it live.
Edit the YAML on the left. See generated outputs update instantly on the right.
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = new Server(
{ name: 'weather-tools', version: '1.0.0' },
{ capabilities: { tools: {} } },
);
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [
{
name: 'get_weather',
description: "Use this tool for real-time weather data.\n Best for current conditions.",
inputSchema: {
type: 'object',
properties: {
"location": { "type": "string", "description": "City name" },
"units": { "type": "enum" }
},
required: ["location"],
},
}
],
}));
const transport = new StdioServerTransport();
await server.connect(transport);Compiler architecture.
Like protobuf compiles .proto to language-specific code, Anvil compiles .anvil.yaml through an IR. Adding a target is one interface.
or TypeScript
Docs · Eval · CLI
Featured tools.
Real-world tool definitions ready to compile. Install with anvil install <name> or browse all tools.
github-tools
Issues, PRs, search, comments, and repo browsing
postgres-tools
Read-only queries, table schemas, and guarded mutations
weather-tools
Current conditions and multi-day forecasts
browser-tools
Navigate, screenshot, and extract links from any URL
Get started in 30 seconds.
npm install -g @anvil-tools/clianvil init my-tools && cd my-toolsanvil compile --target mcpZero config — MCP server generatedanvil serve --stubLive MCP server for Claude Desktop / Cursor