- Home
- MCP servers
- Cloudflare MCP Logging
Cloudflare MCP Logging
- javascript
0
GitHub Stars
javascript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"weyseing-cloudflare-mcp-logging": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://<MCP_SERVER_URL>/sse"
]
}
}
}This MCP server provides a Cloudflare-based logging solution that connects to remote MCP clients, enabling you to run local MCP services, test via dev servers, and connect clients to your MCP server for real-time event streaming and logging.
How to use
You connect MCP clients to your server by using standard MCP client commands that point to your server’s SSE endpoint. The examples below show how to connect a remote MCP client and a local, self-hosted gateway to your server. Use these patterns to integrate additional clients or automation scripts.
Connect via MCP Host/Client
Two common client configurations are shown here. They demonstrate how to connect a remote MCP instance and a local gateway to your MCP server’s SSE endpoint.
{
"mcpServers": {
"CF Remote MCP": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://<MCP_SERVER_URL>/sse"
]
}
}
}
{
"mcpServers": {
"Basic Calculator": {
"command": "npx",
"args": [
"-y",
"supergateway",
"--sse",
"http://localhost:8787/sse",
"--header",
"X-UserID:USERID_123",
"--header",
"X-SecretKey:SKEY_456"
]
}
}
}
LogPush and environment setup
If you plan to collect logs from the Cloudflare Worker, enable logpush in the worker configuration and provide the necessary R2 credentials and log storage setup. You also need to configure environment values that your MCP server uses for log collection and client authentication.
The following environment values are commonly used for R2-backed log storage and access keys. Replace placeholders with your actual credentials.
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"
How to deploy and run in development
Follow these practical steps to set up the development environment, initialize the project, and run the local dev server to test your MCP server and client connections.
docker compose up -d
npm init -y
npm install
npm create cloudflare@latest -- mcp-logging --template=cloudflare/ai/demos/remote-mcp-authless
# If clone template failed, clone the Cloudflare AI repository and retry
git clone https://github.com/cloudflare/ai.git
# Update for dev server
# In package.json, set the dev command to use wrangler dev with a public IP
# Start the dev server and map ports
# docker-compose.yml should expose 8787:8787
npm start
# Alternatively
wrangler dev --ip 0.0.0.0
Additional notes
You can access the local MCP server dev endpoint at the address configured in your setup, typically via the SSE path (for example, /sse). Ensure your environment variables and Cloudflare credentials are securely managed and not committed to source control. When you have a remote MCP URL, you can point clients to that SSE endpoint to begin streaming events.
Available tools
mcp-remote
Connects to a remote MCP server by running the MCP client via npx and pointing to the server's SSE endpoint.
supergateway
Runs a local gateway client that connects to the MCP server SSE endpoint, with optional headers for user identification and secret keys.