kimai-timelog-mcp
kimai-timelog-mcp
Un servidor MCP que permite a Claude (o a cualquier cliente LLM compatible con MCP) leer y escribir tus registros de horas de Kimai. Dices "registra de 9 a 12:30 en la renovación del portal, arreglando la redirección de inicio de sesión" y la entrada aparece en Kimai.
Cada solicitud se hace como tú: utiliza tu token personal de la API de Kimai, por lo que solo puede ver y cambiar lo que tu cuenta de Kimai tenga permitido.
1. Obtén un token de API de Kimai
Abre Kimai → haz clic en tu nombre (arriba a la derecha) → Mi perfil → pestaña Acceso a API.
Crea un token, dale un nombre como
claudey cópialo inmediatamente; Kimai solo lo muestra una vez.
Related MCP server: Kimai MCP Server
2. Instalación
Necesitas uv (recomendado) o 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"Luego, una de estas opciones:
A. Desde una carpeta compartida o repositorio git (lo que harán tus compañeros)
uvx --from git+https://github.com/Alpha101Code/kimai-timelog-mcp kimai-mcp --checkB. Desde una copia local
cd /path/to/kimai-timelog-mcp
uv run kimai-mcp --check--check comprueba la URL y el token e imprime tus proyectos visibles. Define primero las dos variables de entorno:
export KIMAI_URL=https://timesheet-sd.maccs.mu
export KIMAI_API_TOKEN=your-token-here3. Conéctalo a tu cliente
Claude Desktop
Configuración → Desarrollador → Editar configuración y añade:
{
"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"
}
}
}
}Reinicia Claude Desktop. En Windows, usa uvx.exe si uvx no se encuentra en 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-mcpCursor / Windsurf / Cline / Zed
La misma estructura JSON que en Claude Desktop, en el archivo de configuración MCP de ese cliente (~/.cursor/mcp.json para Cursor).
Cualquier otro cliente
Es un servidor MCP stdio estándar. Comando: kimai-mcp. Configuración: las dos variables de entorno anteriores.
Herramientas
Herramienta | Qué hace |
| A quién pertenece el token, su zona horaria y la fecha de hoy |
| Proyectos contra los que puedes registrar tiempo, buscables por nombre |
| Actividades válidas para un proyecto (específicas del proyecto y globales) |
| Clientes que puedes ver |
| Nombres de etiquetas configurados en Kimai |
| Tus entradas para un rango de fechas, con totales |
| Tus combinaciones más recientes de proyecto/actividad/descripción |
| Horas totalizadas por proyecto, actividad o día |
| Registra una entrada finalizada |
| Inicia una entrada en curso |
| Lo que se está ejecutando actualmente |
| Detiene la entrada en curso |
| Clona una entrada antigua como una nueva en curso |
| Cambia una entrada existente |
| Elimina una entrada (requiere una confirmación explícita) |
Decisiones de diseño que conviene conocer
Nombres, no IDs.
project: "Portal Revamp"funciona; también un fragmento único como"portal". Los nombres ambiguos devuelven un error que enumera los candidatos, que el modelo puede plantearte como pregunta.Entrada de tiempo flexible.
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.Tu zona horaria. Kimai informa la zona horaria del propietario del token; todo se resuelve a partir de esa, no del reloj del servidor.
Sin horas inventadas.
log_timenecesita inicio+fin, inicio+duración o duración; si no se incluye ninguno, devuelve un error que le indica al modelo que te pregunte en lugar de adivinar.El borrado es en dos pasos. La primera llamada devuelve lo que se eliminaría; solo una segunda llamada con
confirm: truelo elimina.
Ejemplos de prompts
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.Cómo desplegarlo para tus compañeros
Cada persona necesita tres cosas: uv instalado, su propio token de Kimai y el bloque de configuración anterior. Nada se comparte entre usuarios: no hay ningún servidor que ejecutar ni token central.
Si más adelante quieres un único servidor alojado en lugar de una instalación por máquina, la capa de herramientas se mantiene igual; solo cambia el transporte en __main__.py.
Seguridad
El token equivale a una contraseña. Se guarda en el archivo de configuración de tu cliente en tu propia máquina: no lo subas a un repositorio ni lo pegues en un documento compartido.
Establece una fecha de caducidad para los tokens en Kimai y rótalos.
El servidor solo se comunica con
KIMAI_URL. No tiene ningún otro acceso a la red, ni acceso al sistema de archivos, ni shell.Si tu Kimai es de acceso solo interno, esto debe ejecutarse en una máquina que pueda alcanzarlo (VPN o red de oficina).
Desarrollo
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 itEjecuta la suite (no se necesita una instancia de Kimai):
uv run --with mcp --with httpx python tests/test_e2e.pyCompatibilidad
Funciona con las dos versiones principales del SDK de Python para MCP: mcp 1.x (FastMCP) y 2.x (MCPServer). El servidor elige la correcta en el momento de la importación, y los fallos previstos subclasifican el ToolError del SDK para que el mensaje llegue al modelo en lugar de un "error al ejecutar la herramienta" genérico. La suite se ejecuta contra ambos en CI.
La distribución se llama kimai-timelog-mcp (igual que el repositorio); el comando que instala es kimai-mcp.
Desarrollado contra la API REST de Kimai 2 (/api, Authorization: Bearer <token>). Referencia de endpoints: https://www.kimai.org/documentation/rest-api.html y el /api/doc de tu propia instancia.
Available Tools
15 toolsactive_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
Scored across 15 tools
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.
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.
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.
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
timesheet.io MCP server - manage timers, projects, tasks and reports
Manage Timequip projects, tasks, comments, members, and dashboards through MCP.
Toggl 2.0 MCP server for tasks, projects, time entries, and workspace operations.
Unofficial community ClickUp MCP via personal API token. Not affiliated with ClickUp.
Related MCP Servers
AlicenseBqualityBmaintenanceEnables natural language control of the Timesheet API for timer management, task tracking, and project management through MCP tools.50103 npm1MIT- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Kimai time-tracking API for managing timesheets, projects, activities, customers, users, and more.146 PyPI49MIT
- AlicenseCqualityCmaintenanceEnables interacting with Clockify time-tracking data through natural language, providing tools to manage workspaces, projects, time entries, reports, and more via the MCP protocol.4843 PyPI1MIT
- AlicenseNot gradedqualityDmaintenanceThis MCP server enables AI assistants to interact with the Timing application for managing time tracking and tasks, including project and time entry operations.7MIT