Skip to main content
Glama

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

{
  "mcpServers": {
    "wakapi": {
      "env": {
        "WAKAPI_URL": "http://localhost:3000",
        "WAKAPI_API_KEY": "your-api-key"
      },
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "git+https://github.com/impure0xntk/mcp-wakapi",
        "wakapi-mcp"
      ]
    }
  }
}

Enhanced Security with Configuration File

{
  "mcpServers": {
    "wakapi": {
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "git+https://github.com/impure0xntk/mcp-wakapi",
        "wakapi-mcp",
        "--config",
        "/path/to/config.toml"
      ]
    }
  }
}

Related MCP server: WakaTime MCP Server

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 {api_path}/users/{user}/stats/{range}

Get Projects

Retrieve and filter the user projects

GET {api_path}/users/{user}/projects

Get User

Retrieve the given user information

GET {api_path}/users/{user}

Get Leaders

Retrieve leaderboard information

GET {api_path}/leaders

Get All Time Since Today

Retrieve all time information since today

GET {api_path}/users/{user}/all_time_since_today

Get Project Detail

Retrieve detailed information about a specific project

GET {api_path}/users/{user}/projects/{id}

Get Recent Logs

Retrieve recent development logs

GET {api_path}/users/{user}/heartbeats

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:

export WAKAPI_URL="http://your-wakapi-server:3000"
export WAKAPI_API_KEY="your_actual_api_key_here"
export WAKAPI_API_PATH="/compat/wakatime/v1"

Or pass to mcpServers:

{
  "mcpServers": {
    "wakapi": {
      "env": {
        "WAKAPI_URL": "http://localhost:3000",
        "WAKAPI_API_KEY": "your-api-key"
      },
      ...

Configuration Files

You can also use configuration files in TOML or JSON format:

TOML format (config.toml):

[wakapi]
url = "http://your-wakapi-server:3000"
api_key = "your_actual_api_key_here"
api_path = "/compat/wakatime/v1"
timeout = 30
retry_count = 3

[server]
host = "0.0.0.0"
port = 8000

[logging]
level = "INFO"
format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"

JSON format (config.json):

{
  "wakapi": {
    "url": "http://your-wakapi-server:3000",
    "api_key": "your_actual_api_key_here",
    "api_path": "/compat/wakatime/v1",
    "timeout": 30,
    "retry_count": 3
  },
  "server": {
    "host": "0.0.0.0",
    "port": 8000
  },
  "logging": {
    "level": "INFO",
    "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  }
}

For Developers

Setup Development Environment

This project provides a reproducible development environment using Nix flakes:

# Start the development environment
nix develop

# Or start a shell
nix-shell

And also use uv to activate, sync and run.

nix build for the packaged server does not currently succeed: MCP 2026-07-28 needs fastmcp 4.x on the mcp 2.x SDK, and no available nixpkgs carries it. Use uv sync until nixpkgs ships fastmcp 4.

Starting the MCP Server from python command

# Set environment variables
export WAKAPI_URL="http://localhost:3000"
export WAKAPI_API_KEY="your_actual_api_key_here"
export WAKAPI_API_PATH="/compat/wakatime/v1"

# Start the server in STDIO mode (default)
python main.py --transport stdio

# Start the server in Streamable HTTP mode
python main.py --transport http

# Start with a configuration file
python main.py --config /path/to/config.toml

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 http: Uses Streamable HTTP transport. The endpoint is http://<host>:<port>/mcp, with host and port taken from the [server] section of the config file

Streamable HTTP

MCP revision 2026-07-28 replaced the standalone SSE endpoint with a single Streamable HTTP endpoint. One route at /mcp carries initialize, tools/list and tools/call, including server-initiated SSE streams, so --transport sse no longer exists.

Add --stateless-http to run without server-side session state, which suits serverless or horizontally scaled deployments that cannot keep sessions warm:

python main.py --transport http --stateless-http

Testing

You can test the server using pytest:

# Run all tests
pytest

# Run specific tests
pytest tests/test_mcp_server.py -v

License

Apache License 2.0

Contributing

Issues and Pull Requests are welcome.

Available Tools

8 tools
get_all_time_since_todayGet All Time Since TodayC

Retrieve summary for all time since today for the specified user.

operationId: get-all-time summary: Retrieve summary for all time description: Mimics https://wakatime.com/developers#all_time_since_today tags: [wakatime] parameters:

  • name: user in: path description: User ID to fetch data for (or 'current') required: true schema: type: string responses: 200: description: OK schema: v1.AllTimeViewModel

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: user. Returns: Model for all time view.

get_leadersGet LeadersB

List of users ranked by coding activity in descending order.

operationId: get-wakatime-leaders summary: List of users ranked by coding activity in descending order. description: Mimics https://wakatime.com/developers#leaders tags: [wakatime] responses: 200: description: OK schema: v1.LeadersViewModel

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: no named parameters. Returns: Model for leaders view.

get_project_detailGet Project DetailB

Retrieve a single project.

Mimics undocumented endpoint related to https://wakatime.com/developers#projects.

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: id (required), user. Returns: object

get_projectsGet ProjectsB

Retrieve and filter the user's projects.

operationId: get-wakatime-projects summary: Retrieve and filter the user's projects description: Mimics https://wakatime.com/developers#projects tags: [wakatime] parameters:

  • name: user in: path description: User ID to fetch data for (or 'current') required: true schema: type: string

  • name: q in: query description: Query to filter projects by schema: type: string responses: 200: description: OK schema: v1.ProjectsViewModel

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: q, user. Returns: Model for projects view.

get_recent_logsGet Recent LogsA

Get heartbeats of user for recent days (extension of heartbeats GET).

Mimics https://wakatime.com/api/v1/users/{user}/heartbeats for multiple days.

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: days, user, limit, project_name. Returns: result

get_statsGet StatsB

Retrieve statistics for a given user.

operationId: get-wakatime-stats summary: Retrieve statistics for a given user description: Mimics https://wakatime.com/developers#stats tags: [wakatime] parameters:

  • name: user in: path description: User ID to fetch data for (or 'current') required: true schema: type: string

  • name: range in: path description: Range interval identifier required: true schema: type: string enum: [ "today", "yesterday", "week", "month", "year", "7_days", "last_7_days", "30_days", "last_30_days", "6_months", "last_6_months", "12_months", "last_12_months", "last_year", "any", "all_time" ]

  • name: project in: query description: Project to filter by schema: type: string

  • name: language in: query description: Language to filter by schema: type: string

  • name: editor in: query description: Editor to filter by schema: type: string

  • name: operating_system in: query description: OS to filter by schema: type: str

  • name: machine in: query description: Machine to filter by schema: type: string

  • name: label in: query description: Project label to filter by schema: type: string responses: 200: description: OK schema: v1.StatsViewModel

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: user (required), range (required), label, editor, +4 more. Returns: Model for stats view.

get_userGet UserC

Retrieve the given user.

operationId: get-wakatime-user summary: Retrieve the given user description: Mimics https://wakatime.com/developers#users tags: [wakatime] parameters:

  • name: user in: path description: User ID to fetch (or 'current') required: true schema: type: string responses: 200: description: OK schema: v1.UserViewModel

Requires ApiKeyAuth: Set header Authorization to your API Key encoded as Base64 and prefixed with Basic.

Inputs: user. Returns: Model for user view.

test_connectionTest ConnectionA

Test Wakapi server connection via simple API call to fetch projects.

Returns: A dictionary with the connection test result, including: - status (str): 'success' or 'error'. - message (str): Description of the result. - projects_count (int, optional): Number of projects if successful. - server_url (str): The Wakapi server URL. - api_path (str): The API path used for requests. - error (str, optional): Error message if failed.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools target clearly different resources: user, projects, leaders, heartbeats, project detail, and connection test. However, get_stats and get_all_time_since_today could be confused when using the 'any' or 'all_time' range, and get_projects vs get_project_detail is close but distinguishable.

    Naming Consistency4/5

    Tool names follow a mostly consistent get_* snake_case pattern for retrieval operations. test_connection is a reasonable exception for an action tool, though it slightly breaks the retrieval-oriented naming pattern.

    Tool Count5/5

    Eight tools is well-scoped for a read-oriented Wakapi API wrapper. Each tool covers a distinct endpoint or operation without excessive redundancy.

    Completeness4/5

    The surface covers core read workflows: user info, stats, projects, project detail, leaders, recent heartbeats, all-time summary, and connection testing. Some WakaTime/Wakapi endpoints like summaries, durations, or heartbeat posting are missing, but common retrieval needs are mostly covered.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables users to measure, track, and compare response times of GitHub Copilot and other AI models. Provides statistical analysis and performance comparison tools for evaluating AI model efficiency.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides access to WakaTime coding analytics data through MCP tools. Enables querying coding stats, activity summaries, project lists, and time tracking information from your WakaTime account.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM agents to query and analyze ActivityWatch time tracking data, including window activity, web browsing, and category management with natural language time periods and automatic data aggregation.
      12
      GPL 3.0