The Wakapi MCP Server provides development time tracking and productivity analytics by translating Wakapi REST API calls into MCP tools.
Core Capabilities:
User Statistics & Analytics - Retrieve comprehensive coding statistics for various time ranges (today, week, month, year, all time) with filtering by project, language, editor, OS, machine, or label
Project Management - List and filter user projects, and get detailed information about specific projects including creation dates and last activity
User Information - Fetch user profile data including username, email, timezone, last heartbeat, and account settings
Leaderboard Access - View ranked lists of users by coding activity with detailed breakdowns of total coding time, daily averages, and language usage
All-Time Summary - Get cumulative coding statistics since the user started tracking with human-readable time ranges
Recent Activity Logs - Retrieve recent development heartbeats with filtering by project, configurable date ranges, and limits, showing files edited, languages used, branches, and write operations
Connection Testing - Verify connectivity to the Wakapi server and validate API configuration
Key Features:
Compatible with Wakapi's WakaTime-compatible API endpoints
Secure authentication using API keys encoded as Base64 Bearer tokens
Flexible configuration via environment variables or configuration files (TOML/JSON)
Multiple transport modes: STDIO for direct MCP client integration or SSE (HTTP) for web access
Provides development time tracking tools by collecting logs from Wakapi REST API, including statistics, project details, leaderboards, and recent development activity logs
Wakapi MCP Server
This is an MCP (Model Context Protocol) server. It provides development time tracking tools by collecting logs from Wakapi REST API.
This repository is unofficial. Use at your own risk.
Quick Start
Prerequisites
Python 3.11 or higher
Wakapi server with API access
MCP Server Configuration Examples
Quickstart with Environment Variables
Enhanced Security with Configuration File
Features
Collects development time logs via the Wakapi API
Provides MCP tools for retrieving development data
Fast processing using FastMCP
Reproducible development environment with Nix flakes
Modular tool architecture
Improved testability through dependency injection
Design based on the single responsibility principle
Provided Tools
This server provides the following tools that can be used by MCP-compatible clients:
Note: {api_path} is configurable: by default, /compat/wakatime/v1.
Please see the Configuration section.
Tool Name | Description | API Endpoint |
Get Stats | Retrieve statistics for a given user over a specified time range | |
Get Projects | Retrieve and filter the user projects | |
Get User | Retrieve the given user information | |
Get Leaders | Retrieve leaderboard information | |
Get All Time Since Today | Retrieve all time information since today | |
Get Project Detail | Retrieve detailed information about a specific project | |
Get Recent Logs | Retrieve recent development logs | |
Test Connection | Test connection to the Wakapi server | None |
Configuration Details
Environment Variables Configuration
The most common way to configure the server is through environment variables:
Or pass to mcpServers:
Configuration Files
You can also use configuration files in TOML or JSON format:
TOML format (config.toml):
JSON format (config.json):
For Developers
Setup Development Environment
This project provides a reproducible development environment using Nix flakes:
And also use uv to activate, sync and run.
Starting the MCP Server from python command
Authentication Method: The API key is automatically base64-encoded and sent as a Bearer token.
--transport stdio: Uses STDIO transport (default). Can be used directly with MCP clients like opencode--transport sse --port 8001: Uses SSE (HTTP) transport. Accessible via browser or HTTP
Testing
You can test the server using pytest:
License
Apache License 2.0
Contributing
Issues and Pull Requests are welcome.