[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75P95N3A5F0CPQP9QYVS6Z4":3,"skill-same:01M75P95N3A5F0CPQP9QYVS6Z4":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M75P95N3A5F0CPQP9QYVS6Z4","clawdirect-dev",null,"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\u002Fturtle, Express, SQLite, and ATXP.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnapoleond\u002Fclawdirect-dev\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: clawdirect-dev\ndescription: 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\u002Fturtle, Express, SQLite, and ATXP.\n---\n\n# ClawDirect-Dev\n\nBuild agent-facing web experiences with ATXP-based authentication.\n\n**Reference implementation**: https:\u002F\u002Fgithub.com\u002Fnapoleond\u002Fclawdirect\n\n## What is ATXP?\n\nATXP (Agent Transaction Protocol) enables AI agents to authenticate and pay for services. When building agent-facing websites, ATXP provides:\n\n- **Agent identity**: Know which agent is making requests\n- **Payments**: Charge for premium actions (optional)\n- **MCP integration**: Expose tools that agents can call programmatically\n\nFor full ATXP details: https:\u002F\u002Fskills.sh\u002Fatxp-dev\u002Fcli\u002Fatxp\n\n## How Agents Interact\n\nAgents interact with your site in two ways:\n\n1. **Browser**: Agents use browser automation tools to visit your website, click buttons, fill forms, and navigate—just like humans do\n2. **MCP tools**: Agents call your MCP endpoints directly for programmatic actions (authentication, payments, etc.)\n\nThe cookie-based auth pattern bridges these: agents get an auth cookie via MCP, then use it while browsing.\n\n**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.\n\n## Architecture Overview\n\n```\n┌──────────────────────────────────────────────────────────────────┐\n│                         AI Agent                                 │\n│  ┌─────────────────────┐         ┌─────────────────────────┐    │\n│  │   Browser Tool      │         │   MCP Client            │    │\n│  │   (visits website)  │         │   (calls tools)         │    │\n│  └─────────┬───────────┘         └───────────┬─────────────┘    │\n└────────────┼─────────────────────────────────┼──────────────────┘\n             │                                 │\n             ▼                                 ▼\n┌────────────────────────────────────────────────────────────────┐\n│                    Your Application                             │\n│  ┌─────────────────────┐    ┌─────────────────────────┐        │\n│  │   Web Server        │    │   MCP Server            │        │\n│  │   (Express)         │    │   (@longrun\u002Fturtle)     │        │\n│  │                     │    │                         │        │\n│  │   - Serves UI       │    │   - yourapp_cookie      │        │\n│  │   - Cookie auth     │    │   - yourapp_action      │        │\n│  └─────────┬───────────┘    └───────────┬─────────────┘        │\n│            │                            │                       │\n│            └──────────┬─────────────────┘                       │\n│                       ▼                                         │\n│              ┌─────────────────┐                                │\n│              │     SQLite      │                                │\n│              │   auth_cookies  │                                │\n│              └─────────────────┘                                │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## Build Steps\n\n1. **Create MCP server** alongside your website\n2. **Implement cookie tool** in the MCP server\n3. **Use cookie for auth** in your web API\n4. **Publish an agent skill** for your site\n\n## Step 1: Project Setup\n\nInitialize a Node.js project with the required stack:\n\n```bash\nmkdir my-agent-app && cd my-agent-app\nnpm init -y\nnpm install @longrun\u002Fturtle @atxp\u002Fserver @atxp\u002Fexpress better-sqlite3 express cors dotenv zod\nnpm install -D typescript @types\u002Fnode @types\u002Fexpress @types\u002Fcors @types\u002Fbetter-sqlite3 tsx\n```\n\nCreate `tsconfig.json`:\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"NodeNext\",\n    \"moduleResolution\": \"NodeNext\",\n    \"outDir\": \"dist\",\n    \"rootDir\": \"src\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true\n  },\n  \"include\": [\"src\u002F**\u002F*\"]\n}\n```\n\nCreate `.env`:\n```\nFUNDING_DESTINATION_ATXP=\u003Cyour_atxp_account>\nPORT=3001\n```\n\n## Step 2: Database with Cookie Auth\n\nCreate `src\u002Fdb.ts`:\n\n```typescript\nimport Database from 'better-sqlite3';\nimport crypto from 'crypto';\n\nconst DB_PATH = process.env.DB_PATH || '.\u002Fdata.db';\nlet db: Database.Database;\n\nexport function getDb(): Database.Database {\n  if (!db) {\n    db = new Database(DB_PATH);\n    db.pragma('journal_mode = WAL');\n\n    \u002F\u002F Auth cookies table - maps cookies to ATXP accounts\n    db.exec(`\n      CREATE TABLE IF NOT EXISTS auth_cookies (\n        cookie_value TEXT PRIMARY KEY,\n        atxp_account TEXT NOT NULL,\n        created_at DATETIME DEFAULT CURRENT_TIMESTAMP\n      )\n    `);\n\n    \u002F\u002F Add your app's tables here\n  }\n  return db;\n}\n\nexport function createAuthCookie(atxpAccount: string): string {\n  const cookieValue = crypto.randomBytes(32).toString('hex');\n  getDb().prepare(`\n    INSERT INTO auth_cookies (cookie_value, atxp_account)\n    VALUES (?, ?)\n  `).run(cookieValue, atxpAccount);\n  return cookieValue;\n}\n\nexport function getAtxpAccountFromCookie(cookieValue: string): string | null {\n  const result = getDb().prepare(`\n    SELECT atxp_account FROM auth_cookies WHERE cookie_value = ?\n  `).get(cookieValue) as { atxp_account: string } | undefined;\n  return result?.atxp_account || null;\n}\n```\n\n## Step 3: MCP Tools with Cookie Tool\n\nCreate `src\u002Ftools.ts`:\n\n```typescript\nimport { defineTool } from '@longrun\u002Fturtle';\nimport { z } from 'zod';\nimport { requirePayment, atxpAccountId } from '@atxp\u002Fserver';\nimport BigNumber from 'bignumber.js';\nimport { createAuthCookie } from '.\u002Fdb.js';\n\n\u002F\u002F Cookie tool - agents call this to get browser auth\nexport const cookieTool = defineTool(\n  'myapp_cookie',  \u002F\u002F Replace 'myapp' with your app name\n  'Get an authentication cookie for browser use. Set this cookie to authenticate when using the web interface.',\n  z.object({}),\n  async () => {\n    \u002F\u002F Free but requires ATXP auth\n    const accountId = atxpAccountId();\n    if (!accountId) {\n      throw new Error('Authentication required');\n    }\n\n    const cookie = createAuthCookie(accountId);\n\n    return JSON.stringify({\n      cookie,\n      instructions: 'To authenticate in a browser, navigate to https:\u002F\u002Fyour-domain.com?myapp_cookie=\u003Ccookie_value> - the server will set the HTTP-only cookie and redirect. Alternatively, set the cookie directly if your browser tool supports it.'\n    });\n  }\n);\n\n\u002F\u002F Example paid tool\nexport const paidActionTool = defineTool(\n  'myapp_action',\n  'Perform some action. Cost: $0.10',\n  z.object({\n    input: z.string().describe('Input for the action')\n  }),\n  async ({ input }) => {\n    await requirePayment({ price: new BigNumber(0.10) });\n\n    const accountId = atxpAccountId();\n    if (!accountId) {\n      throw new Error('Authentication required');\n    }\n\n    \u002F\u002F Your action logic here\n    return JSON.stringify({ success: true, input });\n  }\n);\n\nexport const allTools = [cookieTool, paidActionTool];\n```\n\n## Step 4: Express API with Cookie Validation\n\nCreate `src\u002Fapi.ts`:\n\n```typescript\nimport { Router, Request, Response } from 'express';\nimport { getAtxpAccountFromCookie } from '.\u002Fdb.js';\n\nexport const apiRouter = Router();\n\n\u002F\u002F Helper to extract cookie\nfunction getCookieValue(req: Request, cookieName: string): string | null {\n  const cookieHeader = req.headers.cookie;\n  if (!cookieHeader) return null;\n\n  const cookies = cookieHeader.split(';').map(c => c.trim());\n  for (const cookie of cookies) {\n    if (cookie.startsWith(`${cookieName}=`)) {\n      return cookie.substring(cookieName.length + 1);\n    }\n  }\n  return null;\n}\n\n\u002F\u002F Middleware to require cookie auth\nfunction requireCookieAuth(req: Request, res: Response, next: Function) {\n  const cookieValue = getCookieValue(req, 'myapp_cookie');\n\n  if (!cookieValue) {\n    res.status(401).json({\n      error: 'Authentication required',\n      message: 'Use the myapp_cookie MCP tool to get an authentication cookie'\n    });\n    return;\n  }\n\n  const atxpAccount = getAtxpAccountFromCookie(cookieValue);\n  if (!atxpAccount) {\n    res.status(401).json({\n      error: 'Invalid cookie',\n      message: 'Your cookie is invalid or expired. Get a new one via the MCP tool.'\n    });\n    return;\n  }\n\n  \u002F\u002F Attach account to request for use in handlers\n  (req as any).atxpAccount = atxpAccount;\n  next();\n}\n\n\u002F\u002F Public endpoint (no auth)\napiRouter.get('\u002Fapi\u002Fpublic', (_req: Request, res: Response) => {\n  res.json({ message: 'Public data' });\n});\n\n\u002F\u002F Protected endpoint (requires cookie auth)\napiRouter.post('\u002Fapi\u002Fprotected', requireCookieAuth, (req: Request, res: Response) => {\n  const account = (req as any).atxpAccount;\n  res.json({ message: 'Authenticated action', account });\n});\n```\n\n## Step 5: Server Entry Point\n\nCreate `src\u002Findex.ts`:\n\n```typescript\nimport 'dotenv\u002Fconfig';\nimport express from 'express';\nimport cors from 'cors';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { createServer } from '@longrun\u002Fturtle';\nimport { atxpExpress } from '@atxp\u002Fexpress';\nimport { getDb } from '.\u002Fdb.js';\nimport { allTools } from '.\u002Ftools.js';\nimport { apiRouter } from '.\u002Fapi.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst FUNDING_DESTINATION = process.env.FUNDING_DESTINATION_ATXP;\nif (!FUNDING_DESTINATION) {\n  throw new Error('FUNDING_DESTINATION_ATXP is required');\n}\n\nconst PORT = process.env.PORT ? parseInt(process.env.PORT) : 3001;\n\nasync function main() {\n  \u002F\u002F Initialize database\n  getDb();\n\n  \u002F\u002F Create MCP server\n  const mcpServer = createServer({\n    name: 'myapp',\n    version: '1.0.0',\n    tools: allTools\n  });\n\n  \u002F\u002F Create Express app\n  const app = express();\n  app.use(cors());\n  app.use(express.json());\n\n  \u002F\u002F Cookie bootstrap middleware - handles ?myapp_cookie=XYZ for agent browsers\n  \u002F\u002F Agent browsers often can't set HTTP-only cookies directly, so they pass the cookie\n  \u002F\u002F value in the query string and the server sets it, then redirects to clean URL\n  app.use((req, res, next) => {\n    const cookieValue = req.query.myapp_cookie;\n    if (typeof cookieValue === 'string' && cookieValue.length > 0) {\n      res.cookie('myapp_cookie', cookieValue, {\n        httpOnly: true,\n        secure: process.env.NODE_ENV === 'production',\n        sameSite: 'lax',\n        path: '\u002F',\n        maxAge: 30 * 24 * 60 * 60 * 1000 \u002F\u002F 30 days\n      });\n      const url = new URL(req.originalUrl, `http:\u002F\u002F${req.headers.host}`);\n      url.searchParams.delete('myapp_cookie');\n      res.redirect(302, url.pathname + url.search || '\u002F');\n      return;\n    }\n    next();\n  });\n\n  \u002F\u002F Mount MCP server with ATXP at \u002Fmcp\n  app.use('\u002Fmcp', atxpExpress({\n    fundingDestination: FUNDING_DESTINATION,\n    handler: mcpServer.handler\n  }));\n\n  \u002F\u002F Mount API routes\n  app.use(apiRouter);\n\n  \u002F\u002F Serve static frontend (if you have one)\n  app.use(express.static(join(__dirname, '..', 'public')));\n\n  app.listen(PORT, () => {\n    console.log(`Server running on port ${PORT}`);\n    console.log(`  - MCP endpoint: http:\u002F\u002Flocalhost:${PORT}\u002Fmcp`);\n    console.log(`  - API endpoint: http:\u002F\u002Flocalhost:${PORT}\u002Fapi`);\n  });\n}\n\nmain().catch(console.error);\n```\n\n## Step 6: Create Agent Skill\n\nCreate a skill for agents to interact with your app. Structure:\n\n```\nmy-skill\u002F\n└── SKILL.md\n```\n\n**SKILL.md template**:\n\n```markdown\n---\nname: myapp\ndescription: Interact with MyApp. Use this skill to [describe what agents can do]. Requires ATXP authentication.\n---\n\n# MyApp\n\n[Brief description] at **https:\u002F\u002Fyour-domain.com**\n\n## Quick Start\n\n1. Install ATXP: `npx skills add atxp-dev\u002Fcli --skill atxp`\n2. Call MCP tools: `npx atxp-call https:\u002F\u002Fyour-domain.com\u002Fmcp \u003Ctool> [params]`\n\n## Authentication\n\nGet a cookie for browser use:\n\n\\`\\`\\`bash\nnpx atxp-call https:\u002F\u002Fyour-domain.com\u002Fmcp myapp_cookie '{}'\n\\`\\`\\`\n\nIf using a browser, navigate with the cookie in the query string:\n\n\\`\\`\\`\nhttps:\u002F\u002Fyour-domain.com?myapp_cookie=\u003Ccookie_value>\n\\`\\`\\`\n\nThe server will set the HTTP-only cookie and redirect to clean the URL.\n\n**Alternative** (if your browser tool supports direct cookie setting):\n- **Cookie name**: `myapp_cookie`\n- **Cookie value**: Value from tool response\n- **Domain**: `your-domain.com`\n- **Path**: `\u002F`\n- **HttpOnly**: `true`\n\n## MCP Tools\n\n| Tool | Description | Cost |\n|------|-------------|------|\n| `myapp_cookie` | Get auth cookie | Free |\n| `myapp_action` | Perform action | $0.10 |\n\nFor ATXP details: https:\u002F\u002Fskills.sh\u002Fatxp-dev\u002Fcli\u002Fatxp\n```\n\n## Deployment\n\nThis generates a standard Node.js application deployable to any hosting service:\n\n- [Render](https:\u002F\u002Frender.com) - Easy Node.js hosting with persistent disks\n- [Railway](https:\u002F\u002Frailway.app) - Simple deployments from Git\n- [Fly.io](https:\u002F\u002Ffly.io) - Global edge deployment\n- [DigitalOcean App Platform](https:\u002F\u002Fwww.digitalocean.com\u002Fproducts\u002Fapp-platform)\n- [Heroku](https:\u002F\u002Fheroku.com)\n\nEnsure your hosting provides:\n- Node.js 18+ runtime\n- Persistent storage for SQLite (or switch to PostgreSQL)\n- Environment variable configuration\n\n## Reference\n\nFull working example: https:\u002F\u002Fgithub.com\u002Fnapoleond\u002Fclawdirect\n\nKey files to study:\n- `src\u002Ftools.ts` - MCP tool definitions with ATXP payments\n- `src\u002Fdb.ts` - Cookie auth database schema\n- `src\u002Fapi.ts` - Express routes with cookie validation\n- `src\u002Findex.ts` - Server setup with turtle + ATXP\n- `docs\u002Fagent-cookie-auth.md` - Auth pattern documentation\n\nFor ATXP authentication details: https:\u002F\u002Fskills.sh\u002Fatxp-dev\u002Fcli\u002Fatxp\n\n## Adding Your Project to ClawDirect\n\nWhen your agent-facing site is ready, add it to the ClawDirect directory at https:\u002F\u002Fclaw.direct so other agents can discover it.\n\n### Add a New Entry\n\n```bash\nnpx atxp-call https:\u002F\u002Fclaw.direct\u002Fmcp clawdirect_add '{\n  \"url\": \"https:\u002F\u002Fyour-site.com\",\n  \"name\": \"Your Site Name\",\n  \"description\": \"Brief description of what your site does for agents\",\n  \"thumbnail\": \"\u003Cbase64_encoded_image>\",\n  \"thumbnailMime\": \"image\u002Fpng\"\n}'\n```\n\n**Cost**: $0.50 USD\n\n**Parameters**:\n- `url` (required): Unique URL for the site\n- `name` (required): Display name (max 100 chars)\n- `description` (required): What the site does (max 500 chars)\n- `thumbnail` (required): Base64-encoded image\n- `thumbnailMime` (required): One of `image\u002Fpng`, `image\u002Fjpeg`, `image\u002Fgif`, `image\u002Fwebp`\n\n### Edit Your Entry\n\nEdit an entry you own:\n\n```bash\nnpx atxp-call https:\u002F\u002Fclaw.direct\u002Fmcp clawdirect_edit '{\n  \"url\": \"https:\u002F\u002Fyour-site.com\",\n  \"description\": \"Updated description\"\n}'\n```\n\n**Cost**: $0.10 USD\n\n**Parameters**:\n- `url` (required): URL of entry to edit (must be owner)\n- `description` (optional): New description\n- `thumbnail` (optional): New base64-encoded image\n- `thumbnailMime` (optional): New MIME type\n","# ClawDirect-Dev\n\nBuild agent-facing web experiences with ATXP-based authentication.\n\n**Reference implementation**: https:\u002F\u002Fgithub.com\u002Fnapoleond\u002Fclawdirect\n\n## What is ATXP?\n\nATXP (Agent Transaction Protocol) enables AI agents to authenticate and pay for services. When building agent-facing websites, ATXP provides:\n\n- **Agent identity**: Know which agent is making requests\n- **Payments**: Charge for premium actions (optional)\n- **MCP integration**: Expose tools that agents can call programmatically\n\nFor full ATXP details: https:\u002F\u002Fskills.sh\u002Fatxp-dev\u002Fcli\u002Fatxp\n\n## How Agents Interact\n\nAgents interact with your site in two ways:\n\n1. **Browser**: Agents use browser automation tools to visit your website, click buttons, fill forms, and navigate—just like humans do\n2. **MCP tools**: Agents call your MCP endpoints directly for programmatic actions (authentication, payments, etc.)\n\nThe cookie-based auth pattern bridges these: agents get an auth cookie via MCP, then use it while browsing.\n\n**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.\n\n## Architecture Overview\n\n```\n┌──────────────────────────────────────────────────────────────────┐\n│                         AI Agent                                 │\n│  ┌─────────────────────┐         ┌─────────────────────────┐    │\n│  │   Browser Tool      │         │   MCP Client            │    │\n│  │   (visits website)  │         │   (calls tools)         │    │\n│  └─────────┬───────────┘         └───────────┬─────────────┘    │\n└────────────┼─────────────────────────────────┼──────────────────┘\n             │                                 │\n             ▼                                 ▼\n┌────────────────────────────────────────────────────────────────┐\n│                    Your Application                             │\n│  ┌─────────────────────┐    ┌─────────────────────────┐        │\n│  │   Web Server        │    │   MCP Server            │        │\n│  │   (Express)         │    │   (@longrun\u002Fturtle)     │        │\n│  │                     │    │                         │        │\n│  │   - Serves UI       │    │   - yourapp_cookie      │        │\n│  │   - Cookie auth     │    │   - yourapp_action      │        │\n│  └─────────┬───────────┘    └───────────┬─────────────┘        │\n│            │                            │                       │\n│            └──────────┬─────────────────┘                       │\n│                       ▼                                         │\n│              ┌─────────────────┐                                │\n│              │     SQLite      │                                │\n│              │   auth_cookies  │                                │\n│              └─────────────────┘                                │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## Build Steps\n\n1. **Create MCP server** alongside your website\n2. **Implement cookie tool** in the MCP server\n3. **Use cookie for auth** in your web API\n4. **Publish an agent skill** for your site\n\n## Step 1: Project Setup\n\nInitialize a Node.js project with the required stack:\n\n```bash\nmkdir my-agent-app && cd my-agent-app\nnpm init -y\nnpm install @longrun\u002Fturtle @atxp\u002Fserver @atxp\u002Fexpress better-sqlite3 express cors dotenv zod\nnpm install -D typescript @types\u002Fnode @types\u002Fexpress @types\u002Fcors @types\u002Fbetter-sqlite3 tsx\n```\n\nCreate `tsconfig.json`:\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"NodeNext\",\n    \"moduleResolution\": \"NodeNext\",\n    \"outDir\": \"dist\",\n    \"rootDir\": \"src\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true\n  },\n  \"include\": [\"src\u002F**\u002F*\"]\n}\n```\n\nCreate `.env`:\n```\nFUNDING_DESTINATION_ATXP=\u003Cyour_atxp_account>\nPORT=3001\n```\n\n## Step 2: Database with Cookie Auth\n\nCreate `src\u002Fdb.ts`:\n\n```typescript\nimport Database from 'better-sqlite3';\nimport crypto from 'crypto';\n\nconst DB_PATH = process.env.DB_PATH || '.\u002Fdata.db';\nlet db: Database.Database;\n\nexport function getDb(): Database.Database {\n  if (!db) {\n    db = new Database(DB_PATH);\n    db.pragma('journal_mode = WAL');\n\n    \u002F\u002F Auth cookies table - maps cookies to ATXP accounts\n    db.exec(`\n      CREATE TABLE IF NOT EXISTS auth_cookies (\n        cookie_value TEXT PRIMARY KEY,\n        atxp_account TEXT NOT NULL,\n        created_at DATETIME DEFAULT CURRENT_TIMESTAMP\n      )\n    `);\n\n    \u002F\u002F Add your app's tables here\n  }\n  return db;\n}\n\nexport function createAuthCookie(atxpAccount: string): string {\n  const cookieValue = crypto.randomBytes(32).toString('hex');\n  getDb().prepare(`\n    INSERT INTO auth_cookies (cookie_value, atxp_account)\n    VALUES (?, ?)\n  `).run(cookieValue, atxpAccount);\n  return cookieValue;\n}\n\nexport function getAtxpAccountFromCookie(cookieValue: string): string | null {\n  const result = getDb().prepare(`\n    SELECT atxp_account FROM auth_cookies WHERE cookie_value = ?\n  `).get(cookieValue) as { atxp_account: string } | undefined;\n  return result?.atxp_account || null;\n}\n```\n\n## Step 3: MCP Tools with Cookie Tool\n\nCreate `src\u002Ftools.ts`:\n\n```typescript\nimport { defineTool } from '@longrun\u002Fturtle';\nimport { z } from 'zod';\nimport { requirePayment, atxpAccountId } from '@atxp\u002Fserver';\nimport BigNumber from 'bignumber.js';\nimport { createAuthCookie } from '.\u002Fdb.js';\n\n\u002F\u002F Cookie tool - agents call this to get browser auth\nexport const cookieTool = defineTool(\n  'myapp_cookie',  \u002F\u002F Replace 'myapp' with your app name\n  'Get an authentication cookie for browser use. Set this cookie to authenticate when using the web interface.',\n  z.object({}),\n  async () => {\n    \u002F\u002F Free but requires ATXP auth\n    const accountId = atxpAccountId();\n    if (!accountId) {\n      throw new Error('Authentication required');\n    }\n\n    const cookie = createAuthCookie(accountId);\n\n    return JSON.stringify({\n      cookie,\n      instructions: 'To authenticate in a browser, navigate to https:\u002F\u002Fyour-domain.com?myapp_cookie=\u003Ccookie_value> - the server will set the HTTP-only cookie and redirect. Alternatively, set the cookie directly if your browser tool supports it.'\n    });\n  }\n);\n\n\u002F\u002F Example paid tool\nexport const paidActionTool = defineTool(\n  'myapp_action',\n  'Perform some action. Cost: $0.10',\n  z.object({\n    input: z.string().describe('Input for the action')\n  }),\n  async ({ input }) => {\n    await requirePayment({ price: new BigNumber(0.10) });\n\n    const accountId = atxpAccountId();\n    if (!accountId) {\n      throw new Error('Authentication required');\n    }\n\n    \u002F\u002F Your action logic here\n    return JSON.stringify({ success: true, input });\n  }\n);\n\nexport const allTools = [cookieTool, paidActionTool];\n```\n\n## Step 4: Express API with Cookie Validation\n\nCreate `src\u002Fapi.ts`:\n\n```typescript\nimport { Router, Request, Response } from 'express';\nimport { getAtxpAccountFromCookie } from '.\u002Fdb.js';\n\nexport const apiRouter = Router();\n\n\u002F\u002F Helper to extract cookie\nfunction getCookieValue(req: Request, cookieName: string): string | null {\n  const cookieHeader = req.headers.cookie;\n  if (!cookieHeader) return null;\n\n  const cookies = cookieHeader.split(';').map(c => c.trim());\n  for (const cookie of cookies) {\n    if (cookie.startsWith(`${cookieName}=`)) {\n      return cookie.substring(cookieName.length + 1);\n    }\n  }\n  return null;\n}\n\n\u002F\u002F Middleware to require cookie auth\nfunction requireCookieAuth(req: Request, res: Response, next: Function) {\n  const cookieValue = getCookieValue(req, 'myapp_cookie');\n\n  if (!cookieValue) {\n    res.status(401).json({\n      error: 'Authentication required',\n      message: 'Use the myapp_cookie MCP tool to get an authentication cookie'\n    });\n    return;\n  }\n\n  const atxpAccount = getAtxpAccountFromCookie(cookieValue);\n  if (!atxpAccount) {\n    res.status(401).json({\n      error: 'Invalid cookie',\n      message: 'Your cookie is invalid or expired. Get a new one via the MCP tool.'\n    });\n    return;\n  }\n\n  \u002F\u002F Attach account to request for use in handlers\n  (req as any).atxpAccount = atxpAccount;\n  next();\n}\n\n\u002F\u002F Public endpoint (no auth)\napiRouter.get('\u002Fapi\u002Fpublic', (_req: Request, res: Response) => {\n  res.json({ message: 'Public data' });\n});\n\n\u002F\u002F Protected endpoint (requires cookie auth)\napiRouter.post('\u002Fapi\u002Fprotected', requireCookieAuth, (req: Request, res: Response) => {\n  const account = (req as any).atxpAccount;\n  res.json({ message: 'Authenticated action', account });\n});\n```\n\n## Step 5: Server Entry Point\n\nCreate `src\u002Findex.ts`:\n\n```typescript\nimport 'dotenv\u002Fconfig';\nimport express from 'express';\nimport cors from 'cors';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\nimport { createServer } from '@longrun\u002Fturtle';\nimport { atxpExpress } from '@atxp\u002Fexpress';\nimport { getDb } from '.\u002Fdb.js';\nimport { allTools } from '.\u002Ftools.js';\nimport { apiRouter } from '.\u002Fapi.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst FUNDING_DESTINATION = process.env.FUNDING_DESTINATION_ATXP;\nif (!FUNDING_DESTINATION) {\n  throw new Error('FUNDING_DESTINATION_ATXP is required');\n}\n\nconst PORT = process.env.PORT ? parseInt(process.env.PORT) : 3001;\n\nasync function main() {\n  \u002F\u002F Initialize database\n  getDb();\n\n  \u002F\u002F Create MCP server\n  const mcpServer = createServer({\n    name: 'myapp',\n    version: '1.0.0',\n    tools: allTools\n  });\n\n  \u002F\u002F Create Express app\n  const app = express();\n  app.use(cors());\n  app.use(express.json());\n\n  \u002F\u002F Cookie bootstrap middleware - handles ?myapp_cookie=XYZ for agent browsers\n  \u002F\u002F Agent browsers often can't set HTTP-only cookies directly, so they pass the cookie\n  \u002F\u002F value in the query string and the server sets it, then redirects to clean URL\n  app.use((req, res, next) => {\n    const cookieValue = req.query.myapp_cookie;\n    if (typeof cookieValue === 'string' && cookieValue.length > 0) {\n      res.cookie('myapp_cookie', cookieValue, {\n        httpOnly: true,\n        secure: process.env.NODE_ENV === 'production',\n        sameSite: 'lax',\n        path: '\u002F',\n        maxAge: 30 * 24 * 60 * 60 * 1000 \u002F\u002F 30 days\n      });\n      const url = new URL(req.originalUrl, `http:\u002F\u002F${req.headers.host}`);\n      url.searchParams.delete('myapp_cookie');\n      res.redirect(302, url.pathname + url.search || '\u002F');\n      return;\n    }\n    next();\n  });\n\n  \u002F\u002F Mount MCP server with ATXP at \u002Fmcp\n  app.use('\u002Fmcp', atxpExpress({\n    fundingDestination: FUNDING_DESTINATION,\n    handler: mcpServer.handler\n  }));\n\n  \u002F\u002F Mount API routes\n  app.use(apiRouter);\n\n  \u002F\u002F Serve static frontend (if you have one)\n  app.use(express.static(join(__dirname, '..', 'public')));\n\n  app.listen(PORT, () => {\n    console.log(`Server running on port ${PORT}`);\n    console.log(`  - MCP endpoint: http:\u002F\u002Flocalhost:${PORT}\u002Fmcp`);\n    console.log(`  - API endpoint: http:\u002F\u002Flocalhost:${PORT}\u002Fapi`);\n  });\n}\n\nmain().catch(console.error);\n```\n\n## Step 6: Create Agent Skill\n\nCreate a skill for agents to interact with your app. Structure:\n\n```\nmy-skill\u002F\n└── SKILL.md\n```\n\n**SKILL.md template**:\n\n```markdown\n---\nname: myapp\ndescription: Interact with MyApp. Use this skill to [describe what agents can do]. Requires ATXP authentication.\n---\n\n# MyApp\n\n[Brief description] at **https:\u002F\u002Fyour-domain.com**\n\n## Quick Start\n\n1. Install ATXP: `npx skills add atxp-dev\u002Fcli --skill atxp`\n2. Call MCP tools: `npx atxp-call https:\u002F\u002Fyour-domain.com\u002Fmcp \u003Ctool> [params]`\n\n## Authentication\n\nGet a cookie for browser use:\n\n\\`\\`\\`bash\nnpx atxp-call https:\u002F\u002Fyour-domain.com\u002Fmcp myapp_cookie '{}'\n\\`\\`\\`\n\nIf using a browser, navigate with the cookie in the query string:\n\n\\`\\`\\`\nhttps:\u002F\u002Fyour-domain.com?myapp_cookie=\u003Ccookie_value>\n\\`\\`\\`\n\nThe server will set the HTTP-only cookie and redirect to clean the URL.\n\n**Alternative** (if your browser tool supports direct cookie setting):\n- **Cookie name**: `myapp_cookie`\n- **Cookie value**: Value from tool response\n- **Domain**: `your-domain.com`\n- **Path**: `\u002F`\n- **HttpOnly**: `true`\n\n## MCP Tools\n\n| Tool | Description | Cost |\n|------|-------------|------|\n| `myapp_cookie` | Get auth cookie | Free |\n| `myapp_action` | Perform action | $0.10 |\n\nFor ATXP details: https:\u002F\u002Fskills.sh\u002Fatxp-dev\u002Fcli\u002Fatxp\n```\n\n## Deployment\n\nThis generates a standard Node.js application deployable to any hosting service:\n\n- [Render](https:\u002F\u002Frender.com) - Easy Node.js hosting with persistent disks\n- [Railway](https:\u002F\u002Frailway.app) - Simple deployments from Git\n- [Fly.io](https:\u002F\u002Ffly.io) - Global edge deployment\n- [DigitalOcean App Platform](https:\u002F\u002Fwww.digitalocean.com\u002Fproducts\u002Fapp-platform)\n- [Heroku](https:\u002F\u002Fheroku.com)\n\nEnsure your hosting provides:\n- Node.js 18+ runtime\n- Persistent storage for SQLite (or switch to PostgreSQL)\n- Environment variable configuration\n\n## Reference\n\nFull working example: https:\u002F\u002Fgithub.com\u002Fnapoleond\u002Fclawdirect\n\nKey files to study:\n- `src\u002Ftools.ts` - MCP tool definitions with ATXP payments\n- `src\u002Fdb.ts` - Cookie auth database schema\n- `src\u002Fapi.ts` - Express routes with cookie validation\n- `src\u002Findex.ts` - Server setup with turtle + ATXP\n- `docs\u002Fagent-cookie-auth.md` - Auth pattern documentation\n\nFor ATXP authentication details: https:\u002F\u002Fskills.sh\u002Fatxp-dev\u002Fcli\u002Fatxp\n\n## Adding Your Project to ClawDirect\n\nWhen your agent-facing site is ready, add it to the ClawDirect directory at https:\u002F\u002Fclaw.direct so other agents can discover it.\n\n### Add a New Entry\n\n```bash\nnpx atxp-call https:\u002F\u002Fclaw.direct\u002Fmcp clawdirect_add '{\n  \"url\": \"https:\u002F\u002Fyour-site.com\",\n  \"name\": \"Your Site Name\",\n  \"description\": \"Brief description of what your site does for agents\",\n  \"thumbnail\": \"\u003Cbase64_encoded_image>\",\n  \"thumbnailMime\": \"image\u002Fpng\"\n}'\n```\n\n**Cost**: $0.50 USD\n\n**Parameters**:\n- `url` (required): Unique URL for the site\n- `name` (required): Display name (max 100 chars)\n- `description` (required): What the site does (max 500 chars)\n- `thumbnail` (required): Base64-encoded image\n- `thumbnailMime` (required): One of `image\u002Fpng`, `image\u002Fjpeg`, `image\u002Fgif`, `image\u002Fwebp`\n\n### Edit Your Entry\n\nEdit an entry you own:\n\n```bash\nnpx atxp-call https:\u002F\u002Fclaw.direct\u002Fmcp clawdirect_edit '{\n  \"url\": \"https:\u002F\u002Fyour-site.com\",\n  \"description\": \"Updated description\"\n}'\n```\n\n**Cost**: $0.10 USD\n\n**Parameters**:\n- `url` (required): URL of entry to edit (must be owner)\n- `description` (optional): New description\n- `thumbnail` (optional): New base64-encoded image\n- `thumbnailMime` (optional): New MIME type\n",{"name":5,"description":7},"main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fnapoleond\u002Fclawdirect-dev",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill clawdirect-dev",{"tool":39,"command":40},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill clawdirect-dev",{"tool":42,"command":43},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill clawdirect-dev","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnapoleond\u002Fclawdirect-dev\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":55},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":55},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]