Provides tools for time tracking operations including retrieving user information, managing projects across workspaces, and logging time entries with flexible time specifications in Clockify.
Clockify MCP Server
A modular Model Context Protocol (MCP) server for integrating with the Clockify time tracking API.
Installation
From npm (Recommended)
From Source
Features
This MCP server provides three tools:
iam - Get current user information from Clockify API
getAllProjects - Get all projects for a specific workspace
logTimeEntry - Log time entries with flexible time specifications
Architecture
The server is built with a modular architecture:
src/server.js- Main server class withregisterToolinterfacesrc/api.js- Shared API utilities for Clockify requestssrc/tools/- Individual tool modules with Zod schema validationindex.js- Entry point that registers all tools
Setup
1. Set Environment Variables
Create a .env file or set the environment variable with your Clockify API key:
You can get your API key from Clockify Settings > API.
2. Run the Server
If installed globally:
If running from source:
Or for development with auto-restart:
Usage in MCP Clients
After installing, you can configure your MCP client to use this server. For example, in Claude Desktop:
Tools
iam
Get current user information from Clockify API.
Parameters: None
Example:
getAllProjects
Get all projects for a specific workspace.
Parameters:
workspaceId(string, required): The workspace ID to get projects for
Example:
logTimeEntry
Log a time entry in Clockify.
Parameters:
date(string, required): Date for the time entry in YYYY-MM-DD formatdescription(string, required): Description of the work performedprojectId(string, required): ID of the project to log time againstworkspaceId(string, required): ID of the workspacestartTime(string, optional): Start time in HH:MM format (defaults to "09:00")endTime(string, optional): End time in HH:MM format (defaults to "17:00")
Example:
Getting Workspace and Project IDs
Use the
iamtool to get your user information and available workspacesUse the
getAllProjectstool with a workspace ID to get project IDsUse these IDs in the
logTimeEntrytool
Error Handling
The server includes comprehensive error handling for:
Missing or invalid API keys
Invalid date/time formats
Missing required parameters
API request failures
Time validation (end time must be after start time)
All errors are returned with descriptive messages to help troubleshoot issues.
Development
Adding New Tools
The server uses a clean registerTool interface. To add a new tool:
Create a new file in
src/tools/with your tool definition:
Export it from
src/tools/index.jsRegister it in
index.js:
The server automatically handles:
Zod schema validation
JSON schema conversion for MCP
Error handling and formatting
Tool registration and discovery
Publishing
To publish updates to npm:
Update the version in
package.jsonRun
npm publish
License
MIT
Requirements
Node.js 18.0.0 or higher
Clockify API key