Skip to content

Add Call History service#157

Open
bratland wants to merge 2 commits intomattt:mainfrom
bratland:feat/call-history-service
Open

Add Call History service#157
bratland wants to merge 2 commits intomattt:mainfrom
bratland:feat/call-history-service

Conversation

@bratland
Copy link
Copy Markdown

Summary

  • Adds a new Call History MCP service that reads phone call logs from ~/Library/Application Support/CallHistoryDB/CallHistory.storedata
  • Exposes callhistory_fetch tool with filtering by participant, date range, and call type (incoming/outgoing/missed)
  • Follows the same architecture patterns as the existing Messages service (SQLite, bookmark persistence, file picker)

Details

The macOS CallHistory database is synced from iPhone and contains all call records. This service:

  • Reads directly via SQLite3 (read-only)
  • Converts Apple's Core Data epoch timestamps (2001-01-01) to ISO 8601
  • Returns schema.org ItemList format with phone number, call type, date, duration, and service provider
  • Supports security-scoped bookmarks for sandboxed access
  • Registered in ServiceRegistry with phone icon and toggle in the UI

Test plan

  • Build and launch iMCP
  • Verify "Call History" appears as a new toggleable service
  • Enable the service and grant access to CallHistory.storedata
  • Test callhistory_fetch with no filters (returns recent calls)
  • Test filtering by participant, date range, and call type
  • Verify correct timestamp conversion and duration formatting

🤖 Generated with Claude Code

bratland and others added 2 commits March 26, 2026 10:45
Adds a new MCP service that reads the macOS CallHistory database
(synced from iPhone) at ~/Library/Application Support/CallHistoryDB/
CallHistory.storedata. Exposes a callhistory_fetch tool with filtering
by participant, date range, and call type (incoming/outgoing/missed).

Follows the same patterns as the existing Messages service: direct
SQLite access, security-scoped bookmark persistence, and file picker
fallback for sandboxed environments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CallHistory: Use ZADDRESS and ZNAME columns directly from ZCALLRECORD
  instead of JOINing on a non-existent ZHANDLE foreign key. The macOS
  CallHistory database stores phone numbers inline, not via a handle table.
- CallHistory: Include contact name in results when available.
- CLI: Add successTerminationBehavior: .gracefullyShutdownGroup to prevent
  ServiceGroup from crashing with a fatal error on normal disconnect.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant