Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Military Time Server

БесплатноНе проверен

Provides current time in military format (HHMMSS) with or without date. Enables AI agents to retrieve precise military time via MCP tools.

GitHubEmbed

Описание

Provides current time in military format (HHMMSS) with or without date. Enables AI agents to retrieve precise military time via MCP tools.

README

A simple Model Context Protocol (MCP) server that provides the current time in military format.

Features

This MCP server provides two tools:

  1. get_military_time - Returns the current time in military format (HHMMSS) along with the current date
  2. get_time_only - Returns just the current time in military format (HHMMSS) without the date

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    

Opening in VS Code

For the best development experience, especially on Windows with WSL:

Option 1: Use the Workspace File (Recommended)

code mcp-test.code-workspace

Option 2: Open the Folder Directly

code .

The workspace file (mcp-test.code-workspace) provides:

  • Proper WSL path mapping
  • Pre-configured tasks and debug settings
  • All VS Code settings in one place
  • Simplified configuration management

Usage

Development in VS Code

This project is fully configured for VS Code development:

Quick Start

  1. Build and Run: Press Ctrl+Shift+PTasks: Run TaskBuild and Start MCP Server
  2. Debug: Press F5 to start debugging with breakpoints
  3. Test: Run `npm test
This runs a built-in test client that sends sample MCP requests to your server.

### Monitoring Logs

#### VS Code Development
- Use the integrated terminal and debug console
- Set breakpoints and step through code with `F5`

#### External Clients (Claude Desktop)
```bash
# Monitor logs in real-time
./monitor-logs.sh

# Or manually on macOS
tail -f ~/Library/Application\ Support/Claude/mcp*.log

# Or manually on Windows
tail -f %APPDATA%\Claude\mcp*.log

Tools Available` to test with built-in client

Recommended Extensions

Install the recommended extensions by opening the Command Palette (Ctrl+Shift+P) and running Extensions: Show Recommended Extensions:

  • Copilot MCP - Manage MCP servers in VS Code
  • MCP4Humans - User-friendly MCP client interface
  • MCP Inspector - Debug and inspect MCP servers

Available Tasks

  • Build - Compile TypeScript code
  • Start MCP Server - Run server in background
  • Debug MCP Server - Run with Node.js inspector
  • Test MCP Server Locally - Test with sample requests

See DEVELOPMENT.md for detailed VS Code development guide.

Running the Server

To start the MCP server:

npm start

Or for development:

npm run dev

Connecting to Claude Desktop

To use this server with Claude Desktop, add the following configuration to your claude_desktop_config.json:

macOS/Linux:

{
  "mcpServers": {
    "military-time": {
      "command": "node",
      "args": ["/absolute/path/to/your/project/build/index.js"]
    }
  }
}

Windows:

{
  "mcpServers": {
    "military-time": {
      "command": "node",
      "args": ["C:\\absolute\\path\\to\\your\\project\\build\\index.js"]
    }
  }
}

Replace /absolute/path/to/your/project with the actual absolute path to this project directory.

Connecting to AI Agents (VS Code Copilot, etc.)

To use this server with AI agents like GitHub Copilot or other VS Code-based AI assistants:

Method 1: Using VS Code MCP Extensions

  1. Install MCP Extensions (if not already installed):

    Ctrl+Shift+P → Extensions: Show Recommended Extensions
    

    Install: Copilot MCP, MCP4Humans, or MCP Inspector

  2. Configure the Server in VS Code:

    • The server is already configured in .vscode/mcp.json
    • Build and start the server: Ctrl+Shift+PTasks: Run TaskStart MCP Server
  3. Connect via MCP Extensions:

    • Open Command Palette: Ctrl+Shift+P
    • Run: MCP: Connect to Server or similar (depends on extension)
    • Point to your local server or use the pre-configured settings

Method 2: Direct Integration

For AI agents that support MCP directly:

  1. Build the server:

    npm run build
    
  2. Configure the agent to use this MCP server:

    {
      "mcpServers": {
        "military-time": {
          "command": "node",
          "args": ["/home/john/mcp-test/build/index.js"]
        }
      }
    }
    
  3. Test the connection:

    # Verify server works
    npm test
    
    # Monitor for connections
    ./monitor-logs.sh
    

Method 3: Running in Background

To keep the server running for multiple agent connections:

  1. Start server in background:

    npm run build
    nohup node build/index.js > /dev/null 2>&1 &
    
  2. Or use VS Code task:

    Ctrl+Shift+P → Tasks: Run Task → Start MCP Server
    

Available Tools for AI Agents

Once connected, AI agents can use these tools:

  • get_military_time - Get current time in military format with date

    • Example: "What's the current military time?"
    • Returns: "Current military time: 093816 on 2025-07-23"
  • get_time_only - Get just the military time without date

    • Example: "Give me just the military time"
    • Returns: "Military time: 093816"

Troubleshooting Agent Connections

  1. Server not responding:

    # Test server locally first
    npm test
    
  2. Connection issues:

    # Check if server is running
    ps aux | grep "node.*index.js"
    
    # Restart server
    npm run dev
    
  3. Debug mode:

    # Run with debugging
    node --inspect=9229 build/index.js
    

WSL (Windows Subsystem for Linux) Users

If you're using WSL and encountering UNC path errors:

  1. Ensure VS Code is using WSL terminal:

    • Open VS Code in WSL: code . from your WSL terminal
    • Or install "WSL" extension and open folder in WSL container
  2. Verify correct shell:

    • Check that tasks use /bin/bash (already configured in .vscode/tasks.json)
    • Terminal should show Linux path: /home/john/mcp-test
  3. If still having issues:

    # Run commands directly in WSL terminal
    npm run build
    npm test
    npm start
    

Configuration File Locations

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: Use MCP client or other compatible tools

Tools Available

get_military_time

  • Description: Get the current time in military format with date
  • Parameters: None
  • Returns: Current military time (HHMMSS) and date (YYYY-MM-DD)

get_time_only

  • Description: Get just the current time in military format
  • Parameters: None
  • Returns: Current military time (HHMMSS) only

Example Usage with AI Agents

Once your AI agent is connected to this MCP server, you can ask questions like:

User: "What's the current military time?" Agent Response: "Current military time: 093816 on 2025-07-23"

User: "Give me just the time in military format"
Agent Response: "Military time: 093816"

User: "What time is it now?" Agent Response: [Agent calls get_military_time tool] "The current military time is 093816 (9:38:16 AM) on July 23, 2025."

The AI agent will automatically choose the appropriate tool based on your request and provide a natural language response using the military time data from your server.

Development

Building

npm run build

File Structure

├── src/
│   └── index.ts          # Main server implementation
├── build/                # Compiled JavaScript (generated)
├── .github/
│   └── copilot-instructions.md
├── package.json
├── tsconfig.json
└── README.md

Dependencies

  • @modelcontextprotocol/sdk - MCP SDK for TypeScript/JavaScript
  • zod - Schema validation
  • typescript - TypeScript compiler

License

ISC

from github.com/jdillick/mcp-test

Установка Military Time Server

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/jdillick/mcp-test

FAQ

Military Time Server MCP бесплатный?

Да, Military Time Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Military Time Server?

Нет, Military Time Server работает без API-ключей и переменных окружения.

Military Time Server — hosted или self-hosted?

Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.

Как установить Military Time Server в Claude Desktop, Claude Code или Cursor?

Открой Military Time Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Military Time Server with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории ai