windows-context-mcp
Windows Context MCP ๐ชโก
Windows Context MCP is a high-performance, native Windows service, Model Context Protocol (MCP) server, and Unified Personal Context Hub connecting Windows desktop activity and Android mobile telemetry directly into conversational AI assistants like Google Gemini, OpenAI ChatGPT, and Claude.
๐ Features & Architecture
๐๏ธ Zero-Dependency SQLite Time-Series (
src/db.ts): Built on nativenode:sqlitefor persistent indexed focus sessions, 24-hour hourly distributions, and multi-day range analytics.๐ฑ Unified Cross-Device Hub (
src/aggregator.ts): Ingests Android screen time and telemetry via/api/sync, calculating combined multi-device screen time, cross-device top applications, and device fleet health.๐ Dual Protocol Transports:
Streamable HTTP / JSON-RPC 2.0 (
src/server.ts): Remote MCP gateway on port3001for Google Gemini & ChatGPT Custom GPT Actions.Native STDIO Transport (
src/stdio.ts): Standard I/O stream for Claude Desktop, Cursor, and local CLI agents (node dist/index.js --stdio).
๐ช Native Win32 API Queries (
src/collector.ts): Direct User32 / CIM queries for active window titles, process binaries, CPU delta utilization, RAM usage, user idle detection, and battery telemetry.๐งช Comprehensive Test Suite: 23 automated unit and integration tests across SQLite database, cross-device aggregation, and tool executions (
npm test).
๐ ๏ธ MCP Tools Reference (15 Tools)
Tool Name | Type | Description |
| Real-time | Full real-time snapshot: active window, screen time, CPU/RAM telemetry, battery. |
| Real-time | Focused foreground window title, process name, and category. |
| Aggregation | Today's PC screen time categorized by Productive, Entertainment, Communication, Browsing. |
| Telemetry | CPU load %, RAM total/free/used %, battery charge %, and AC state. |
| Analytics | Automated productivity score (0-100), balance ratio, and top distraction apps. |
| Search | Search application usage history today by process or window title query. |
| Presence | User presence & idle duration (detects if user is actively typing or away). |
| Chain | Chronological sequence of recent window and application switches. |
| Diagnostics | System resource health check, memory pressure level, and uptime. |
| Analytics | Identifies entertainment and distraction apps consuming the most time today. |
| Historical | 24-hour timeline of productive vs entertainment minutes per hour for any date. |
| Historical | Multi-day productivity scores, duration trends, and top apps across a date range. |
| Cross-Device | Combined snapshot merging PC desktop activity with synced Android phone context. |
| Cross-Device | Total combined screen time across PC and mobile with device breakdown. |
| Cross-Device | Lists all connected devices (Windows PC + Android phones) with sync status. |
๐ Quick Start
1. Run via NPX (1-Click Execution)
npx windows-context-mcp --stdio2. Build & Test Locally
npm install
npm test
npm run build
npm startHTTP server starts on port 3001 with endpoint http://localhost:3001/mcp and live UI at http://localhost:3001.
๐ AI Assistant Setup
Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json)
{
"mcpServers": {
"windowsContext": {
"command": "node",
"args": ["C:/Users/smnk2/.gemini/antigravity/scratch/windows-context-mcp/dist/index.js", "--stdio"]
}
}
}Google Gemini / ChatGPT (HTTP Mode)
{
"mcpServers": {
"windowsContext": {
"url": "http://localhost:3001/mcp",
"transport": "http"
}
}
}๐ License
MIT License.