$ show jonesphillip/weft
Weft is a full-stack, AI-powered personal task management application built with React and Cloudflare Workers. It provides a Kanban-style board where users create tasks that can be executed by AI agents (Claude) using the Model Context Protocol (MCP) to interact with external services like Gmail, Google Docs, Google Sheets, and GitHub. The system features a sophisticated approval workflow: sensitive tool calls (e.g., sending email, creating PRs) require human approval with specialized UI components for reviewing diffs, documents, and spreadsheets. It supports scheduled task execution, real-time WebSocket updates, OAuth-based integrations, and a command palette for keyboard-driven navigation. The architecture leverages Cloudflare Durable Objects for stateful board management, Workflows for long-running agent execution, and a sandboxed environment for running untrusted code. The frontend is a single-page React application with a custom design system, while the backend is entirely serverless on Cloudflare's edge network.
The LLM identified 6 files worth highlighting for reuse:
Provides a factory function `createTool` that defines MCP tools using Zod schemas for input validation. This creates a single source of truth for tool definitions shared across the MCP bridge, system prompts, and approval views. The pattern is reusable for any project needing typed, validated tool definitions with descriptions and parameter schemas.
A complete OAuth 2.0 implementation for MCP servers, including PKCE flow, token exchange, dynamic client registration, and discovery. The module is self-contained with clear types and functions, making it reusable for any application needing to authenticate with third-party services via OAuth. Demonstrates careful handling of state, nonces, and error conditions.
Implements AES-256-GCM encryption with PBKDF2 key derivation for encrypting sensitive credentials at rest. Provides `encrypt` and `decrypt` functions that are self-contained and use standard Web Crypto API. Reusable in any Cloudflare Worker or Node.js environment needing symmetric encryption with password-based key derivation.
Parses unified diff output into a structured format with file paths, hunks, and line changes. Used by the GitHub PR approval view to display diffs with inline comments. The parser is self-contained and could be extracted for any project needing to parse and render diffs, such as code review tools or version control UIs.
Implements a registry that maps tool names to React components for approval views. Uses a simple object lookup with a default fallback, allowing easy extension by adding new entries. This pattern is reusable for any application that needs to dynamically render different UI components based on a type or identifier, such as form field renderers or notification types.
Implements the Model Context Protocol client with support for both SSE and Streamable HTTP transports. Handles JSON-RPC message framing, tool listing, and tool call execution. The client is modular with transport abstraction, making it reusable for any application that needs to communicate with MCP servers. Demonstrates careful handling of connection lifecycle and error recovery.