MCP Server for Claude Code
Connect DevClocked to Claude Code via Model Context Protocol. Give Claude real-time access to your coding activity, sessions, and project stats.
The DevClocked MCP (Model Context Protocol) server lets Claude Code access your coding activity directly inside your terminal session. Ask Claude about your hours, active sessions, weekly stats, and project breakdowns — all without leaving the CLI.
What is MCP?
MCP is an open protocol that lets AI assistants like Claude Code connect to external tools and data sources. By adding DevClocked as an MCP server, Claude can query your tracked time, sessions, and projects in real time.
Prerequisites
- Node.js 18+ installed
- Claude Code installed (
npm install -g @anthropic-ai/claude-code) - A DevClocked account with an API key
Step 1 — Authenticate
First, log in with your DevClocked API key. You only need to do this once per machine:
npx -y @devclocked/cli login
When prompted, paste the API key from your DevClocked dashboard (Settings → API Keys). Your credentials are stored locally at ~/.config/devclocked/cli.json.
Step 2 — Add the MCP Server to Claude Code
Run this single command to register DevClocked as an MCP server in your Claude Code session:
claude mcp add devclocked -- npx -y @devclocked/cli mcp-server
That's it. Claude Code will now start the DevClocked MCP server automatically whenever you launch a session.
Step 3 — Verify
Check that everything is connected:
npx -y @devclocked/cli mcp-health
This checks your auth, Supabase connectivity, and that the MCP tools respond correctly. You should see green checkmarks across the board.
Available Tools
Once connected, Claude Code can use these tools to query your DevClocked data:
| Tool | What it does |
|---|---|
get_summary |
Formatted text summary of today's coding activity |
get_today_activity |
Raw JSON — sessions, work blocks, repos, and token usage for today |
get_active_session |
Current active tracking session info |
get_weekly_summary |
Text summary of the past 7 days |
get_weekly_summary_raw |
Raw JSON data for the past 7 days |
get_projects |
Your projects with hours, sessions, commits, and active days |
Example Usage
Once the MCP server is active, you can ask Claude things like:
- "How many hours have I coded today?"
- "What's my weekly summary?"
- "Which project am I working on right now?"
- "Show me my activity breakdown for this week"
- "How many tokens have I used across projects today?"
Claude will automatically call the appropriate DevClocked MCP tool and present the results.
Alternative: Global Install
If you prefer installing globally instead of using npx:
npm install -g @devclocked/cli
devclocked login
claude mcp add devclocked -- devclocked mcp-server
Troubleshooting
"Not authenticated" error
Run npx -y @devclocked/cli login and enter your API key. Check that ~/.config/devclocked/cli.json exists and contains valid credentials.
Health check failing
Run npx -y @devclocked/cli mcp-health to diagnose. Common causes:
- Expired or revoked API key — generate a new one in Settings
- Network issues — check your internet connection
- Outdated CLI — run
npx -y @devclocked/cli@latest mcp-healthto use the latest version
MCP server not showing in Claude Code
Restart Claude Code after adding the MCP server. You can verify it's registered by checking your Claude Code MCP configuration.
Was this page helpful?