mcp-time-php
A PHP sample implementation of an MCP (Model Context Protocol) server for retrieving time information.
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:
-
Clone the repository git clone https://github.com/uzulla/mcp-time-php.git cd mcp-time-php
-
Install PHP dependencies with Composer composer install
-
(Optional) Run tests to verify setup composer test
-
Run the server locally (example) php bin/time-server
-
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
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
workflowy
Powerful CLI and MCP server for WorkFlowy: reports, search/replace, backup support, and AI integration (Claude, LLMs)
gtm
An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural language.
statamic
AI-powered development tools for Statamic CMS. Provides 100+ MCP tools for blueprints, entries, collections, and more.
israel-drugs
MCP server from DavidOsherdiagnostica/israel-drugs-mcp-server