Skip to main content
Glama

kimai-timelog-mcp

tests

MCP-сервер, который позволяет Claude (или любому MCP-совместимому LLM-клиенту) читать и записывать ваши табели учёта времени в Kimai. Вы говорите «запиши с 9 до 12:30 на редизайн портала, исправление редиректа логина» — и запись появляется в Kimai.

Каждый запрос выполняется от вашего имени — используется ваш личный API-токен Kimai, поэтому сервер может видеть и изменять только то, что разрешено вашей учётной записи Kimai.


1. Получите API-токен Kimai

  1. Откройте Kimai → нажмите на своё имя (справа сверху) → Мой профиль → вкладка API access.

  2. Создайте токен, дайте ему имя вроде claude и сразу скопируйте его — Kimai показывает его ровно один раз.

Related MCP server: Kimai MCP Server

2. Установка

Вам понадобится uv (рекомендуется) или Python 3.10+.

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Затем выберите:

A. Из общей папки / git-репозитория (так сделают коллеги)

uvx --from git+https://github.com/Alpha101Code/kimai-timelog-mcp kimai-mcp --check

B. Из локальной копии

cd /path/to/kimai-timelog-mcp
uv run kimai-mcp --check

--check проверяет URL и токен и выводит ваши видимые проекты. Сначала задайте две переменные окружения:

export KIMAI_URL=https://timesheet-sd.maccs.mu
export KIMAI_API_TOKEN=your-token-here

3. Подключение к вашему клиенту

Claude Desktop

Настройки → Разработчик → Изменить конфигурацию, затем добавьте:

{
  "mcpServers": {
    "kimai": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Alpha101Code/kimai-timelog-mcp", "kimai-mcp"],
      "env": {
        "KIMAI_URL": "https://timesheet-sd.maccs.mu",
        "KIMAI_API_TOKEN": "your-token-here"
      }
    }
  }
}

Перезапустите Claude Desktop. В Windows используйте uvx.exe, если uvx не найден в PATH.

Claude Code

claude mcp add kimai \
  --env KIMAI_URL=https://timesheet-sd.maccs.mu \
  --env KIMAI_API_TOKEN=your-token-here \
  -- uvx --from git+https://github.com/Alpha101Code/kimai-timelog-mcp kimai-mcp

Cursor / Windsurf / Cline / Zed

Та же JSON-структура, что и для Claude Desktop, в файле конфигурации MCP соответствующего клиента (~/.cursor/mcp.json для Cursor).

Остальные клиенты

Это стандартный stdio MCP-сервер. Команда: kimai-mcp. Конфигурация: две переменные окружения выше.


Инструменты

Инструмент

Что делает

whoami

Кому принадлежит токен, его часовой пояс, сегодняшняя дата

list_projects

Проекты, по которым можно учитывать время, с поиском по названию

list_activities

Активности, допустимые для проекта (проектные + глобальные)

list_customers

Клиенты, которых вы видите

list_tags

Названия тегов, настроенные в Kimai

list_timesheets

Ваши записи за диапазон дат, с итогами

recent_entries

Ваши последние комбинации проект/активность/описание

summarize_time

Часы, суммированные по проекту, активности или дню

log_time

Записать завершённую запись

start_timer

Начать идущую запись

active_timers

Что сейчас запущено

stop_timer

Остановить идущую запись

restart_timer

Клонировать старую запись как новую идущую

update_timesheet

Изменить существующую запись

delete_timesheet

Удалить запись (требуется явное подтверждение)

Полезные особенности, о которых стоит знать

  • Названия, а не идентификаторы. project: "Portal Revamp" работает; так же работает уникальный частичный вариант "portal". Неоднозначные названия возвращаются как ошибка со списком кандидатов, которую модель может передать вам как вопрос.

  • Гибкий ввод времени. date: today, yesterday, monday, 3 days ago, 2026-08-24, 25/08/2026. start/end: 09:00, 9am, 5.30pm, 0930. duration: 1h30m, 90m, 1.5h, 1:30.

  • Ваш часовой пояс. Kimai сообщает часовой пояс владельца токена; всё вычисляется относительно него, а не часов сервера.

  • Без выдуманных часов. log_time требует start+end, start+duration или duration. Если ничего не указано, возвращается ошибка, в которой модели предлагается спросить вас, а не угадывать.

  • Удаление в два шага. Первый вызов возвращает то, что было бы удалено; только второй вызов с confirm: true удаляет запись.

Примеры запросов

Log 9:00–12:30 today on Portal Revamp, development, "fixed the login redirect".
What did I log this week? Break it down by project.
Same as yesterday afternoon, but for today.
Start a timer on Internal Tools / Admin.
I forgot Monday — 4 hours on Mobile App, release testing.
Move entry 512 to start at 10:15 instead.

Внедрение у коллег

Каждому нужны три вещи: установленный uv, собственный токен Kimai и блок конфигурации выше. Ничего не используется совместно — не нужно запускать сервер, нет центрального токена.

Если позже вы захотите один размещённый сервер вместо установки на каждой машине, слой инструментов останется как есть; поменяется только транспорт в __main__.py.

Безопасность

  • Токен — эквивалент пароля. Он хранится в файле конфигурации вашего клиента на вашей собственной машине — не коммитьте его и не вставляйте в общий документ.

  • Устанавливайте токенам срок действия в Kimai и регулярно их меняйте.

  • Сервер общается только с KIMAI_URL. У него нет других сетевых доступов, доступа к файловой системе и оболочки.

  • Если ваш Kimai доступен только из внутренней сети, сервер должен запускаться на машине, которая может до него дотянуться (VPN или офисная сеть).

Разработка

src/kimai_mcp/
  client.py     Kimai REST client — auth, errors, name→id resolution, caching
  timeutil.py   parsing for human dates, times and durations
  server.py     the MCP tools
  __main__.py   stdio entrypoint + --check
tests/
  mock_kimai.py a stand-in Kimai instance
  test_e2e.py   drives the real server over stdio against it

Запуск тестового набора (экземпляр Kimai не нужен):

uv run --with mcp --with httpx python tests/test_e2e.py

Совместимость

Работает с обеими основными версиями Python MCP SDK: mcp 1.x (FastMCP) и 2.x (MCPServer). Сервер выбирает нужную версию при импорте, а ожидаемые сбои наследуют ToolError из SDK, поэтому сообщение доходит до модели вместо общего «error executing tool». Набор запускается в CI против обеих версий.

Дистрибутив называется kimai-timelog-mcp (как и репозиторий); устанавливаемая команда — kimai-mcp.

Создано на основе REST API Kimai 2 (/api, Authorization: Bearer <token>). Справочник конечных точек: https://www.kimai.org/documentation/rest-api.html и /api/doc вашего экземпляра.

Available Tools

15 tools
active_timersB

Any currently running time entries for this user.

Inputs: no named parameters. Returns: result

delete_timesheetA

Permanently delete a time entry.

Args: timesheet_id: the entry to delete. confirm: must be true. Show the user what will be deleted first.

Inputs: timesheet_id (required), confirm. Returns: object

list_activitiesA

List activities, optionally the ones valid for a given project.

Args: project: project name or id. Omit to list every activity. search: optional substring filter on the activity name.

Inputs: search, project. Returns: result

list_customersA

List customers visible to this user.

Inputs: no named parameters. Returns: result

list_projectsA

List the projects this user can book time against.

Args: search: optional substring to filter project or customer names. customer: optional customer name or id to scope the list.

Inputs: search, customer. Returns: result

list_tagsA

Tag names configured in this Kimai instance.

Inputs: no named parameters. Returns: result

list_timesheetsA

The user's own time entries for a date range, newest first.

Defaults to the last 7 days. Use this before writing an entry to avoid duplicates, and to answer "what did I log this week".

Args: from_date: 'today', 'monday', '2026-08-24', '3 days ago'. to_date: same formats; defaults to today. project: optional project name or id to filter by. search: optional free-text search over descriptions. limit: maximum entries to return (max 500).

Inputs: limit, search, project, to_date, +1 more. Returns: object

log_timeA

Write a finished time entry to Kimai.

Give either start+end, or start+duration, or duration alone (which books the period ending now). Do not guess missing times — ask the user instead.

Args: project: project name or id. activity: activity name or id, must be valid for the project. description: what was worked on. Strongly recommended. date: 'today', 'yesterday', 'monday', '2026-08-24'. start: '09:00', '9am', '14.30'. end: same formats as start. duration: '1h30m', '90m', '1.5h', '1:30'. tags: optional list of Kimai tag names. billable: optional override of the project default.

Inputs: project (required), activity (required), end, date, +5 more. Returns: object

recent_entriesA

The project/activity/description combinations this user booked most recently.

Best first call for "log the usual" or "same as yesterday" requests.

Inputs: limit. Returns: result

restart_timerA

Start a new running entry that copies an existing one's project/activity.

Inputs: timesheet_id (required). Returns: object

start_timerB

Start a running timer now (or at a given start time today).

Args: project: project name or id. activity: activity name or id. description: what is being worked on. start: optional start time such as '09:00'; defaults to now.

Inputs: project (required), activity (required), start, description. Returns: object

stop_timerA

Stop a running timer.

Args: timesheet_id: which entry to stop. Omit to stop the only running one.

Inputs: timesheet_id. Returns: object

summarize_timeA

Total the user's logged hours over a range, grouped for reporting.

Args: from_date: defaults to 7 days ago. to_date: defaults to today. group_by: 'project', 'activity' or 'day'.

Inputs: to_date, group_by, from_date. Returns: object

update_timesheetA

Change an existing time entry. Only the fields you pass are touched.

Args: timesheet_id: the entry to change (from list_timesheets). date/start/end/duration: same formats as log_time. Passing any of these recomputes the entry's begin and end.

Inputs: timesheet_id (required), end, date, tags, +6 more. Returns: object

whoamiA

Who the Kimai API token belongs to, plus their timezone and today's date.

Call this once at the start of a time-logging conversation so that relative dates ("yesterday") and times are anchored correctly.

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

    A4/5.0

    Scored across 15 tools

    Disambiguation5/5

    Each tool targets a distinct operation: reference data listing, timesheet queries, entry creation, timer control, editing, deletion, and reporting. Even similar tools like list_timesheets and recent_entries are clearly differentiated by what they return.

    Naming Consistency4/5

    The set mostly follows a clear list_ for read-only collections and verb_noun for actions, such as log_time and stop_timer. Minor deviations like active_timers, recent_entries, and whoami break the pattern slightly but remain understandable.

    Tool Count5/5

    At 15 tools, the server covers discovery, logging, timer lifecycle, modifications, deletion, and reporting without feeling bloated. Each tool contributes a meaningful piece of the time-logging workflow.

    Completeness5/5

    The toolset supports a full time-logging lifecycle: lookup reference data, check existing entries, log time, start and stop timers, restart entries, update or delete entries, and summarize hours. It also includes helpful context tools like whoami and recent_entries; admin CRUD for projects or customers is outside the apparent purpose.

    Related MCP Connectors

    Related MCP Servers