krystiangaleczka-tech/whatIsTheTime-MCP
3.2
If you are the rightful owner of whatIsTheTime-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The timezone-mcp is a Model Context Protocol (MCP) server designed to handle local time queries and timezone listings using JSON-RPC 2.0 over stdio.
Tools
2
Resources
0
Prompts
0
timezone-mcp
MCP (Model Context Protocol) stdio server for local time queries and timezone listing.
Requirements
Node.js >= 16
Installation
- Install dependencies:
npm install
Run
- MCP server (stdio):
npm start - Helper HTTP server (used by tools):
npm run http
The MCP server speaks JSON-RPC 2.0 over stdio with Content-Length framing.
Example frame (initialize):
Content-Length: 46
{"jsonrpc":"2.0","id":1,"method":"initialize"}
Tools
time— returns current time for the local or a specified IANA timezone.- Params:
{ "timezone": "Europe/Warsaw" }(optional; uses local timezone if omitted).
- Params:
list_timezones— returns available IANA timezones, optionally filtered by prefix.- Params:
{ "prefix": "Europe/" }(optional, case-insensitive).
- Params:
Note: both tools call the local HTTP server (npm run http) at http://localhost:3090.
JSON-RPC Examples
- Initialize
Content-Length: 46
{"jsonrpc":"2.0","id":1,"method":"initialize"}
- Call
time(local timezone)
Content-Length: 95
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"time","arguments":{}}}
- Call
time(specific timezone)
Content-Length: 131
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"time","arguments":{"timezone":"Europe/Warsaw"}}}
- Example success response (shape)
Content-Length: <len>
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"14:37"}]}}
- Call
list_timezones(no filter)
Content-Length: 111
{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"list_timezones","arguments":{}}}
- Call
list_timezones(with prefix)
Content-Length: 144
{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"list_timezones","arguments":{"prefix":"Europe/"}}}
- Example
list_timezonesresponse (shape)
Content-Length: <len>
{"jsonrpc":"2.0","id":5,"result":{"content":[{"type":"text","text":"{\"count\":\"...\",\"timezones\":[\"Europe/Warsaw\", ...]}"}]}}
Tests
- Quick MCP test:
npm test(runstest_mcp.js) - Additional:
node test_simple.js,node test_stdio.js,node test_send.js,node test_minimal.js,node test_manual.js,node test_tools.js
CLI
- Use
npm startor the binarybin/timezone-mcp(executessrc/index.js).
Structure
src/index.js— MCP server entry point.src/server.js— JSON-RPC over stdio implementation and tool handling.src/http-server.js— local HTTP server providing time and timezone endpoints.src/tools/time.js—timetool HTTP client → MCP response.src/tools/listTimezones.js—list_timezonestool HTTP client → MCP response.
License
MIT