About
Routecraft is a type-safe framework for AI automation. Build the tools an agent uses, or the agent itself, with the same fluent DSL. Write capabilities that send emails, manage calendars, and automate work, then expose them to any AI agent via MCP.
Why Routecraft?
- ✅ AI that does real work - Send emails, schedule meetings, automate tasks
- ✅ Code, not configs - TypeScript all the way with full IDE support
- ✅ Works with Claude & Cursor - Expose tools via MCP automatically
- ✅ Secure by design - AI only accesses the capabilities you expose
Quick Start
Write a capability
import { mcp } from '@routecraft/ai'
import { craft, mail } from '@routecraft/routecraft'
import { z } from 'zod'
// Define a capability AI can call
export default craft()
.from(mcp('send-team-email', {
description: 'Send email to team members',
schema: 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()
})
}))
.to(mail()) // Config loaded from context
Expose to Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"my-tools": {
"command": "bunx",
"args": ["@routecraft/cli", "run", "./routes/tools.mjs"]
}
}
}
The
craftCLI runs on Bun (>=1.1.0). Node users embed@routecraft/routecraftprogrammatically; see the Programmatic Invocation guide.
Now talk to Claude: "Send an email to [email protected] thanking him for yesterday's meeting"
Claude discovers your tool and uses it automatically. ✨
📚 Get Started | Examples | API Reference
Key Features
- Make AI useful - Send emails, schedule meetings, automate tasks
- Code-first - TypeScript with full IDE support, testing, and version control
- MCP native - Works with Claude Desktop, Cursor, and any MCP client
- Type-safe - Zod-powered validation ensures data integrity
- Deploy anywhere - Run locally, self-host, or use our upcoming cloud platform
Monorepo Structure
packages/routecraft– Core library (builder, DSL, context, adapters, consumers)packages/ai– AI integrations: LLM providers, agents, embeddings, MCP server / clientpackages/browser– Browser automation adapter (headless / headed via agent-browser)packages/cli–craftCLI to run capabilities and start contexts (Bun >= 1.1.0)packages/create-routecraft– Project scaffolder (bunx create-routecraft)packages/eslint-plugin-routecraft– ESLint rules for capability authoringpackages/prettier-plugin-routecraft– Prettier plugin for compact DSL formattingpackages/os– System-native adapters (shell, etc.) – placeholder, in developmentpackages/testing– Test utilities (testContext, spy logger,mockAdapter, fixtures)skills/– Agent Skills for authoring Routecraft (Claude Code, Cursor, Codex, Windsurf, Cline, Continue, Copilot, ...;bunx skills add routecraftjs/routecraft). See skills/README.mdapps/routecraft.dev– Documentation site (docs, examples, guides)examples/– Runnable example capabilities
Examples
Browse runnable examples in examples/src/: hello-world.ts, mcp-greet.ts, agent.ts, mail-noreply-notify.ts, programmatic-invocation.ts, split.ts. Each demonstrates a different feature combination.
Try one:
bun install
bun run build
bunx craft run ./examples/dist/mcp-greet.js
For end-to-end walkthroughs, see the docs site.
Contributing
Contributions are welcome! Please read our contribution guide at https://routecraft.dev/docs/community/contribution-guide for guidelines on how to propose changes, add adapters, and write capabilities.
License
Licensed under the Apache 2.0 License.
No comments yet
Be the first to share your take.