MCP cover image
See in Github
2025-03-27

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

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.

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

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

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

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

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

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

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

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

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

  • 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

  • modelcontextprotocol
  • Model Context Protocol Servers

  • Mintplex-Labs
  • The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.

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

    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.