Cloudflare MCP Toolbox
30 utility MCP tools for AI agents. DateTime, math, text processing, validation, KV storage, and Workers AI.
Overview
A utility belt for AI agents with 30 tools across common tasks. DateTime operations, math calculations, text processing, validation, persistent storage, and AI inference - all on Cloudflare’s edge.
The Problem
AI agents need utilities for:
- Date/time calculations and formatting
- Safe mathematical operations
- Text transformation and encoding
- Input validation and sanitisation
- Persistent data storage
- Additional AI model access
Building these into every project is wasteful.
Solution
Shared utility infrastructure across 6 categories:
Parse, format, convert
Calculate, convert, stats
Transform, encode, hash
Email, URL, JSON, HTML
Persistent key-value
Chat, classify, embed
Tools
DateTime (5)
| Tool | Description |
|---|---|
get_current_datetime | Current time in any timezone |
convert_timezone | Convert between timezones |
calculate_duration | Time between two dates |
format_date | Format dates in any pattern |
parse_date | Natural language parsing |
Math (6)
| Tool | Description |
|---|---|
calculate | Safe expression evaluation |
convert_units | Length, weight, volume, temp |
statistics | Mean, median, mode, stddev |
random_number | Cryptographically secure random |
percentage | Percentage calculations |
roll_dice | Dice notation (2d6+5, 1d20) |
Text (6)
| Tool | Description |
|---|---|
transform_text | Slug, uppercase, titlecase |
encode_decode | Base64, URL, HTML encoding |
extract_patterns | Emails, URLs, phones, hashtags |
hash_text | SHA-256/SHA-1 hashing |
count_words | Word and character counts |
truncate_text | Smart text truncation |
Validation (6)
| Tool | Description |
|---|---|
validate_email | Email format validation |
validate_url | URL structure validation |
validate_phone | Phone number validation |
validate_json | JSON syntax checking |
sanitize_html | XSS protection |
validate_schema | JSON schema validation |
KV Storage (4)
| Tool | Description |
|---|---|
kv_get | Retrieve stored value |
kv_set | Store with optional TTL |
kv_delete | Remove key |
kv_list | List keys by prefix |
Workers AI (3)
| Tool | Description |
|---|---|
ai_chat | LLM inference |
ai_classify | Sentiment analysis |
ai_embed | Text embeddings with caching |
Security
Safe implementation patterns:
| Feature | Approach |
|---|---|
| Math | Recursive descent parser (no eval) |
| HTML | Sanitisation for XSS protection |
| Auth | Bearer token + OAuth options |
| Input | Zod schema validation |
Features
- 30 Tools - Comprehensive utility coverage
- Zero Cold Start - Cloudflare Workers edge deployment
- Safe Evaluation - No eval() or Function() for math
- Persistent Storage - KV with TTL support
- AI Integration - Workers AI with embedding cache
- Global Edge - Low latency worldwide
Use Cases
DateTime Operations - Parse, format, convert across timezones
Calculations - Safe math with unit conversions
Text Processing - Transform, encode, extract patterns
Data Validation - Validate inputs before processing
Persistent Data - Store values across sessions
AI Augmentation - Additional model access for specific tasks
Interested in a similar solution?
Let's talk about your project