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.

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

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

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

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

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

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

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

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

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

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

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

  • zhaoyunxing92
  • 本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。

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

  • justmywyw
  • Short and sweet example MCP server / client implementation for Tools, Resources and Prompts.

    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.