Cloudflare Logging
A server for logging, deployable as a Cloudflare Worker.
Setup
- Start up container
docker compose up -d - Initialize package.json
-
npm init -y(First time to create package.json) -
npm install
-
MCP Server Creation
- Create from CF template
-
npm create cloudflare@latest -- mcp-logging --template=cloudflare/ai/demos/remote-mcp-authless - If clone template failed, git clone cloudflare/ai repo below, then recreate
git clone https://github.com/cloudflare/ai.git
-
- Start dev server
- Update to use
wrangler dev --ip 0.0.0.0IP in package.json - Port mapping
8787:8787in docker-compose.yml npm startORwrangler dev --ip 0.0.0.0- Access via
localhost:8787/sse
- Update to use
Deploy CF Worker
- Set CF account ID to wrangler.jsonc
"account_id": "<EDIT-HERE>" - Set CF API key in env
- API's permission template:
Edit Cloudflare Workers - ENV:
CLOUDFLARE_API_TOKEN=<EDIT-HERE>
- API's permission template:
- Deploy worker to CF
npm run deployORnpx wrangler deploy
MCP Inspector
- Start inspector
npx @modelcontextprotocol/inspector@latest
Connect via MCP Host/Client
-
mcp-remote
{ "mcpServers": { "CF Remote MCP": { "command": "npx", "args": [ "-y", "mcp-remote", "https://<MCP_SERVER_URL>/sse" ] } } } -
supergateway
{ "mcpServers": { "Basic Calculator": { "command": "npx", "args": [ "-y", "supergateway", "--sse", "http://localhost:8787/sse", "--header", "X-UserID:USERID_123", "--header", "X-SecretKey:SKEY_456" ] } } }
LogPush
- Enable
logpushfor CF worker- Set
"logpush": truein wrangler.jsonc - Deploy to CF & check settings
- Set
- Create R2 API token
- Create R2 bucket
- Create LogPush job
- Set env (edit the value)
R2_BUCKET_NAME="EDIT: R2 BUCKET NAME"
R2_LOG_BASE_PREFIX="EDIT: R2 FOLDER NAME"
CF_R2_ACCESS_KEY_ID="EDIT: R2 ACCESS KEY ID"
CF_R2_SECRET_ACCESS_KEY="EDIT: R2 ACCESS SECRET"
- Run
utils/download_r2_logs.jsscript to get logsnode utils/download_r2_logs.js --start-date "2025-06-27 07:00:00" --end-date "2025-06-27 08:00:00"
Pass Variable to Tool Function
-
Set
ctx.propsin fetch entrypoint.export default { fetch(request: Request, env: Env, ctx: ExecutionContext) { const userId: string | null = request.headers.get('X-UserID'); const secretKey: string | null = request.headers.get('X-SecretKey'); ctx.props = { userId, secretKey }; // add this -
Use
this.props.<VARIABLE_NAME>in tool.this.server.tool( "calculate", { operation: z.enum(["add", "subtract", "multiply", "divide"]), a: z.number(), b: z.number() }, async ({ operation, a, b,}) => { try { // retrieve here const userId: string | null = this.props.userId as string; const secretKey: string | null = this.props.secretKey as string;
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
VSCode MCP Server
A VSCode extension that acts as an MCP server, providing access to diagnostic tools and debug session management.
paytoll-mcp
Access 20+ DeFi, crypto, and AI endpoints through micro-payments. Get Aave rates, build DeFi transactions, fetch crypto prices, resolve ENS names, search Twitter, and query LLMs - all paid per-call with USDC on Base. No API keys needed, payment is the auth
Blockchain MCP Server
A server for blockchain interactions, offering Ethereum vanity address generation, 4byte lookup, ABI encoding, and multi-chain RPC calls.
Code Snippet Image
Generate beautiful, shareable images from code snippets with syntax highlighting and multiple themes.
Bifrost VSCode Dev Tools
Exposes VSCode dev tools features to MCP clients, with support for project-specific configurations.
Dify MCP HTTP Tools
Fetch and call tools via MCP over HTTP with SSE or Streamable transport. Supports configuration of multiple MCP services.
MCP Devkit
A persistent development partner that prevents context drift and maintains project memory across all development sessions.
AIO-MCP Server
An MCP server with integrations for GitLab, Jira, Confluence, and YouTube, providing AI-powered search and development utility tools.
Dart MCP
An example MCP server built with Dart and deployed on Cloudflare Workers.
Authn8
Access your team's 2FA codes from AI agents without sharing secrets. List accounts, generate TOTP codes, and maintain full audit trails