Provides a dynamic tool registry using Cloudflare D1 database and containerized execution environment for AI agents to discover and invoke tools at runtime
Built on Cloudflare Workers runtime to serve as an MCP server that manages containerized tools with scale-to-zero execution
Includes tools for cloning GitHub repositories and summarizing README files through the summarize_repo_readme functionality
BYOB MCP Server ๐
Bring Your Own Binary: A dynamic MCP server built on Cloudflare Workers, Containers, and D1.
Enables AI agents to discover and invoke containerized tools registered at runtimeโno redeployment needed.
Quick Start
What This Is
A proof-of-concept demonstrating:
โ Dynamic Tool Registry - Tools stored in D1, queried by MCP server
โ Containerized Execution - Each tool runs in isolated Cloudflare Container
โ MCP Protocol - AI agents discover tools via Model Context Protocol
โ HTTP Registration API - Register new tools without redeploying
โ Scale-to-Zero - Containers only run when tools are invoked
Architecture
Pre-Built Demo Tools
All four tools run in a single universal container:
echo_message - Echoes back any JSON input
why_are_we_yelling - Converts text to UPPERCASE
query_json - Processes JSON with jq filters
summarize_repo_readme - Clones a GitHub repo and summarizes its README
API Endpoints
GET /
Health check and server info
GET /api/tools
List all registered tools
POST /api/register-tool
Register a new tool
POST /mcp
MCP protocol endpoint (connect your AI agent here)
Example: Register a Tool
Connect to Claude Desktop
Edit your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Restart Claude Desktop, then ask:
"What tools do you have available?"
"Can you echo the message 'Hello BYOB!'?"
"Use why_are_we_yelling with text: hello world"
"Summarize the README from https://github.com/fiberplane/mcp-lite"
Documentation
PROJECT_SUMMARY.md - High-level overview
HACKATHON.md - Full architecture and setup guide
DEMO.md - Step-by-step demo script
CLAUDE.md - Development instructions (for AI assistants)
Project Structure
Adding New Tools
Since all tools use the same universal container, adding new tools is simple:
Option 1: Via API (No redeployment needed)
Option 2: Extend the Container
To add new operation types:
Edit
containers/server.jsto handle new input patternsAdd new tool definitions to
migrations/0002_seed_example_tools.sqlRedeploy
The single container approach keeps things simple for demos while still demonstrating the BYOB architecture.
Technology Stack
Runtime: Cloudflare Workers (V8 Isolates)
MCP: mcp-lite (not @modelcontextprotocol/sdk)
Web Framework: Hono
Database: Cloudflare D1 (SQLite)
Containers: Cloudflare Containers (Durable Objects)
Schema: Zod + JSON Schema
Deployment
Local Development
Production Deployment
Run migrations on remote database:
Deploy Worker and Containers:
Note: First deployment takes 2-5 minutes to build Docker images.
Update Claude Desktop config with your production URL:
Testing
Key Features
Dynamic Discovery
Tools registered in D1 appear immediately to all connected AI agentsโno redeployment required.
Secure Isolation
Each container runs in an isolated sandbox with resource limits and ephemeral storage.
Serverless Scale
Containers scale to zero when idle. Pay only for actual tool invocations.
Standard Interface
All containers expose POST /execute endpoint accepting/returning JSON.
Limitations
Container classes must be defined at deploy time in wrangler.jsonc. True runtime BYOB would require automatic Worker rebuild/redeploy when new containers are registered.
Workaround: Multiple logical tools can share the same container class, allowing significant flexibility without redeployment.
Resources
License
MIT - Built for hackathon demonstration
Contributing
This is a hackathon prototype. For questions or suggestions, open an issue!
Built with โ๏ธ Cloudflare Workers | ๐ณ Containers | ๐๏ธ D1 | ๐ค MCP
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI agents to dynamically discover and invoke containerized tools that can be registered at runtime without redeployment. Built on Cloudflare Workers with scale-to-zero containers for secure, isolated tool execution.