temporal-mcp
# temporal-mcp
**Give your AI agent a clock, a stopwatch, and a self-calibrating task duration estimator.**
[](https://www.npmjs.com/package/temporal-mcp)
[](LICENSE)
[](https://modelcontextprotocol.io)
---
## The Problem: AI Agents Are Time-Blind
Your agent doesn't know what time it is. It can't tell how long a task will take. And it has no memory of how long things took last time.
**Existing MCP time servers only solve the first problem** — they let you query the current time. None of them provide:
1. **Task duration estimation** — "How long will this web scraping job take?"
2. **Completion recording** — "That took 4.1 minutes. Remember that."
3. **Self-calibration** — Estimates that get more accurate the more you use them.
`temporal-mcp` solves all three. Zero external APIs. Zero accounts. Fully local SQLite storage.
---
## Install in 60 Seconds
### Claude Desktop
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"temporal": {
"command": "npx",
"args": ["-y", "temporal-mcp"],
"env": {
"TEMPORAL_MCP_DB_PATH": "~/.temporal-mcp/history.db"
}
}
}
}
```
### Cursor
Add to your Cursor MCP settings (`~/.cursor/mcp.json`):
```json
{
"mcpServers": {
"temporal": {
"command": "npx",
"args": ["-y", "temporal-mcp"]
}
}
}
```
### Windsurf
Add to your Windsurf MCP configuration (`~/.codeium/windsurf/mcp_config.json`):
```json
{
"mcpServers": {
"temporal": {
"command": "npx",
"args": ["-y", "temporal-mcp"]
}
}
}
```
Restart your client after adding the config. That's it — no API key, no sign-up.
---
## Three Tools
### 1. `get_current_time` — What time is it?
**Input:**
```json
{
"timezone": "Asia/Taipei",
"format": "iso8601"
}
```
**Output:**
```json
{
"datetime": "2026-04-08T14:30:00+08:00",
"timezone": "Asia/Taipei",
"unix_timestamp": 1744086600,
"utc_offset": "+08:00"
}
```
Supported formats: `iso8601` (default), `unix`, `human`
---
### 2. `estimate_task_duration` — How long will this take?
**Input:**
```json
{
"task_type": "web_scraping",
"complexity": "medium",
"unit": "minutes"
}
```
**Output (with historical data):**
```json
{
"task_type": "web_scraping",
"complexity": "medium",
"estimated_duration": 3.5,
"unit": "minutes",
"confidence": "high",
"data_source": "historical",
"sample_count": 12,
"note": "Based on 12 historical records. Median: 3.2 min, P90: 5.1 min."
}
```
**Output (no historical data yet):**
```json
{
"task_type": "web_scraping",
"complexity": "medium",
"estimated_duration": 5,
"unit": "minutes",
"confidence": "low",
"data_source": "default",
"sample_count": 0,
"note": "No historical records found. Using default estimate. Record completions to improve accuracy."
}
```
Confidence levels:
- `high` — 5+ historical records (uses median)
- `medium` — 1–4 historical records (uses average)
- `low` — no records (uses built-in defaults: low=1min, medium=5min, high=20min)
---
### 3. `record_task_completion` — How long did it actually take?
**Input:**
```json
{
"task_type": "web_scraping",
"actual_duration": 4.1,
"complexity": "medium",
"duration_unit": "minutes",
"metadata": {
"model": "claude-3-5",
"pages_scraped": 42
}
}
```
**Output:**
```json
{
"recorded": true,
"record_id": "rec_20260408_143022_abc123",
"task_type": "web_scraping",
"complexity": "medium",
"actual_duration": 4.1,
"unit": "minutes",
"total_records_for_type": 13,
"updated_median_estimate": 3.3
}
```
---
## The Self-Calibration Loop
Every time you record a completion, the next estimate is more accurate. The loop closes automatically.
```
┌─────────────────────────────────────────────────────────────────┐
│ │
│ estimate_task_duration record_task_completion │
│ "How long will it take?" "It actually took X minutes" │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────┐ ┌────────────────────┐ │
│ │ Query DB │ │ Write to SQLite │ │
│ │ (SQLite) │ │ ~/.temporal-mcp/ │ │
│ └──────┬──────┘ │ history.db │ │
│ │ └──────────┬─────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ SQLite history.db │ │
│ │ task_type | complexity | duration_s | ... │ │
│ └─────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ confidence: "low" → "medium" → "high" │
│ (0 records) (1-4 recs) (5+ recs, uses median) │
│ │
│ Next estimate is more accurate. Repeat. │
│ │
└─────────────────────────────────────────────────────────────────┘
```
Or in Mermaid:
```mermaid
graph LR
A[estimate_task_duration] --> B[Agent runs task]
B --> C[record_task_completion]
C --> D[(SQLite history.db)]
D --> A
D --> |confidence: low → medium → high| A
```
---
## Configuration
| Environment Variable | Default | Description |
|---|---|---|
| `TEMPORAL_MCP_DB_PATH` | `~/.temporal-mcp/history.db` | Path to SQLite database |
The database directory is created automatically on first run.
---
## Roadmap
These features are explicitly out of scope for v1 but planned for future versions:
| Feature | Version |
|---|---|
| HTTP / SSE transport (for remote Agent pipelines) | v2 |
| Visual dashboard for time analytics | v2 |
| Cross-device sync / cloud backup (opt-in) | v3 |
| Team-shared estimation baselines | v3 |
| Google Calendar / scheduling integration | v3 |
| LLM-powered intelligent estimation (with user consent) | TBD |
| `get_timezone_list` helper tool | v2 |
| Cron / scheduled task triggers | TBD |
Have a feature request? [Open an issue](https://github.com/ciphertoact/temporal-mcp/issues).
---
## Local Development
```bash
git clone https://github.com/ciphertoact/temporal-mcp
cd temporal-mcp
npm install
npm run build
node dist/index.js
```
---
## License
MIT — see [LICENSE](LICENSE).
Built by [CiphertoAct](https://github.com/ciphertoact).
TDQS
Scored across 3 tools
Each tool has a clearly distinct role: reading current time, estimating duration, and recording completions. There is no meaningful overlap or risk of misselection between them.
All three names follow a consistent verb_noun pattern: get_current_time, estimate_task_duration, record_task_completion. The convention is predictable and readable.
Three tools are appropriate for this narrowly scoped temporal utility, and each tool supports a distinct part of the estimate-record-calibrate workflow. Nothing feels redundant or excessive.
The core loop of getting time, estimating duration, and recording completions is covered, but there is no way to inspect, list, update, or delete historical records. This creates a notable gap for users who need to audit or manage the data driving estimates.