Clockify MCP Server

Clockify MCP Server

Integrates with Clockify time tracking API to retrieve user information, manage projects, and log time entries with flexible time specifications across workspaces.

Category
访问服务器

README

Clockify MCP Server

A modular Model Context Protocol (MCP) server for integrating with the Clockify time tracking API.

Installation

From npm (Recommended)

npm install -g clockify-mcp-server

From Source

git clone https://github.com/yourusername/clockify-mcp-server.git
cd clockify-mcp-server
npm install

Features

This MCP server provides three tools:

  1. iam - Get current user information from Clockify API
  2. getAllProjects - Get all projects for a specific workspace
  3. logTimeEntry - Log time entries with flexible time specifications

Architecture

The server is built with a modular architecture:

  • src/server.js - Main server class with registerTool interface
  • src/api.js - Shared API utilities for Clockify requests
  • src/tools/ - Individual tool modules with Zod schema validation
  • index.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:

export CLOCKIFY_API_KEY=your_api_key_here

You can get your API key from Clockify Settings > API.

2. Run the Server

If installed globally:

clockify-mcp-server

If running from source:

npm start

Or for development with auto-restart:

npm run dev

Usage in MCP Clients

After installing, you can configure your MCP client to use this server. For example, in Claude Desktop:

{
  "mcpServers": {
    "clockify": {
      "command": "clockify-mcp-server",
      "env": {
        "CLOCKIFY_API_KEY": "your_api_key_here"
      }
    }
  }
}

Tools

iam

Get current user information from Clockify API.

Parameters: None

Example:

{
  "name": "iam"
}

getAllProjects

Get all projects for a specific workspace.

Parameters:

  • workspaceId (string, required): The workspace ID to get projects for

Example:

{
  "name": "getAllProjects",
  "arguments": {
    "workspaceId": "60c1beaf8747147d9ac70b4b"
  }
}

logTimeEntry

Log a time entry in Clockify.

Parameters:

  • date (string, required): Date for the time entry in YYYY-MM-DD format
  • description (string, required): Description of the work performed
  • projectId (string, required): ID of the project to log time against
  • workspaceId (string, required): ID of the workspace
  • startTime (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:

{
  "name": "logTimeEntry",
  "arguments": {
    "date": "2024-01-15",
    "description": "Working on project documentation",
    "projectId": "662f81c0b682f06d79bff487",
    "workspaceId": "60c1beaf8747147d9ac70b4b",
    "startTime": "09:30",
    "endTime": "12:30"
  }
}

Getting Workspace and Project IDs

  1. Use the iam tool to get your user information and available workspaces
  2. Use the getAllProjects tool with a workspace ID to get project IDs
  3. Use these IDs in the logTimeEntry tool

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:

  1. Create a new file in src/tools/ with your tool definition:
import { z } from "zod";
import { makeApiRequest } from "../api.js";

export const myNewTool = {
  name: "myNewTool",
  config: {
    title: "My New Tool",
    description: "Description of what the tool does",
    inputSchema: z.object({
      param1: z.string().describe("Description of param1"),
      param2: z.number().optional().describe("Optional param2")
    })
  },
  handler: async ({ param1, param2 }) => {
    // Your tool logic here
    const result = await makeApiRequest("/some-endpoint");
    return {
      content: [{
        type: "text",
        text: JSON.stringify(result, null, 2)
      }]
    };
  }
};
  1. Export it from src/tools/index.js
  2. Register it in index.js:
server.registerTool(
  myNewTool.name,
  myNewTool.config,
  myNewTool.handler
);

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:

  1. Update the version in package.json
  2. Run npm publish

License

MIT

Requirements

  • Node.js 18.0.0 or higher
  • Clockify API key

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选