Skip to main content
Glama
Seey215

Now MCP

by Seey215
README.md
# Now MCP

A Model Context Protocol (MCP) server that provides time-related tools and resources for Claude and other MCP clients.

## Features

### Tools

1. **get-current-time** - Get the current date and time in various formats
   - Supports ISO, Unix timestamp, local, and UTC formats
   - Optional timezone specification

2. **convert-timezone** - Convert time between different timezones
   - Convert from one timezone to another
   - Multiple output formats supported

3. **format-time** - Format time according to specified patterns and locales
   - Custom format patterns
   - Locale-specific formatting
   - Timezone-aware formatting

4. **get-timezone-info** - Get detailed information about a timezone
   - Timezone name and offset
   - Current time in the specified timezone

### Resources

1. **time://current** - Current time in ISO format
2. **time://timezone/{timezone}** - Current time in a specific timezone
3. **time://timezones** - List of common timezone identifiers

## Installation

```bash
npm install now-mcp
```

## Usage

### With Claude Desktop

Add to your Claude Desktop configuration:

```json
{
  "mcpServers": {
    "time-server": {
      "command": "npx",
      "args": ["-y", "now-mcp"]
    }
  }
}
```

### Direct Usage

```bash
# Install dependencies
npm install

# Build the project
npm run build

# Run the server
npm start
```

### Development

```bash
# Install dependencies
npm install

# Run in development mode
npm run dev
```

## Examples

### Get Current Time

```typescript
// Get current time in ISO format
await callTool("get-current-time", {});

// Get current time in a specific timezone
await callTool("get-current-time", {
  format: "local",
  timezone: "America/New_York"
});
```

### Convert Timezone

```typescript
await callTool("convert-timezone", {
  datetime: "2025-09-11T10:30:00Z",
  fromTimezone: "UTC",
  toTimezone: "Asia/Tokyo",
  format: "local"
});
```

### Format Time

```typescript
await callTool("format-time", {
  datetime: "2025-09-11T10:30:00Z",
  locale: "en-US",
  timezone: "America/New_York"
});
```

### Get Timezone Information

```typescript
await callTool("get-timezone-info", {
  timezone: "Europe/London"
});
```

## Supported Timezones

The server supports all standard IANA timezone identifiers. Common examples include:

- UTC
- America/New_York
- America/Chicago
- America/Denver
- America/Los_Angeles
- Europe/London
- Europe/Paris
- Europe/Berlin
- Asia/Tokyo
- Asia/Shanghai
- Asia/Kolkata
- Australia/Sydney
- Pacific/Auckland

## API Reference

### Tools

#### get-current-time

Get the current date and time.

**Parameters:**
- `format` (optional): Output format - "iso", "unix", "local", or "utc" (default: "iso")
- `timezone` (optional): Timezone identifier (e.g., "America/New_York")

#### convert-timezone

Convert time between timezones.

**Parameters:**
- `datetime`: Date and time to convert (ISO format or parseable string)
- `fromTimezone`: Source timezone identifier
- `toTimezone`: Target timezone identifier
- `format` (optional): Output format - "iso", "local", or "utc" (default: "local")

#### format-time

Format time according to specified pattern and locale.

**Parameters:**
- `datetime`: Date and time to format (ISO format or parseable string)
- `format` (optional): Format pattern (default: "YYYY-MM-DD HH:mm:ss")
- `locale` (optional): Locale for formatting (default: "en-US")
- `timezone` (optional): Timezone for formatting

#### get-timezone-info

Get information about a timezone.

**Parameters:**
- `timezone`: Timezone identifier

### Resources

#### time://current

Returns the current time in ISO format.

#### time://timezone/{timezone}

Returns the current time in the specified timezone.

**Parameters:**
- `timezone`: Timezone identifier (URL parameter)

#### time://timezones

Returns a JSON list of common timezone identifiers.

## License

MIT

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Support

For issues and questions, please open an issue on the GitHub repository.