# Routecraft > Routecraft is the open source AI automation platform your teams build on together. A capability is a typed TypeScript route from a source, through operations, to a destination. The same route is an MCP tool for any agent, an HTTP endpoint or a scheduled job. Prove it on your laptop, promote it to a team harness, and every agent, editor and team can use it on service credentials instead of their own. ## Links - Website: - GitHub: - npm: [@routecraft/routecraft](https://www.npmjs.com/package/@routecraft/routecraft) - npm: [@routecraft/ai](https://www.npmjs.com/package/@routecraft/ai) - npm: [@routecraft/cli](https://www.npmjs.com/package/@routecraft/cli) - npm: [@routecraft/os](https://www.npmjs.com/package/@routecraft/os) - npm: [@routecraft/testing](https://www.npmjs.com/package/@routecraft/testing) ## Authoring skills Routecraft ships Agent Skills (open standard) for authoring capabilities and adapters. They point at the closest existing example plus the matching docs page, then loop on lint, typecheck and test. Install them before writing Routecraft code: the DSL has conventions (operator order, metadata before `.from()`, what belongs in the chain rather than in a step body) that are easy to get wrong from the reference alone. - Any agent, via the Vercel skills CLI: `bunx skills add routecraftjs/routecraft` - Claude Code plugin: `/plugin install routecraft-skills@routecraft` - Source and README: ## Getting started - [What is Routecraft](https://routecraft.dev/raw/docs/introduction.md): Routecraft is the open source AI automation platform your teams build on together. Build a capability once, as a type... - [Tools for agents](https://routecraft.dev/raw/docs/introduction/tools-for-agents.md): Fifteen minutes from nothing to an agent calling a capability you own. You end with a project running on your laptop,... - [Agents and skills](https://routecraft.dev/raw/docs/introduction/agents-and-skills.md): An agent is a model working in a loop with the tools you gave it, and only those. Most of those tools are your own ca... - [An agent of your own](https://routecraft.dev/raw/docs/introduction/an-agent-of-your-own.md): An agent you can reach from your editor and your terminal, built out of capabilities you own and can read on one scre... - [Installation](https://routecraft.dev/raw/docs/introduction/installation.md): System requirements, creating a project, and adding Routecraft to an existing one. ## Fundamentals - [Local harness, team harness](https://routecraft.dev/raw/docs/introduction/local-and-team-harness.md): Every Routecraft instance is a harness: the runtime plus the capabilities, skills and agents it loads. The one on you... - [Doors and triggers](https://routecraft.dev/raw/docs/introduction/doors-and-triggers.md): A capability runs when someone asks, or when something happens. The doors are how a caller asks. The triggers are wha... - [Credentials and identity](https://routecraft.dev/raw/docs/introduction/credentials-and-identity.md): On the team harness the credential belongs to the capability, not to the agent and not to the person asking, and a ca... - [Servers and ports](https://routecraft.dev/raw/docs/introduction/servers-and-ports.md): One listener, many doors. Every door that speaks HTTP mounts a path on a named server, and unless you say otherwise t... - [Expose to an agent](https://routecraft.dev/raw/docs/introduction/expose-to-an-agent.md): Serve your capabilities as MCP tools, so Claude, Cursor, Copilot and any other MCP client can call them. A new projec... - [Talk from your editor](https://routecraft.dev/raw/docs/introduction/talk-from-your-editor.md): Point an editor at a running instance and talk to its agents, over a protocol editors already speak. - [Capabilities](https://routecraft.dev/raw/docs/introduction/capabilities.md): A capability is one thing your harness can do: a typed TypeScript route that says how a call reaches it, what every c... - [Project structure](https://routecraft.dev/raw/docs/introduction/project-structure.md): A conventional folder layout that Routecraft expects out of the box. - [The Exchange](https://routecraft.dev/raw/docs/introduction/exchange.md): The data envelope that flows through every capability. - [Operations](https://routecraft.dev/raw/docs/introduction/operations.md): The steps that transform, filter, and route data inside a capability. - [Adapters](https://routecraft.dev/raw/docs/introduction/adapters.md): Connectors that link your capabilities to the outside world. - [Testing](https://routecraft.dev/raw/docs/introduction/testing.md): Test your capabilities with fast unit tests and optional E2E runs. - [Deployment](https://routecraft.dev/raw/docs/introduction/deployment.md): Deploy Routecraft on Bun for the CLI path, or embed it inside a Node application. - [Monitoring](https://routecraft.dev/raw/docs/introduction/monitoring.md): Log and observe your capabilities at runtime. ## Beyond the defaults - [Connecting harnesses](https://routecraft.dev/raw/docs/advanced/connecting-harnesses.md): Connect a local harness to the team harness with a remote, so every dispatchable capability the team harness exposes ... - [Calling an MCP](https://routecraft.dev/raw/docs/advanced/call-an-mcp.md): Call tools on external MCP servers from within a capability. - [Securing capabilities](https://routecraft.dev/raw/docs/advanced/securing-capabilities.md): Put a credential in front of every network door to your capabilities (HTTP routes, MCP, the editor protocol and the m... - [Durable agents](https://routecraft.dev/raw/docs/advanced/durable-agents.md): Some agent runs cannot finish without a person: a payout needs an approval, and the approver answers in three days, n... - [Judging agent results](https://routecraft.dev/raw/docs/advanced/judging-agent-results.md): Decide programmatically whether an agent achieved what was asked: judge the result with a second model call, then bra... - [Composing capabilities](https://routecraft.dev/raw/docs/advanced/composing-capabilities.md): Connect capabilities together to build multi-stage pipelines. - [Error handling](https://routecraft.dev/raw/docs/advanced/error-handling.md): Catch pipeline errors and recover gracefully with .error(). - [Filter chain](https://routecraft.dev/raw/docs/advanced/filter-chain.md): The fixed order in which a capability's checks and wrappers run around your pipeline: - [Events](https://routecraft.dev/raw/docs/advanced/events.md): Observe and react to what happens inside the runtime without touching capability code. - [Plugins](https://routecraft.dev/raw/docs/advanced/plugins.md): Extend the Routecraft runtime with cross-cutting behaviour. - [Creating adapters](https://routecraft.dev/raw/docs/advanced/custom-adapters.md): Build your own source, destination, enricher, or processor adapter. - [Merged options](https://routecraft.dev/raw/docs/advanced/merged-options.md): Set adapter defaults once and share them across your entire context. - [Type registries](https://routecraft.dev/raw/docs/advanced/type-registries.md): Compile-time safety for string-based adapter APIs via declaration merging. - [Programmatic invocation](https://routecraft.dev/raw/docs/advanced/programmatic-invocation.md): Use CraftClient to dispatch messages into Routecraft routes from any external code: CLI tools, HTTP handlers, backgro... - [Terminal UI](https://routecraft.dev/raw/docs/advanced/tui.md): Inspect routes, agents, tools, exchanges, and live events from the terminal. - [Linting](https://routecraft.dev/raw/docs/advanced/linting.md): Enforce Routecraft best practices with ESLint. - [Formatting](https://routecraft.dev/raw/docs/advanced/formatting.md): Keep Routecraft DSL chains compact with the Prettier plugin. ## Examples - [File to HTTP](https://routecraft.dev/raw/docs/examples/api-sync.md): Read a CSV file and send each row to an API. - [MCP tool](https://routecraft.dev/raw/docs/examples/mcp.md): Expose a capability as an MCP tool, and call a remote MCP server from a capability. - [Support triage agent](https://routecraft.dev/raw/docs/examples/support-triage.md): Let an agent triage incoming support email, bounded to a two-tool allowlist. ## Reference - [Adapters](https://routecraft.dev/raw/docs/reference/adapters.md): Every source, destination, enricher, transformer, and processor in Routecraft. Each card opens its own reference page... - [Operations](https://routecraft.dev/raw/docs/reference/operations.md): Every verb in the Routecraft DSL. Each row opens its own reference page with the full signature, options, and examples. - [Events](https://routecraft.dev/raw/docs/reference/events.md): Full catalog of lifecycle and runtime events emitted by the Routecraft context. - [Configuration](https://routecraft.dev/raw/docs/reference/configuration.md): Full reference for CraftConfig fields and logging options. - [CLI](https://routecraft.dev/raw/docs/reference/cli.md): Run Routecraft capabilities from the command line. - [Runtime](https://routecraft.dev/raw/docs/reference/runtime.md): The craft CLI runs on Bun. Routecraft itself is also a library, so Node users embed it programmatically. - [Plugins](https://routecraft.dev/raw/docs/reference/plugins.md): Built-in plugins that extend the Routecraft runtime. Each entry opens its own reference page with the full options an... - [Linting](https://routecraft.dev/raw/docs/reference/linting.md): Rule catalog for @routecraft/eslint-plugin-routecraft. - [Errors](https://routecraft.dev/raw/docs/reference/errors.md): Short, actionable error codes used across Routecraft. ## Community - [Contribution guide](https://routecraft.dev/raw/docs/community/contribution-guide.md): How to contribute to Routecraft. - [FAQ](https://routecraft.dev/raw/docs/community/faq.md): Answers to common questions. ## Releases - [Changelog](https://routecraft.dev/raw/changelog.md): All notable changes to Routecraft. - [Migrating from 0.6.x to 0.7.0](https://routecraft.dev/raw/docs/migrating/0.6-to-0.7.md): What changed between Routecraft 0.6.0 and 0.7.0, and how to update. - [Migrating from 0.5.x to 0.6.0](https://routecraft.dev/raw/docs/migrating/0.5-to-0.6.md): What changed between Routecraft 0.5.0 and 0.6.0, and how to update. - [Migrating from 0.4.x to 0.5.0](https://routecraft.dev/raw/docs/migrating/0.4-to-0.5.md): What changed between Routecraft 0.4.0 and 0.5.0, and how to update. ## Adapters Every connector Routecraft ships. Read this list before writing an integration: the one you need may already exist. - [simple](https://routecraft.dev/raw/docs/reference/adapters/simple.md): Static or dynamic data source from a value or function. - [log](https://routecraft.dev/raw/docs/reference/adapters/log.md): Console logging for debugging and inspection. - [debug](https://routecraft.dev/raw/docs/reference/adapters/debug.md): Verbose dump of the full exchange for development. - [timer](https://routecraft.dev/raw/docs/reference/adapters/timer.md): Recurring source on a fixed interval. - [cron](https://routecraft.dev/raw/docs/reference/adapters/cron.md): Cron-scheduled source with timezone support. - [event](https://routecraft.dev/raw/docs/reference/adapters/event.md): Internal event bus source for cross-route signalling. - [direct](https://routecraft.dev/raw/docs/reference/adapters/direct.md): Synchronous route-to-route plumbing with type safety. - [http](https://routecraft.dev/raw/docs/reference/adapters/http.md): HTTP client for outbound requests and an HTTP server (via defineConfig({ http })) for exposing routes. - [noop](https://routecraft.dev/raw/docs/reference/adapters/noop.md): Discards the exchange. Useful for benchmarks and stubs. - [pseudo](https://routecraft.dev/raw/docs/reference/adapters/pseudo.md): Typed placeholder for docs, examples, and test wiring. - [spy](https://routecraft.dev/raw/docs/reference/adapters/spy.md): Records exchanges and exposes them for test assertions. - [file](https://routecraft.dev/raw/docs/reference/adapters/file.md): Read or write a single text file (per-line chunked reads). - [directory](https://routecraft.dev/raw/docs/reference/adapters/directory.md): Scan a directory for files, with metadata to filter on; list or per-file. - [json](https://routecraft.dev/raw/docs/reference/adapters/json.md): Parse, write, or transform JSON files. - [csv](https://routecraft.dev/raw/docs/reference/adapters/csv.md): Stream rows from a CSV file or write rows out. - [jsonl](https://routecraft.dev/raw/docs/reference/adapters/jsonl.md): Stream JSON Lines records or write a JSONL file. - [html](https://routecraft.dev/raw/docs/reference/adapters/html.md): Parse or write HTML, with DOM-style selection helpers. - [xml](https://routecraft.dev/raw/docs/reference/adapters/xml.md): Parse, write, or transform XML as a plain object. - [mail](https://routecraft.dev/raw/docs/reference/adapters/mail.md): Receive email via IMAP or send via SMTP. - [carddav](https://routecraft.dev/raw/docs/reference/adapters/carddav.md): Read and write contacts over CardDAV. Defaults to Apple iCloud Contacts; works with any CardDAV server. - [agentBrowser](https://routecraft.dev/raw/docs/reference/adapters/agentbrowser.md): Drive a real browser session: navigate, click, snapshot. - [shell](https://routecraft.dev/raw/docs/reference/adapters/shell.md): Run a command, isolated by default, and capture its output. - [mcp](https://routecraft.dev/raw/docs/reference/adapters/mcp.md): Expose capabilities as MCP tools or call remote MCP servers. - [llm](https://routecraft.dev/raw/docs/reference/adapters/llm.md): Call a language model for text or structured output. - [agent](https://routecraft.dev/raw/docs/reference/adapters/agent.md): Run an LLM with a fixed system prompt and tool set. - [embedding](https://routecraft.dev/raw/docs/reference/adapters/embedding.md): Generate vector embeddings from text. - [surface](https://routecraft.dev/raw/docs/reference/adapters/surface.md): Reach the person whose turn the route is running on: ask their editor something and wait for the answer, or push an update at it. - [group](https://routecraft.dev/raw/docs/reference/adapters/group.md): Group exchanges into batches by key, count, or time. - [cosine](https://routecraft.dev/raw/docs/reference/adapters/cosine.md): Cluster items by cosine similarity of embeddings. ## Operations Every verb in the route DSL. Read this list before reaching for imperative code in a step body: concurrency limits, throttling, retries, caching and branching are operations, not things to hand-roll. - [id](https://routecraft.dev/raw/docs/reference/operations/id.md): Set the unique identifier for the route. - [title](https://routecraft.dev/raw/docs/reference/operations/title.md): Display title for tooling and docs. - [description](https://routecraft.dev/raw/docs/reference/operations/description.md): Free-text description for the route. - [enabled](https://routecraft.dev/raw/docs/reference/operations/enabled.md): Gate the route on a predicate; a false route is registered but not started, and not offered as a tool. - [input](https://routecraft.dev/raw/docs/reference/operations/input.md): Validate the incoming exchange against a Standard Schema. - [output](https://routecraft.dev/raw/docs/reference/operations/output.md): Validate the outgoing exchange against a Standard Schema. - [tag](https://routecraft.dev/raw/docs/reference/operations/tag.md): Attach one or more tags for filtering and discovery. - [batch](https://routecraft.dev/raw/docs/reference/operations/batch.md): Process exchanges in batches instead of one at a time. - [error](https://routecraft.dev/raw/docs/reference/operations/error.md): Catch route-scope errors before from(), or wrap the next step after from(). - [authorize](https://routecraft.dev/raw/docs/reference/operations/authorize.md): Require an authenticated principal with optional roles, all-of or any-of scopes, and an opt-in read of the actor's scopes. - [from](https://routecraft.dev/raw/docs/reference/operations/from.md): Set the source that produces exchanges. - [retry](https://routecraft.dev/raw/docs/reference/operations/retry.md): Retry the next operation (or the whole pipeline) on failure. - [throttle](https://routecraft.dev/raw/docs/reference/operations/throttle.md): Rate-limit the next operation (or the whole pipeline). - [timeout](https://routecraft.dev/raw/docs/reference/operations/timeout.md): Fail the next operation (or the whole pipeline) after a deadline. - [delay](https://routecraft.dev/raw/docs/reference/operations/delay.md): Pause before the next operation. - [cache](https://routecraft.dev/raw/docs/reference/operations/cache.md): Cache and reuse the result of the next operation. - [circuitBreaker](https://routecraft.dev/raw/docs/reference/operations/circuitbreaker.md): Trip after repeated failures and fast-fail until the target recovers. - [concurrency](https://routecraft.dev/raw/docs/reference/operations/concurrency.md): Bound how many exchanges run the next operation (or the whole pipeline) at once (bulkhead). - [transform](https://routecraft.dev/raw/docs/reference/operations/transform.md): Replace the body with the function's return value. - [header](https://routecraft.dev/raw/docs/reference/operations/header.md): Set or override an exchange header. - [authenticate](https://routecraft.dev/raw/docs/reference/operations/authenticate.md): Mint a principal from claims the resolver has verified. - [delegate](https://routecraft.dev/raw/docs/reference/operations/delegate.md): Mark the principal as exercised by an actor (an agent) on the subject’s behalf. - [map](https://routecraft.dev/raw/docs/reference/operations/map.md): Map fields from source to target via a declarative mapping. - [process](https://routecraft.dev/raw/docs/reference/operations/process.md): Transform with full read-write access to the exchange. - [enrich](https://routecraft.dev/raw/docs/reference/operations/enrich.md): Pull data in; the result replaces the body unless an aggregator merges it. - [filter](https://routecraft.dev/raw/docs/reference/operations/filter.md): Drop exchanges that fail the predicate. - [validate](https://routecraft.dev/raw/docs/reference/operations/validate.md): Check the body with a validator; the coerced result replaces it. - [schema](https://routecraft.dev/raw/docs/reference/operations/schema.md): Strip unknown fields per a schema, fail on validation errors. - [dedupe](https://routecraft.dev/raw/docs/reference/operations/dedupe.md): Drop exchanges whose derived key has already been seen. - [choice](https://routecraft.dev/raw/docs/reference/operations/choice.md): Branch the pipeline by predicate. - [split](https://routecraft.dev/raw/docs/reference/operations/split.md): Fan out one exchange into many. - [aggregate](https://routecraft.dev/raw/docs/reference/operations/aggregate.md): Fold the children of a split back into one exchange. - [multicast](https://routecraft.dev/raw/docs/reference/operations/multicast.md): Fan the exchange out to multiple paths in parallel. - [dispatch](https://routecraft.dev/raw/docs/reference/operations/dispatch.md): Run exactly one target, chosen by load-balancing strategy. - [loop](https://routecraft.dev/raw/docs/reference/operations/loop.md): Repeat a sub-pipeline while a condition holds. - [sample](https://routecraft.dev/raw/docs/reference/operations/sample.md): Pass every Nth exchange, or the first per time window. - [debounce](https://routecraft.dev/raw/docs/reference/operations/debounce.md): Release only the last exchange in a burst after a quiet period. - [defer](https://routecraft.dev/raw/docs/reference/operations/defer.md): Defer the exchange durably and answer now; resume later at the next step. - [resume](https://routecraft.dev/raw/docs/reference/operations/resume.md): Revive a deferred exchange addressed by its signed resume token. - [tap](https://routecraft.dev/raw/docs/reference/operations/tap.md): Run a destination or enricher fire-and-forget; the body is unchanged. - [log](https://routecraft.dev/raw/docs/reference/operations/log.md): Emit a log line for the exchange. - [debug](https://routecraft.dev/raw/docs/reference/operations/debug.md): Emit a log line for the exchange at debug level. - [to](https://routecraft.dev/raw/docs/reference/operations/to.md): Push out via a destination (body unchanged) or pull in via an enricher (body replaced). ## Plugins Runtime extensions configured once on the context. - [llmPlugin](https://routecraft.dev/raw/docs/reference/plugins/llmplugin.md): Configure provider keys, default models, and global LLM defaults for every agent and llm() call in the context. - [embeddingPlugin](https://routecraft.dev/raw/docs/reference/plugins/embeddingplugin.md): Wire an embedding provider for the embedding() destination and downstream clustering with cosine(). - [mcpPlugin](https://routecraft.dev/raw/docs/reference/plugins/mcpplugin.md): Expose mcp() capabilities over Model Context Protocol, with JWT, OAuth 2.1, and bearer-token verification built in. - [agentPlugin](https://routecraft.dev/raw/docs/reference/plugins/agentplugin.md): Register named agents, the tools they can call, and shared defaults like system prompt and principal context. - [acpPlugin](https://routecraft.dev/raw/docs/reference/plugins/acpplugin.md): Serve the Agent Client Protocol so a person can talk to this instance's agents from their editor, on the same server and behind the same wall as everything else. - [httpPlugin](https://routecraft.dev/raw/docs/reference/plugins/httpplugin.md): Expose routes over HTTP via the http() source, mounted as the catch-all surface on a named server; JWT, JWKS, or API-key auth at the plugin boundary. - [serversPlugin](https://routecraft.dev/raw/docs/reference/plugins/serversplugin.md): Declare the HTTP listeners the app binds, by name. HTTP, MCP, and custom plugins mount paths on a shared listener; a surface gets a dedicated port by declaring another named server. - [opsPlugin](https://routecraft.dev/raw/docs/reference/plugins/opsplugin.md): Serve liveness, readiness, and operational health, mounted on a named server. Route lifecycle and circuit-breaker state are derived from events the framework already emits; indicators cover dependencies it cannot see. - [shellPlugin](https://routecraft.dev/raw/docs/reference/plugins/shellplugin.md): Set context-wide defaults for shell(): isolation tier, timeout, and output cap. The lowest of the three precedence layers, under the ROUTECRAFT_SHELL_ISOLATION operator override and the call site. - [remotesPlugin](https://routecraft.dev/raw/docs/reference/plugins/remotesplugin.md): Name other running instances, and every dispatchable route they expose through the ops management API becomes a direct endpoint here, for direct(), forward(), agent tools and the local ops listing alike. ## Optional - [Full Documentation (single file)](https://routecraft.dev/llms-full.txt): All documentation concatenated into one markdown file for bulk ingestion - [Changelog](https://routecraft.dev/raw/changelog.md)