Time & Location MCP Server
# Time & Location MCP Server
An MCP (Model Context Protocol) server that automatically detects and provides your current time and location information.
## Features
- **Auto-detection**: Automatically detects your system timezone and location
- `get_current_time`: Returns current date/time in your local timezone
- `get_location`: Returns your location based on IP geolocation
## Setup & Running
### Using Docker Compose
```bash
# Build and run (will auto-detect timezone and location)
docker-compose up --build
# Run in background
docker-compose up -d
# Override location if needed
CITY="Seattle" PROVINCE="WA" COUNTRY="USA" docker-compose up
```
### Manual Docker Build
```bash
# Build image
docker build -t time-mcp-server .
# Run with timezone mounting
docker run -it \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
time-mcp-server
```
## MCP Client Configuration
### For Cursor
1. Open Cursor Settings (Cmd+, on Mac or Ctrl+, on Windows/Linux)
2. Search for "Model Context Protocol" or navigate to Features > Beta
3. Enable MCP if not already enabled
4. Add this configuration:
```json
{
"mcpServers": {
"time-location": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/etc/localtime:/etc/localtime:ro",
"-v", "/etc/timezone:/etc/timezone:ro",
"time_mcp-time-mcp-server"
]
}
}
}
```
### For Zed
1. Open Zed settings (Cmd+, on Mac)
2. Add to your settings.json:
```json
{
"assistant": {
"version": "2",
"provider": {
"name": "anthropic"
},
"mcp": {
"servers": {
"time-location": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/etc/localtime:/etc/localtime:ro",
"-v", "/etc/timezone:/etc/timezone:ro",
"time_mcp-time-mcp-server"
]
}
}
}
}
}
```
Note: Make sure the Docker container is built first with `docker-compose build`
## Tools Available
1. **get_current_time**
- Automatically detects your system timezone
- Returns current time with timezone info
- Includes ISO format, Unix timestamp, and UTC offset
2. **get_location**
- Uses IP-based geolocation (requires internet)
- Falls back to environment variables if set
- Returns city, province/state, country, and coordinates
## Environment Variables (Optional)
Override auto-detection by setting these variables:
- `TZ`: Timezone (e.g., "America/New_York")
- `CITY`: Your city
- `PROVINCE`: Your province/state
- `COUNTRY`: Your country
- `LATITUDE`: Latitude coordinate
- `LONGITUDE`: Longitude coordinateTDQS
Scored across 2 tools
The two tools have completely distinct purposes: one retrieves time information, while the other retrieves location information. There is no overlap or ambiguity between them, making it easy for an agent to select the correct tool based on the need.
Both tools follow a consistent verb_noun naming pattern (get_current_time and get_location) using snake_case. This uniformity makes the tool set predictable and easy to understand at a glance.
With only two tools, the server feels thin for a combined 'Time & Location' domain. While each tool is clear, the scope suggests more operations could be included, such as timezone conversions or location-based services, making the current count insufficient for comprehensive coverage.
The tool set is severely incomplete for the stated 'Time & Location' domain. It lacks essential operations like converting timezones, setting alarms, getting weather based on location, or calculating distances, leaving significant gaps that could cause agent failures in broader tasks.