AFK Mode
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AFK Mode show me the QR code to pair my phone"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AFK Mode
Monitor and respond to VS Code Copilot from your phone.
When Copilot's agent mode runs long tasks, it frequently pauses for user input. If you step away, the session stalls. AFK Mode bridges Copilot and your phone through an MCP server — so you can watch progress, get notifications, and respond to prompts without being at your desk.
Quick Start
One-command setup
Run this in your project folder:
npx afk-mode-mcp --setupThis creates .vscode/mcp.json and .github/prompts/afk-workflow.prompt.md — done. Copilot will start AFK Mode automatically when it needs it.
Usage
Ask Copilot: "Show me the AFK app link" → scan the QR code on your phone
Toggle AFK Mode on in the app
Start a task with
/afk-workflow— Copilot routes all progress and decisions to your phone
Push notifications work automatically — no extra setup needed.
Manual setup (alternative)
If you prefer to configure manually, add this to .vscode/mcp.json in your workspace:
{
"servers": {
"afk-mode-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "afk-mode-mcp"],
"env": {
"AFK_PORT": "7842"
}
}
}
}Related MCP server: CloudZIR MCP Server
How It Works
AFK Mode is a single Node.js process that serves two roles simultaneously:
MCP Server (stdio) — Exposes tools that Copilot calls to report progress and request decisions
Web App Server (HTTP + WebSocket) — Serves a React PWA and maintains a real-time connection with your phone
┌──────────────┐ stdio ┌──────────────────────┐ WebSocket ┌──────────────┐
│ VS Code │◄──────────────►│ MCP + Web Server │◄────────────────►│ Mobile Web │
│ Copilot │ │ (single process) │ HTTP (static) │ App (PWA) │
│ Agent Mode │ │ │◄────────────────►│ │
└──────────────┘ └──────────────────────┘ └──────────────┘Copilot starts the MCP server → HTTP/WebSocket server starts automatically on port 7842
Ask Copilot "Show me the AFK app link" → it calls
get_current_web_app_urland renders a QR codeScan the QR code on your phone → the PWA connects via WebSocket
Toggle AFK Mode on in the app → Copilot routes interactions through your phone
Copilot sends progress updates and decision prompts to your phone in real time
Toggle AFK Mode off → Copilot goes back to the normal VS Code chat panel
MCP Tools
The server exposes 4 tools to Copilot:
Tool | Purpose |
| Returns the connection URL + QR code for pairing your phone |
| Checks if AFK mode is on and a client is connected |
| Sends a progress update to the phone (info, warning, error, success, milestone) |
| Asks the user a question and blocks until they respond (confirm, choice, text, or diff review) |
notify_session_progress
Sends real-time progress to the phone. Categories control the icon and urgency:
info — general status (ℹ️)
success — task completed (✅)
error — something failed (❌)
milestone — significant achievement (🎯)
warning — needs attention (⚠️)
Supports optional progress bars ({ current, total, label }) and file change lists.
get_user_decision
Blocks Copilot until the user responds on their phone. Decision types:
confirm — Yes/No
choice — Pick from a list of options
text — Free-form text input
diff — Review a code diff and approve/reject
Includes a configurable timeout (default 5 minutes) with an optional default value.
Web App Features
Dashboard — AFK toggle, live progress feed with category icons and progress bars
Decision prompts — Modal overlay with countdown timer, vibration alert
Diff viewer — Unified diff with syntax coloring for code review decisions
History — Searchable/filterable log of all progress entries (persisted in localStorage)
Settings — Verbosity, sound, vibration, theme (light/dark/system)
PWA — Installable to home screen, works offline via service worker (network-first caching)
Push Notifications
Push notifications alert you on your phone even when the browser tab is in the background (e.g., for errors or pending decisions). They work out of the box — no configuration required.
Push uses the Web Push standard with VAPID (Voluntary Application Server Identification). VAPID is an open W3C standard — no Google account, Firebase setup, or API keys required.
How it works
Server auto-generates a VAPID key pair on each startup
Client fetches the public key from
/api/vapid-keyand subscribes via the Push APIBrowser returns an FCM/Mozilla/Apple push endpoint — stored on the server
Server sends encrypted payloads to the endpoint when needed
Service worker receives the push and shows a system notification
Since VAPID keys are generated per session (and push subscriptions are in-memory), each developer runs an isolated instance — no shared secrets, no cross-talk between team members.
Security
Session token — 256-bit random token generated per server instance, required for the initial WebSocket connection
Single device — Only one phone can connect at a time (409 Conflict for second connections)
Reconnect tickets — Rotating one-time tickets for seamless reconnection after network drops (expires after 5 minutes, invalidated after use)
Local network only — The server binds to your machine's local IP; no internet exposure
Environment Variables
Variable | Default | Description |
|
| HTTP/WebSocket server port |
Development (for contributors)
git clone <repo-url> && cd afk-mode-mcp
pnpm install
# Run server with hot reload
pnpm dev:server
# Run webapp dev server (Vite, port 5173)
pnpm dev:webapp
# Build everything
pnpm build
# Start production server
pnpm start
# Lint and format
pnpm lint # Check for lint errors
pnpm lint:fix # Auto-fix lint errors
pnpm format # Format all source files
pnpm format:check # Check formatting without writingTech Stack
Server: Node.js, Express 5, WebSocket (
ws),@modelcontextprotocol/sdkWeb App: React 19, Vite 7, MUI (Material UI) 7, Emotion
Build: tsup (server), Vite (webapp)
Lint: ESLint 10 with
typescript-eslint+ React Hooks pluginFormat: Prettier
Push:
web-pushwith VAPIDQR:
qrcode(data-URI PNG)
Available Tools
4 toolsget_afk_statusA
Returns the current AFK mode status. Call this before every interaction to decide whether to route through AFK MCP tools or native chat. If afkMode is true and clientConnected is true, route through notify_session_progress / get_user_decision. If afkMode is true but clientConnected is false, fall back to native chat and warn the user. If afkMode is false, use native VS Code chat as usual.
Inputs: no named parameters.
get_current_web_app_urlA
Returns the connection URL and QR code for the AFK Mode web app. Call this when the user asks for the AFK app link or QR code.
Inputs: no named parameters.
get_user_decisionA
Sends a decision request to the mobile client and blocks until the user responds or timeout expires. Only call when AFK mode is active. Use type 'confirm' for yes/no, 'choice' for selecting from options, 'text' for free-text input, 'diff' for approving code changes.
Inputs: sessionId (required), prompt (required), type (required), options, +3 more.
notify_session_progressA
Sends a progress update to the connected mobile client. Only call this when AFK mode is active (afkMode: true and clientConnected: true). Returns immediately. Use category 'milestone' for significant steps, 'error' for failures, 'info' for routine updates.
Inputs: sessionId (required), summary (required), category (required), detail, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct and non-overlapping purpose: get_afk_status checks the operational mode, get_current_web_app_url provides connection details, get_user_decision handles user input, and notify_session_progress sends updates. There is no ambiguity in tool selection for an agent.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., get_afk_status, notify_session_progress). The naming is predictable and uniform across all four tools.
With 4 tools, the server is well-scoped for managing AFK mode interactions. Each tool serves a clear role in the workflow, and the count is appropriate without being excessive or insufficient for the domain.
The tool set provides complete coverage for the AFK mode domain: status checking, connection setup, user decision-making, and progress notifications. There are no obvious gaps, and the tools support a full lifecycle from setup to interaction.
Maintenance
Related MCP Connectors
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
A paid remote MCP for AI SDK eval dashboard, built to return verdicts, receipts, usage logs, and aud
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP server that orchestrates AI coding assistants (Claude Code CLI and Gemini CLI) to perform complex programming tasks autonomously, allowing remote control of your local development environment from anywhere.19 npm140MIT
- FlicenseNot gradedqualityNot gradedmaintenanceAn enterprise-grade MCP server providing integrated system prompts and context management for consistent AI behavior across development and infrastructure tasks. It enables users to access specialized prompts for code quality standards and security-first deployment guidance.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to send notifications and request user input via Discord during long-running tasks. It allows users to remotely interact with their AI assistants and provide feedback through the Discord messaging platform.26 npm2MIT
- AlicenseNot gradedqualityCmaintenanceAn enterprise-grade MCP server that enables AI coding assistants to securely connect with external tools, APIs, databases, and cloud services through a unified interface, offering structured engineering workflows and multi-client support.MIT