Provides time-related MCP tools to get current times and convert times across IANA timezones.
Configuration
View docs{
"mcpServers": {
"jharkins-mcp-time-srv": {
"command": "node",
"args": [
"dist/server.js"
]
}
}
}You can run a lightweight MCP server that answers time-related queries. It exposes tools to fetch the current time in a specific IANA timezone and to convert a time between timezones, with optional local defaults if you don’t specify a timezone. This makes it easy to build time-aware features into your MCP client and test time calculations across time zones.
To use the Time MCP server with a client, connect using the available MCP transport options. The server provides two core tools you can call: get_current_time to obtain the current time in a chosen IANA timezone, and convert_time to transform a time from one timezone to another. You can invoke these tools from your MCP client and handle the resulting data to display time information or perform scheduling across regions.
Prerequisites you need before installing and running the Time MCP server are Node.js (version 18 or later is recommended) and npm (which typically comes with Node.js). Docker is optional if you want to run the server inside a container.
Step by step commands to set up and run the server locally:
npm install
npm run build
npx ts-node src/server.ts
node dist/server.js
# If you prefer running in a container later:
docker build -t mcp-time-srv .
docker run -d -p 3000:3000 --name my-mcp-server mcp-time-srv
"}]} ,{Notes on running modes:
- In development, you can start directly with `npx ts-node src/server.ts`. This runs the TypeScript source without building to JavaScript.
- After building, start with `node dist/server.js` to run the compiled server from the `dist` directory.
- The server defaults to listening on port 3000 unless you configure a different port in your startup setup.Docker provides a convenient way to run the server in isolation. Build the image with docker build -t mcp-time-srv . and run it with docker run -d -p 3000:3000 --name my-mcp-server mcp-time-srv. To inspect logs, use docker logs my-mcp-server.
If you want to test the server interactively, you can use a client script to connect and exercise both tools. The client will list available tools and call them with sample arguments to verify behavior and error handling.
Returns the current time for a specified IANA timezone and defaults to the server's local timezone if none is provided.
Converts a given time from a source IANA timezone to a target IANA timezone and reports the time difference between the two timezones.