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.
Описание
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:
- get_military_time - Returns the current time in military format (HHMMSS) along with the current date
- get_time_only - Returns just the current time in military format (HHMMSS) without the date
Installation
- Clone this repository
- Install dependencies:
npm install - 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
- Build and Run: Press
Ctrl+Shift+P→Tasks: Run Task→Build and Start MCP Server - Debug: Press
F5to start debugging with breakpoints - 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
Install MCP Extensions (if not already installed):
Ctrl+Shift+P → Extensions: Show Recommended ExtensionsInstall: Copilot MCP, MCP4Humans, or MCP Inspector
Configure the Server in VS Code:
- The server is already configured in
.vscode/mcp.json - Build and start the server:
Ctrl+Shift+P→Tasks: Run Task→Start MCP Server
- The server is already configured in
Connect via MCP Extensions:
- Open Command Palette:
Ctrl+Shift+P - Run:
MCP: Connect to Serveror similar (depends on extension) - Point to your local server or use the pre-configured settings
- Open Command Palette:
Method 2: Direct Integration
For AI agents that support MCP directly:
Build the server:
npm run buildConfigure the agent to use this MCP server:
{ "mcpServers": { "military-time": { "command": "node", "args": ["/home/john/mcp-test/build/index.js"] } } }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:
Start server in background:
npm run build nohup node build/index.js > /dev/null 2>&1 &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
Server not responding:
# Test server locally first npm testConnection issues:
# Check if server is running ps aux | grep "node.*index.js" # Restart server npm run devDebug 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:
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
- Open VS Code in WSL:
Verify correct shell:
- Check that tasks use
/bin/bash(already configured in.vscode/tasks.json) - Terminal should show Linux path:
/home/john/mcp-test
- Check that tasks use
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/JavaScriptzod- Schema validationtypescript- TypeScript compiler
License
ISC
Установить Military Time Server в Claude Desktop, Claude Code, Cursor
unyly install military-time-mcp-serverСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add military-time-mcp-server -- npx -y mcp-testFAQ
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
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Military Time Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
