vlt / affordances
  • Quickstart
  • Concepts
  • Guides
  • Reference
  • Overview
    • Overview
    • Reference
  1. Reference
  2. /
  3. API reference
  4. /
  5. @affordances/mcp

@affordances/mcp

Any Affordances site as an MCP server, for Claude, Cursor, and other MCP clients. It gives the model two tools: affordances_open reads a page's graph, and affordances_call calls one of its actions and returns the delta. Actions that need confirmation answer with a summary first, to show the user before resending.

Terminal
vlx @affordances/mcp https://store.example.com --token "$STORE_TOKEN"
JSON
{
  "mcpServers": {
    "store": { "command": "vlx", "args": ["@affordances/mcp", "https://store.example.com"] }
  }
}

Without a token it keeps the site's cookies like a browser would. As a library, createClient(site, { token }) returns index(), open(path), and call(path, action, input, confirm), and createServer(site, options) returns the McpServer.

Docs: https://github.com/vltpkg/affordances/blob/main/apps/docs/content/guides/mcp.mdx


PreviousReferenceNextReference

Make your app agent-operable

Give every page a graph and every server action an agent path: HTTP, WebMCP, and MCP, with the same session and the same checks. One command sets it up.

Read the quickstart