Cover image
Try Now
2025-03-27

Un serveur MCP simple qui fournit un service de l'heure actuelle

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Serveur MCP Simple pour Service d'Heure

Ce dépôt contient un serveur MCP (Method Call Protocol) simple qui fournit un service pour obtenir l'heure actuelle. Le serveur implémente le protocole JSON-RPC 2.0 pour les appels de méthode.

Installation

# Cloner le dépôt
git clone https://github.com/Anragde/simple-time-mcp-server.git
cd simple-time-mcp-server

# Installer les dépendances
npm install

Démarrage du serveur

# Démarrer en mode développement (avec hot reload)
npm run dev

# Démarrer en mode production
npm start

Le serveur démarre par défaut sur le port 3000, mais vous pouvez le configurer en définissant la variable d'environnement PORT.

Méthodes disponibles

Le serveur expose les méthodes suivantes via l'endpoint /mcp :

1. getCurrentTime

Retourne l'heure actuelle dans le format spécifié.

Paramètres :

  • format (optionnel) : Format de l'heure (utilise le format de moment.js). Par défaut: 'YYYY-MM-DD HH:mm:ss'

Exemple de requête :

{
  "jsonrpc": "2.0",
  "method": "getCurrentTime",
  "params": {
    "format": "HH:mm:ss"
  },
  "id": 1
}

Exemple de réponse :

{
  "jsonrpc": "2.0",
  "result": {
    "time": "14:30:45",
    "timestamp": 1616929845123
  },
  "id": 1
}

2. getTimeInTimezone

Retourne l'heure actuelle dans le fuseau horaire spécifié.

Paramètres :

  • timezone (requis) : Le fuseau horaire (ex: 'Europe/Paris', 'America/New_York')
  • format (optionnel) : Format de l'heure. Par défaut: 'YYYY-MM-DD HH:mm:ss'

Exemple de requête :

{
  "jsonrpc": "2.0",
  "method": "getTimeInTimezone",
  "params": {
    "timezone": "Europe/Paris",
    "format": "ddd, DD MMM YYYY HH:mm:ss"
  },
  "id": 2
}

Exemple de réponse :

{
  "jsonrpc": "2.0",
  "result": {
    "time": "Mon, 28 Mar 2025 14:30:45",
    "timezone": "Europe/Paris",
    "timestamp": 1616929845123
  },
  "id": 2
}

Vérification de l'état du serveur

Un endpoint de vérification d'état est disponible à /health. Il peut être utilisé pour surveiller si le serveur fonctionne correctement.

Exemple de requête :

curl http://localhost:3000/health

Exemple de réponse :

{
  "status": "ok", 
  "timestamp": 1616929845123
}

Licence

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • jae-jae
  • MCP server for fetch web page content using Playwright headless browser.

    Reviews

    2 (1)
    Avatar
    user_w1QJTsuH
    2025-04-16

    Mcp Server is an outstanding product by d747d that has significantly improved my server management experience. Its intuitive interface and reliable performance make it a must-have tool for any server administrator. The seamless integration and robust features ensure that my servers are always running smoothly and efficiently. Highly recommend! For more information, visit https://mcp.so/server/mcp-server/d747d.