{
  "markdown": "# MCP Time Server\n\nA Model Context Protocol (MCP) server providing time-related tools with **dual-mode support**:\n- **Stdio transport** for local MCP clients (via npm)\n- **Streamable HTTP transport** for remote access (via Cloudflare Workers)\n\nThis server allows LLMs to access various date/time functions through multiple connection methods.\n\nMCP Central Server Card: https://guide-gen.mcpcentral.io/servers/io-github-mcpcentral-io-mcp-time  \n\n## Features\n\nProvides the following MCP tools:\n\n*   `current_time`: Get the current date and time in specified formats and timezones.\n*   `relative_time`: Get a human-readable relative time string (e.g., \"in 5 minutes\", \"2 hours ago\").\n*   `days_in_month`: Get the number of days in a specific month.\n*   `get_timestamp`: Get the Unix timestamp (milliseconds) for a given time.\n*   `convert_time`: Convert a time between different IANA timezones.\n*   `get_week_year`: Get the week number and ISO week number for a given date.\n\n## Project Structure\n\n```\nmcp-time/\n├── src/\n│   └── index.ts      # Cloudflare Worker entry point & MCP logic\n├── package.json      # Project dependencies and scripts\n├── tsconfig.json     # TypeScript configuration\n└── wrangler.toml     # Cloudflare Worker configuration\n```\n\n## Installation\n\n### Option 1: Install from npm (Stdio Mode)\n\nInstall the package globally or use with npx:\n\n```bash\n# Global installation\nnpm install -g @mcpcentral/mcp-time\n\n# Or use directly with npx\nnpx @mcpcentral/mcp-time\n```\n\n### Option 2: Use Remote Server (HTTP Mode)\n\nConnect directly to the deployed Cloudflare Worker:  \n  \nExample:\n```\nhttps://mcp.time.mcpcentral.io\n```\n\n## Usage\n\n### Stdio Transport (Local)\n\nConfigure your MCP client (e.g., Claude Desktop) to use the stdio transport:\n\n```json\n{\n  \"mcpServers\": {\n    \"time-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"@mcpcentral/mcp-time\"]\n    }\n  }\n}\n```\n\nOr with global installation:\n```json\n{\n  \"mcpServers\": {\n    \"time-server\": {\n      \"command\": \"/path/to/node/bin/mcp-time\"\n    }\n  }\n}\n```\n\n### Streamable HTTP Transport (Remote)\n\nConfigure your MCP client to use the remote HTTP endpoint:\n\n```json\n{\n  \"mcpServers\": {\n    \"time-server\": {\n      \"url\": \"https://mcp.time.mcpcentral.io\",\n      \"transport\": \"streamable-http\"\n    }\n  }\n}\n```\n\n## Development\n\n1.  **Clone the Repository:**\n    ```bash\n    git clone https://github.com/mcpcentral-io/mcp-time.git\n    cd mcp-time\n    ```\n\n2.  **Install Dependencies:**\n    ```bash\n    npm install\n    ```\n\n3.  **Build:**\n    Compile the TypeScript code:\n    ```bash\n    npm run build\n    ```\n    (This compiles `src/index.ts` to `dist/index.js`)\n\n4.  **Test Locally:**\n\n    **Test Stdio Mode:**\n    ```bash\n    echo '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}}}' | node dist/index.js\n    ```\n\n    **Test HTTP Mode (via Wrangler):**\n    ```bash\n    npx wrangler dev\n    ```\n    This will start the server on `http://localhost:8787`. You can then test with curl or point your MCP client to this local endpoint.\n\n## Deployment\n\n### Deploy to Cloudflare Workers (HTTP Mode)\n\n1. **Configure Cloudflare:**\n   ```bash\n   cp wrangler.toml.example wrangler.toml\n   ```\n   Edit `wrangler.toml` to configure your domain (optional).\n\n2. **Login and Deploy:**\n   ```bash\n   wrangler login\n   npx wrangler deploy\n   ```\n\n### Publish to npm (Stdio Mode)\n\n1. **Build the package:**\n   ```bash\n   npm run build\n   ```\n\n2. **Publish:**\n   ```bash\n   npm publish --access public\n   ```\n\n## Connectors for Streamable HTTP Servers\n\n**NEW**: Major providers have adopted the Model Context Protocol and now support Streamable HTTP servers directly. Anthropic, OpenAI, and Microsoft have all adopted this modern transport protocol.\n\n> **📋 Protocol Note**: Streamable HTTP is the modern replacement for the deprecated HTTP+SSE transport.\n\n#### Anthropic MCP Connector\n\nAnthropic's [MCP Connector](https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector) allows you to use Streamable HTTP servers directly through the Messages API without needing a separate MCP client.\n\nThe MCP Connector is perfect for this server since it uses the Streamable HTTP architecture. Simply include the server in your API requests:\n\n```bash\ncurl https://api.anthropic.com/v1/messages \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $ANTHROPIC_API_KEY\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -H \"anthropic-beta: mcp-client-2025-04-04\" \\\n  -d '{\n    \"model\": \"claude-sonnet-4-20250514\",\n    \"max_tokens\": 1000,\n    \"messages\": [{\n      \"role\": \"user\", \n      \"content\": \"What time is it in Tokyo?\"\n    }],\n    \"mcp_servers\": [{\n      \"type\": \"url\",\n      \"url\": \"https://your.worker.url.workers.dev\",\n      \"name\": \"http-time-server\"\n    }]\n  }'\n```\n\n#### Anthropic MCP Connector Benefits:\n- **No client setup required** - Connect directly through the API\n- **Native Streamable HTTP support** - Designed for servers like this one\n\n#### OpenAI Agents SDK\n\nOpenAI also supports Streamable HTTP servers through their [Agents SDK](https://openai.github.io/openai-agents-python/ref/mcp/server/#agents.mcp.server.MCPServerStreamableHttp) using the `MCPServerStreamableHttp` class:\n\n```python\nfrom agents.mcp.server import MCPServerStreamableHttp\n\n# Connect to this Streamable HTTP server\nserver = MCPServerStreamableHttp({\n    \"url\": \"https://your.worker.url.workers.dev\",\n    \"headers\": {\"Authorization\": \"Bearer your-token\"},  # if needed\n})\n\n# Use the server in your OpenAI agent\nawait server.connect()\ntools = await server.list_tools()\nresult = await server.call_tool(\"current_time\", {\"timezone\": \"Asia/Tokyo\"})\n```\n\n#### Microsoft Copilot Studio\n\nMicrosoft Copilot Studio now supports Streamable HTTP servers with [MCP integration generally available](https://www.microsoft.com/en-us/microsoft-copilot/blog/copilot-studio/model-context-protocol-mcp-is-now-generally-available-in-microsoft-copilot-studio/). You can connect this server to Copilot Studio by:\n\n1. **Building a custom connector** that links your MCP server to Copilot Studio\n2. **Adding the tool in Copilot Studio** by selecting 'Add a Tool' and searching for your MCP server\n3. **Using the server directly** in your agents with generative orchestration enabled\n\n#### More MCP Clients Coming Soon\n\nKeep an eye out as more MCP clients adopt support for Streamable HTTP. Here are a few resources that maintain lists of MCP clients and their capabilities:\n\n- [PulseMCP Client Directory](https://www.pulsemcp.com/clients) - Comprehensive list of MCP clients\n- [Official MCP Servers Repository](https://github.com/modelcontextprotocol/servers) - Official collection including client information\n- [MCP.so Client Listings](https://mcp.so/?tab=clients) - Community-maintained client directory\n\n## Testing and Validation\n\n### MCP Inspector Tools (HTTP Mode)\n\nTest your server using these web-based inspection tools:\n\n#### MCPCentral Tools (Recommended)\n\n- **[MCPCentral Lab](https://lab.mcpcentral.io/)** - Interactive testing environment for MCP servers\n- **[MCPCentral Inspector](https://inspect.mcpcentral.io/)** - Streamable HTTP server inspector\n\n#### Official MCP Inspector\n\nThe official [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is also available:\n- Visit: https://github.com/modelcontextprotocol/inspector\n- Or run: `npx @modelcontextprotocol/inspector`\n\n#### Testing Steps\n\n1. **Start your server:**\n   ```bash\n   # Local HTTP server\n   npx wrangler dev\n\n   # Or use deployed URL: https://mcp.time.mcpcentral.io\n   ```\n\n2. **Connect with an inspector:**\n   - Transport: **Streamable HTTP**\n   - URL: `http://localhost:8787` or `https://mcp.time.mcpcentral.io`\n   - Click **Connect**\n\n### Command Line Testing (Stdio Mode)\n\nTest the stdio transport directly:\n\n```bash\n# Test initialization\necho '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"test\",\"version\":\"1.0\"}}}' | npx @mcpcentral/mcp-time\n\n# Test tool call\necho '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"current_time\",\"arguments\":{\"timezone\":\"America/New_York\"}}}' | npx @mcpcentral/mcp-time\n```\n\n### Available Tools to Test\n\nThe inspector will show all six time-related tools:\n\n- **`current_time`**: Test with different timezones (e.g., \"America/New_York\", \"Europe/London\")\n- **`relative_time`**: Test with various time strings (e.g., \"2024-12-25T00:00:00Z\")\n- **`days_in_month`**: Test with different months and years\n- **`get_timestamp`**: Convert date-time strings to Unix timestamps\n- **`convert_time`**: Convert between different timezones\n- **`get_week_year`**: Get week numbers for specific dates\n\n### Example Test Cases\n\nTry these test cases in the inspector:\n\n```json\n// current_time\n{\"timezone\": \"Asia/Tokyo\", \"format\": \"iso\"}\n\n// relative_time  \n{\"time\": \"2024-12-25T00:00:00Z\"}\n\n// days_in_month\n{\"month\": 2, \"year\": 2024}\n\n// get_timestamp\n{\"time\": \"2024-06-15T12:00:00Z\"}\n\n// convert_time\n{\"time\": \"2024-06-15T12:00:00\", \"from\": \"UTC\", \"to\": \"America/Los_Angeles\"}\n\n// get_week_year\n{\"date\": \"2024-06-15\"}\n```\n\n### Validation Checklist\n\nUse the inspector to verify:\n\n- ✅ Server connects successfully\n- ✅ All 6 tools are listed\n- ✅ Tool schemas are properly defined\n- ✅ Tools execute without errors\n- ✅ Results are formatted correctly\n- ✅ Error handling works for invalid inputs\n\nThe MCP Inspector provides the most comprehensive way to test your server before integrating it with AI clients.\n\n---\n\n## Authentication & Security Considerations\n\n⚠️ **IMPORTANT: This example server has NO authentication or security measures implemented.**\n",
  "bytes": 9659,
  "sha": "8ad069420eeca19801616ec6d3c170bc4a1f1757067adc104a6135f3484ff73a",
  "repo_slug": "mcpcentral-io/mcp-time",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_mcpcentral_io_mcp_time_8efe9799/readme"
}