Get the FREE Ultimate OpenClaw Setup Guide →

mcp-time-php

A PHP sample implementation of an MCP (Model Context Protocol) server for retrieving time information.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio uzulla-mcp-time-php php /path/to/this/repo/bin/time-server

How to use

This MCP server is implemented in PHP and provides time-related capabilities via the MCP protocol. It exposes two tools: get_current_time, which returns the current time in a specified IANA timezone or the server’s system timezone, and convert_time, which converts a given time from a source timezone to a target timezone. The server is designed to let LLMs request precise time information and perform cross-timezone conversions using standard IANA timezone names such as Europe/London or America/New_York. To use the tools, send an MCP request with the tool name and the required arguments as shown in the examples in the repository’s README. The server supports default system timezone detection unless overridden by a local timezone setting, enabling flexible deployment.

For get_current_time, you must provide the timezone argument (an IANA timezone string). For convert_time, you must provide source_timezone, time (in 24-hour HH:MM format), and target_timezone. The responses include timezone, datetime, and is_dst fields for the time results, along with any relevant metadata. The tools are designed to be composable within Claude, Zed, or other MCP clients that support the MCP protocol.

How to install

Prerequisites:

  • PHP installed on your system (and PHP CLI available as php)
  • Composer for PHP dependencies
  • Git to clone the repository

Installation steps:

  1. Clone the repository git clone https://github.com/uzulla/mcp-time-php.git cd mcp-time-php

  2. Install PHP dependencies with Composer composer install

  3. (Optional) Run tests to verify setup composer test

  4. Run the server locally (example) php bin/time-server

  5. Integrate with an MCP client by configuring the appropriate mcpServers entry (see mcp_config).

Additional notes

Tips and notes:

  • The server auto-detects the system timezone by default. To override, pass --local-timezone=<Area/City> in the command args, e.g., php bin/time-server --local-timezone=America/New_York.
  • Ensure PHP CLI is accessible in your environment PATH when running the server.
  • When debugging with MCP Inspector, you can run: npx @modelcontextprotocol/inspector ./bin/time-server
  • Timezone names must follow the IANA tz database (e.g., Europe/London, America/New_York).
  • If you modify the server path, update the mcp_config accordingly to point to the correct time-server entry point.

Related MCP Servers

Sponsor this space

Reach thousands of developers