Hasty Briefsbeta

Show HN: Built an MCP server using Cloudflare's Code Mode pattern

5 hours ago
  • #LLM
  • #TypeScript
  • #MCP
  • Local implementation of 'Code Mode' workflow for MCP servers using TypeScript/JavaScript.
  • LLMs write code to call a simple HTTP proxy instead of direct tool calls.
  • Core insight: LLMs are better at writing code than tool calling.
  • Single tool exposed to LLM: execute_code for TypeScript/JavaScript execution.
  • HTTP proxy forwards requests to MCP servers via fetch() calls.
  • Setup requires Bun, Deno, and an MCP-compatible client.
  • Configuration via codemode-config.json and .mcp.json files.
  • Example code snippets for listing servers and chaining operations.
  • Proxy endpoints for server listing, tool listing, and tool calls.
  • Security features include Deno sandbox, timeout, and controlled proxy access.
  • Error handling for common issues like Deno installation or permissions.