JaimeCernuda/chronotick-mcp
If you are the rightful owner of chronotick-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
ChronoTick MCP Server provides high-precision time corrections to AI agents using the Model Context Protocol (MCP).
ChronoTick MCP Server
High-precision time services for AI agents via Model Context Protocol
ChronoTick MCP Server provides microsecond-precision time corrections to AI agents through the Model Context Protocol (MCP). It combines advanced time synchronization, machine learning inference, and fast IPC communication to deliver real-time clock corrections with uncertainty quantification.
๐ Quick Start
Prerequisites
- Python 3.10 or later
- uv package manager
- Network access for NTP synchronization
- Linux/macOS (Windows support may require modifications)
Installation
git clone git@github.com:JaimeCernuda/chronotick-mcp.git
cd chronotick-mcp
uv sync
Start the MCP Server
# Basic start
uv run python chronotick_mcp.py
# With debug logging
uv run python chronotick_mcp.py --debug-trace --debug-log-file /tmp/chronotick-debug.log
Connect to Claude Code
claude mcp add chronotick --scope user \
--env PYTHONPATH=$(pwd) \
-- bash -c "cd $(pwd) && $(pwd)/.venv/bin/python chronotick_mcp.py"
๐ฏ Features
Core Capabilities
- Microsecond Precision: Real-time clock corrections with uncertainty bounds
- Fast IPC Communication: Optimized multiprocessing queues for minimal latency
- Machine Learning Integration: TimesFM + Chronos models for predictive time corrections
- Comprehensive Debug Logging: Function tracing, model I/O, and performance metrics
MCP Tools Available to AI Agents
get_time
- Get corrected time with uncertainty boundsget_daemon_status
- Monitor daemon health and performanceget_time_with_future_uncertainty
- Project time uncertainty into the future
Advanced Features
- Quality Control: Rejects poor NTP measurements (configurable thresholds)
- Error Propagation: Proper uncertainty calculation and bounds
- Service Deployment: systemd/launchd configurations included
- Comprehensive Testing: 25+ tests covering all functionality
๐ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ AI Agents โโโโโบโ ChronoTick MCP โโโโโบโ ChronoTick โ
โ (Claude Code) โ โ Server โ โ Daemon โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Fast IPC โ โ ML Pipeline โ
โ (Queues) โ โ (TimesFM + โ
โโโโโโโโโโโโโโโโ โ Chronos) โ
โโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโ
โ NTP Client โ
โ (4 servers) โ
โโโโโโโโโโโโโโโโ
๐ง Configuration
The system uses YAML configuration files with comprehensive settings:
clock_measurement:
ntp:
servers: ['pool.ntp.org', 'time.google.com', 'time.cloudflare.com', 'time.nist.gov']
timeout_seconds: 2.0
max_acceptable_uncertainty: 0.010 # 10ms threshold
timing:
warm_up:
duration_seconds: 180 # 3-minute warmup
measurement_interval: 1.0
๐ Project Structure
chronotick-mcp/
โโโ chronotick_inference/ # Core inference engine
โ โโโ mcp_server.py # MCP server implementation
โ โโโ daemon.py # Background daemon process
โ โโโ real_data_pipeline.py # ML pipeline integration
โ โโโ configs/ # Configuration files
โโโ chronotick_mcp.py # Main entry point
โโโ tests/ # Comprehensive test suite
โ โโโ chronotick/
โ โโโ test_mcp_server.py # MCP functionality tests
โ โโโ test_debug_logging.py # Debug logging tests
โโโ docs/ # Documentation
โ โโโ MCP_DEPLOYMENT_GUIDE.md # Deployment instructions
โ โโโ DEBUG_LOGGING_GUIDE.md # Debug logging guide
โ โโโ ... # Additional guides
โโโ chronotick-5min-debug.log # Example debug output
๐งช Testing
Run the comprehensive test suite:
# All tests
uv run python -m pytest tests/ -v
# MCP server tests only
uv run python -m pytest tests/chronotick/test_mcp_server.py -v
# Debug logging tests
uv run python -m pytest tests/chronotick/test_debug_logging.py -v
Test Coverage: 25/25 tests passing
- 17 MCP server functionality tests
- 8 debug logging system tests
๐ Debug Logging
Enable comprehensive debug tracing for troubleshooting:
# Full debug tracing
uv run python chronotick_mcp.py --debug-trace
# Save debug logs to file
uv run python chronotick_mcp.py --debug-trace --debug-log-file /tmp/debug.log
# Monitor debug output
tail -f /tmp/debug.log
Debug features include:
- Function entry/exit with timing
- Model I/O logging (NumPy arrays, predictions)
- IPC communication monitoring
- Performance metrics and latency tracking
๐ Deployment
Development
uv run python chronotick_mcp.py
Production (systemd)
sudo cp scripts/chronotick-mcp.service /etc/systemd/system/
sudo systemctl enable chronotick-mcp.service
sudo systemctl start chronotick-mcp.service
Production (launchd - macOS)
cp scripts/com.chronotick.mcp.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.chronotick.mcp.plist
๐ Performance
- Typical Response Time: <1ms for time requests
- Warmup Period: 3 minutes for quality NTP measurements
- Memory Usage: 50-200MB depending on model loading
- CPU Usage: Low during normal operation, higher during ML inference
๐ก๏ธ Quality Assurance
The system implements strict quality controls:
- NTP Quality Filtering: Rejects measurements >10ms uncertainty by default
- Error Propagation: Proper uncertainty bounds through all calculations
- Conservative Fallbacks: No predictions with insufficient data quality
- Comprehensive Testing: All edge cases and error conditions covered
๐ Requirements
Runtime Dependencies
mcp>=1.0.0
- Model Context Protocol implementationpydantic>=2.0.0
- Data validation and serializationpydantic-settings
- Configuration managementnumpy
- Numerical computationsPyYAML
- Configuration file parsing
Development Dependencies
pytest>=7.0.0
- Testing frameworkpytest-asyncio>=0.23.0
- Async testing supportpytest-mock
- Mock testing utilities
๐ค Usage with AI Agents
Once connected to Claude Code, you can request:
"Get me the current corrected time with uncertainty bounds"
"Show me the ChronoTick daemon status and performance metrics"
"What will the time uncertainty be in 5 minutes?"
The MCP server will provide high-precision responses with detailed uncertainty quantification.
๐ Related Documentation
- - Complete setup instructions
- - Troubleshooting and monitoring
- - Advanced usage patterns
๐ Troubleshooting
Common Issues
Server fails to start:
- Check Python version:
python --version
(requires 3.10+) - Verify dependencies:
uv sync
- Check network connectivity for NTP access
High latency/poor performance:
- Enable debug logging:
--debug-trace
- Check system resources:
top -p $(pgrep chronotick)
- Verify NTP server connectivity:
ntpdate -q pool.ntp.org
Claude Code connection issues:
- Verify MCP configuration syntax
- Check file permissions on scripts
- Restart Claude Code after configuration changes
๐ License
This project is licensed under the MIT License - see the file for details.
๐ Acknowledgments
- Built on the Model Context Protocol (MCP) specification
- Integrates TimesFM and Chronos time series models
- Uses high-precision NTP synchronization techniques
Need help? Check the or open an issue on GitHub.