Date and Time MCP Server

Date and Time MCP Server

A simple Model Context Protocol (MCP) server that provides date and time functionality in any timezone, along with user profiles and personalized greeting resources.

Category
Visit Server

README

Date and Time MCP Server

A simple Model Context Protocol (MCP) server that provides date and time functionality, along with example user profile and greeting resources.

Features

  • Get current date and time in any timezone
  • Access user profiles by ID
  • Get personalized greetings

Installation

  1. Clone this repository
  2. Install dependencies:
pip install -r requirements.txt

Usage

Running the Server

Start the server with:

python src/server.py

The server will start on http://127.0.0.1:8001 with the following endpoints:

  • Tools:
    • current_datetime(timezone: str): Get current date and time in a specific timezone
  • Resources:
    • users://{user_id}/profile: Get a user's profile by ID
    • greeting://{name}: Get a personalized greeting

Running the Client

Run the example client with:

python src/client.py

The client will:

  1. List all available tools
  2. List all available resources
  3. Call the current_datetime tool with "America/New_York" timezone

Cursor Configuration

To use this server with Cursor IDE, you need to configure it in your Cursor settings. Create or update the mcp.json file in your Cursor configuration directory with the following:

{
  "mcpServers": {
    "my-mcp-local-server": {
      "command": "path/to/your/python.exe",
      "args": [
        "path/to/your/server.py"
      ],
      "description": "MCP local server"
    },
    "my-mcp-remote-server": {
      "url": "http://127.0.0.1:8001/mcp",
      "description": "MCP remote server"
    }
  }
}

This configuration provides two ways to connect to the server:

  1. my-mcp-local-server: Runs the server locally through Python
  2. my-mcp-remote-server: Connects to the server running on port 8001

Make sure to replace the paths with your actual Python and server script paths.

Example API Usage

Get Current Time

result = await client.call_tool("current_datetime", {"timezone": "America/New_York"})

Get User Profile

profile = await client.read_resource("users://123/profile")

Get Greeting

greeting = await client.read_resource("greeting://John")

Development

The server is built using FastMCP, which provides a simple way to create MCP-compatible servers. The main components are:

  • server.py: Contains the server implementation with tools and resources
  • client.py: Example client that demonstrates how to interact with the server

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured