About
Routecraft is the open source AI automation platform your teams build on together. A capability is a route: a typed pipeline from a source, through operations, to a destination. The same route is an MCP tool for any agent or editor, a tool for an agent you run yourself, an HTTP endpoint, or a scheduled job, depending only on its source. Prove it on your laptop, promote it to a team harness, and every team can use it on service credentials instead of their own. Agents are routes too, with the same guardrails around a model call as around any other step. Nothing is reachable until you write a route for it.
Five minutes: an agent you own
craft-harness is a complete agent built out of Routecraft capabilities: chat, a sandboxed shell, web fetch and search, a workspace, memory, a scheduler, human approvals, and the editor capabilities. Every one of them is an ordinary route in capabilities/ you can read on one screen and change.
bunx create-routecraft my-agent --example https://github.com/routecraftjs/craft-harness
cd my-agent
bun run setup # generates the project's own secrets into .env and .routecraft/
# add LLM_API_KEY to .env
bun run dev
From another terminal:
bun run exec chat --session=demo --message="what can you do?"
The instance is walled, the settings file carries the credential, and the transcript is a file --session names. The same conversation is reachable over MCP at http://localhost:8081/mcp and from your editor over the Agent Client Protocol.
What a capability looks like
import { craft, mail } from '@routecraft/routecraft'
import { mcp } from '@routecraft/ai'
import { z } from 'zod'
const SendTeamEmail = z.object({
to: z
.string()
.email()
.refine((email) => email.endsWith('@company.com'), 'Can only send to @company.com addresses'),
subject: z.string(),
message: z.string(),
})
// The route id is the tool name; description and input schema live on the
// route, so every call is validated before any of your code runs.
export default craft()
.id('send-team-email')
.description('Send an email to a team member')
.input({ body: SendTeamEmail })
.from(direct(), mcp())
.transform(({ to, subject, message }) => ({ to, subject, text: message }))
.to(mail()) // the account comes from craft.config.ts
The source decides the door. .from(mcp()) makes it an MCP tool. .from(direct()) makes it a capability any local agent can call and craft exec can run. .from(http()) makes it an endpoint. The steps in between do not change. A cron() schedule brings no body, so it gets a small route of its own that builds this input and calls the capability through direct().
An agent is a route too
import { craft, direct } from '@routecraft/routecraft'
import { agent, tools } from '@routecraft/ai'
import { z } from 'zod'
export default craft()
.id('assistant')
.description('Answer a question with the tools this project defines')
.input({ body: z.object({ question: z.string() }) })
.from(direct())
.to(
agent({
model: 'anthropic:claude-opus-4-7',
system: 'Be useful. Say what you did.',
user: (ex) => ex.body.question,
tools: tools(['Direct(send-team-email)']),
}),
)
Tools are an allowlist of capabilities, never a blacklist. An agent can also be a markdown file under agents/ with frontmatter for its model and tools, which craft start discovers with everything else in the project. Because the agent is a step in a route, .authorize(), .throttle(), .retry(), .timeout() and .circuitBreaker() apply to the model call exactly as to any other step.
A project declares what it installs
craft.config.ts default-exports a project. It names the plugins the project installs and their configuration, and the command line reads nothing else.