Thanks to visit codestin.com
Credit goes to github.com

Skip to content

charl-kruger/fewfew

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Remote MCP Server: Return User Timezone

This MCP server exposes a tool to return the current Cloudflare worker's runtime timezone. It demonstrates how to build a simple MCP server with Cloudflare Workers.

Quick Deploy

Deploy to Workers

This deploys your MCP server to: remote-mcp-server-authless-timezone.<your-account>.workers.dev/sse


Usage Example

Use Cloudflare AI Playground or Claude Desktop to connect to your deployed server. Query for the current timezone with:

Tool: get_timezone

  • No args needed for basic timezone detection (returns server's detected timezone).
  • Optionally, pass a location (name or lat,lng) as input (returns a stub message in demo).

Test Locally

npm run dev

Example request (MCP raw HTTP):

curl -X POST 'http://localhost:8787/mcp' \  
	-H 'Content-Type: application/json' \
	-d '{"tool":"get_timezone","params":{}}'

Customize

  • Edit src/index.ts to add or extend tools.
  • To enable real location-based timezone detection, integrate with a geolocation API and handle the location parameter.

Security/Notes

  • This demo does not collect true user location—only shows the Worker runtime timezone.
  • The server's timezone may not reflect the user's location.
  • Add authentication if restricting access is required.

Connect from Claude Desktop or mcp-remote

Claude example config:

{
  "mcpServers": {
    "timezone": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8787/sse"
      ]
    }
  }
}

Restart Claude Desktop, click "Connect", and try using the get_timezone tool.


About

Generated Cloudflare Remote MCP Worker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published