windows-context-mcp
Enables AI agents to access real-time Windows PC context including active window, system performance, screen time, productivity analytics, and historical usage through MCP tools.
README
Windows Context MCP ๐ชโก
Windows Context MCP is a high-performance, native backend service and Model Context Protocol (MCP) server for Windows. It exposes real-time PC activity, focused foreground application telemetry, system resource stats, and historical productivity analytics to AI agents like Google Gemini, OpenAI ChatGPT, and Claude.
๐ Backend Features & Architecture
- ๐๏ธ Zero-Dependency SQLite Time-Series Engine (
src/db.ts): Built on nativenode:sqlitefor high-throughput persistence, indexed minute-by-minute focus session recording, and fast historical aggregations. - ๐ Dual Transport Support:
- Streamable HTTP / JSON-RPC 2.0 (
src/server.ts): REST + JSON-RPC on port3001for remote AI assistants (Gemini remote MCP & ChatGPT Actions). - Native STDIO Transport (
src/stdio.ts): Fast standard I/O stream for Claude Desktop, Cursor, and local CLI agents (node dist/index.js --stdio).
- Streamable HTTP / JSON-RPC 2.0 (
- ๐ช Win32 Native Interop (
src/collector.ts): Direct User32 / CIM queries for active window titles, process binaries, CPU delta utilization, RAM usage, user idle detection, and battery telemetry. - ๐ Advanced Productivity & Transition Tracking (
src/tracker.ts): Hourly breakdown curves, 24-hour timelines, transition chains, and multi-day date range analytics. - ๐งช Automated Test Suite: 17 unit and integration tests across storage, telemetry, and tools (
npm test).
๐ ๏ธ MCP Tools Reference (12 Tools)
| Tool Name | Type | Description |
|---|---|---|
get_current_windows_context |
Real-time | Full real-time snapshot: active window, screen time, CPU/RAM telemetry, battery. |
get_active_window |
Real-time | Focused foreground window title, process name, and category. |
get_pc_screen_time |
Aggregation | Today's screen time categorized by Productive, Entertainment, Communication, Browsing. |
get_pc_performance |
Telemetry | CPU load %, RAM total/free/used %, battery charge %, and AC state. |
get_productivity_score |
Analytics | Automated productivity score (0-100), balance ratio, and top distraction apps. |
search_window_history |
Search | Search application usage history today by process or window title query. |
get_idle_status |
Presence | User presence & idle duration (detects if user is actively typing or away). |
get_recent_transitions |
Chain | Chronological sequence of recent window and application switches. |
get_system_health |
Diagnostics | System resource health check, memory pressure level, and uptime. |
get_top_distractions |
Analytics | Identifies entertainment and distraction apps consuming the most time today. |
get_hourly_breakdown |
Historical | 24-hour timeline of productive vs entertainment minutes per hour for any date. |
get_historical_usage |
Historical | Multi-day productivity scores, duration trends, and top apps across a date range. |
๐ Quick Start
1. Build
npm install
npm run build
2. Run Tests
npm test
3. Run Backend in HTTP Mode (for Gemini & ChatGPT)
npm start
HTTP server starts on port 3001 with endpoint http://localhost:3001/mcp.
4. Run Backend in STDIO Mode (for Claude Desktop & Local MCP Clients)
node dist/index.js --stdio
๐ Claude Desktop Configuration (claude_desktop_config.json)
{
"mcpServers": {
"windowsContext": {
"command": "node",
"args": ["C:/Users/smnk2/.gemini/antigravity/scratch/windows-context-mcp/dist/index.js", "--stdio"]
}
}
}
๐ Google Gemini Configuration
{
"mcpServers": {
"windowsContext": {
"url": "http://localhost:3001/mcp",
"transport": "http"
}
}
}
๐ License
MIT License.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.