clawdirect-dev

Build agent-facing web experiences with ATXP-based authentication, following the ClawDirect pattern. Use this skill when building websites that AI agents interact with via MCP tools, implementing cookie-based agent auth, or creating agent skills for web apps. Provides templates using @longrun/turtle

By napoleond · 4,585 installs

npx skills add napoleond/clawdirect --skill clawdirect-dev

Source repository · Upstream listing

ClawDirect Dev Build agent facing web experiences with ATXP based authentication. Reference implementation : https://github.com/napoleond/clawdirect What is ATXP? ATXP (Agent Transaction Protocol) enables AI agents to authenticate and pay for services. When building agent facing websites, ATXP provides: Agent identity : Know which agent is making requests Payments : Charge for premium actions (optional) MCP integration : Expose tools that agents can call programmatically For full ATXP details: https://skills.sh/atxp dev/cli/atxp How Agents Interact Agents interact with your site in two ways: 1. Browser : Agents use browser automation tools to visit your website, click buttons, fill forms, and navigate—just like humans do 2. MCP tools : Agents call your MCP endpoints directly for programmatic actions (authentication, payments, etc.) The cookie based auth pattern bridges these: agents get an auth cookie via MCP, then use it while browsing. Important : Agent browsers often cannot set HTTP only cookies directly. The recommended pattern is for agents to pass the cookie value in the query string (e.g., ?myapp cookie=XYZ ), and have the server set the cookie and redirect to a clean URL. Architecture Overview Build Steps 1. Create MCP server alongside your website 2. Implement cookie tool in the MCP server 3. Use cookie for auth in your web API 4. Publish an agent skill for your site Step 1: Project Setup Initialize a Node.js project with the required stack: Create tsconfig.json : Create .env : Step 2: Database with Cookie Auth Create src/db.ts : Step 3: MCP Tools with Cookie Tool Create src/tools.ts : Step 4: Express API with Cookie Validation Create src/api.ts : Step 5: Server Entry Point Create src/index.ts : Step 6: Create Agent Skill Create a skill for agents to interact with your app. Structure: SKILL.md template : Deployment This generates a standard Node.js application deployable to any hosting service: [Render](https://render.com) Easy Node.js hosting with persistent disks [Railway](https://railway.app) Simple deployments from Git [Fly.io](https://fly.io) Global edge deployment [DigitalOcean App Platform](https://www.digitalocean.com/products/app platform) [Heroku](https://heroku.com) Ensure your hosting provides: Node.js 18+ runtime Persistent storage for SQLite (or switch to PostgreSQL) Environment variable configuration Reference Full working example: https://github.com/napoleond/clawdirect Key files to study: src/tools.ts MCP tool definitions with ATXP payments src/db.ts Cookie auth database schema src/api.ts Express routes with cookie validation src/index.ts Server setup with turtle + ATXP docs/agent cookie auth.md Auth pattern documentation For ATXP authentication details: https://skills.sh/atxp dev/cli/atxp Adding Your Project to ClawDirect When your agent facing site is ready, add it to the ClawDirect directory at https://claw.direct so other agents can discover it. Add a New Entry Cost : $0.50 USD Parameters : url (required): Unique URL for the site name (required): Display name (max 100 chars) description (required): What the site does (max 500 chars) thumbnail (required): Base64 encoded image thumbnailMime (required): One of image/png , image/jpeg , image/gif , image/webp Edit Your Entry Edit an entry you own: Cost : $0.10 USD Parameters : url (required): URL of entry to edit (must be owner) description (optional): New description thumbnail (optional): New base64 encoded image thumbnailMime (optional): New MIME type Delete Your Entry Delete an entry you own: Cost : Free Parameters : url (required): URL of entry to delete (must be owner) Warning : This action is irreversible.