One framework.
Human apps.
Intelligent agents.
Zero walls.

Write your application contract once. Humans use it through browsers. AI agents operate it through tools. The agent evolves with every run.

$ bunx create-capstan-app my-app

This single defineAPI() definition automatically creates: HTTP JSON API (Hono), MCP Tools (Claude Desktop), A2A Skills (Google Agent-to-Agent), OpenAPI 3.1 Spec.

app/routes/tickets/index.api.ts
import { defineAPI } from "@zauso-ai/capstan-core";
import { z } from "zod";

// One contract — humans use it via HTTP, agents via MCP/A2A
export const GET = defineAPI({
  input: z.object({
    status: z.enum(["open", "closed"]).optional(),
  }),
  output: z.object({
    tickets: z.array(z.object({
      id: z.string(),
      title: z.string(),
      status: z.string(),
    })),
  }),
  description: "List support tickets",
  capability: "read",
  resource: "ticket",
  async handler({ input }) {
    return { tickets: await db.tickets.list(input) };
  },
});
agents/triage.ts
import { createSmartAgent } from "@zauso-ai/capstan-ai";
import { defineSkill } from "@zauso-ai/capstan-ai";

// Smart agent with 12 production features
const agent = createSmartAgent({
  model: "claude-sonnet-4-20250514",
  tools: [listTickets, assignTicket, resolveTicket],
  skills: [triageSkill],
  maxTurns: 20,
  timeout: { total: 120_000, perTool: 30_000 },
  budget: { maxTokens: 100_000 },
  compression: { strategy: "sliding-window" },
});

// Skills give agents strategic guidance
const triageSkill = defineSkill({
  name: "triage",
  when: "ticket needs priority assessment",
  strategy: "Check severity, customer tier, SLA deadline",
});

Why Capstan

Zero-Wall APIs

defineAPI() serves HTTP for humans AND MCP/A2A tools for agents. Same contract, zero glue.

Smart Agent Runtime

createSmartAgent() with 12 production features: compression, fallback, validation, timeouts, watchdog, budgets.

Skill Layer

defineSkill() gives agents high-level strategies. Not just tools — strategic guidance for complex problems.

Self-Evolution

Agents learn from every run. Experience → Strategy → Skill. Gets smarter over time.

Full-Stack Web

React SSR, file routing, Drizzle ORM, selective hydration. Everything you need for human-facing apps.

Production Security

JWT, OAuth, DPoP, SPIFFE/mTLS, rate limiting, CSRF. Human AND agent auth built in.

AI TDD Loop

capstan verify --json. 8-step verification cascade. AI agents self-correct.

Multi-Protocol

HTTP, MCP, A2A, OpenAPI from one definition. Agents discover your app automatically.

How Capstan Compares

FeatureNext.jsLangChainCapstan
Wall between web & agent🧱🧱+
Multi-protocol (HTTP + MCP + A2A)+
Smart agent runtime++
Skill layer + evolution+
React SSR++
File-based routing++
Built-in auth (JWT + OAuth + API keys)+
Built-in database layer+
AI TDD verifier+
OpenAPI auto-generation+
Long-term memory~+
Policy engine + approval workflow+

+ built-in ~ partial not available 🧱 total wall | Full comparison

Quick Start

Build an Agent

  1. Create
    bunx create-capstan-app my-agent
  2. Define your agent
    import { createSmartAgent } from "@zauso-ai/capstan-ai";
    
    const agent = createSmartAgent({
      model: "claude-sonnet-4-20250514",
      tools: [listTickets, assignTicket],
      skills: [triageSkill],
    });
  3. Run
    bunx capstan dev
    # MCP server auto-available for Claude Desktop

Build a Web App

  1. Create
    bunx create-capstan-app my-app
  2. Develop
    cd my-app && bunx capstan dev
  3. Connect

    Your app is live with all agent endpoints ready:

    # Agent manifest
    curl http://localhost:3000/.well-known/capstan.json
    
    # OpenAPI spec
    curl http://localhost:3000/openapi.json
    
    # MCP server (for Claude Desktop / Cursor)
    bunx capstan mcp

Smart Agent Runtime

@zauso-ai/capstan-ai provides the full smart agent runtime. createSmartAgent() for production agents, defineSkill() for strategic guidance, and self-evolution that learns from every run.

import { createSmartAgent, defineSkill } from "@zauso-ai/capstan-ai";

// Production-ready agent with 12 built-in features
const agent = createSmartAgent({
  model: "claude-sonnet-4-20250514",
  tools: [searchDocs, createTicket, sendEmail],
  skills: [customerSupport, escalation],
  maxTurns: 30,
  timeout: { total: 120_000, perTool: 30_000 },
  budget: { maxTokens: 200_000 },
  compression: { strategy: "sliding-window" },
  fallback: { model: "claude-haiku-4" },
  validation: { validateToolArgs: true },
  watchdog: { maxConsecutiveErrors: 3 },
});

// Skills evolve from experience
const customerSupport = defineSkill({
  name: "customer-support",
  when: "user has a support question",
  strategy: "Search docs first, then check ticket history, escalate if unresolved",
});

// Agent learns and improves over time
// Experience -> Strategy -> Skill -> Evolution

Explore the Docs

MIT License · Capstan — where web development meets agent intelligence.