Clockodo MCP Server

Clockodo MCP Server

A TypeScript-based MCP server that integrates with the Clockodo time tracking API, enabling access to users, time entries, and projects.

Category
访问服务器

README

Clockodo MCP Server

A TypeScript-based Model Context Protocol (MCP) server that integrates with the Clockodo time tracking API. This server provides comprehensive access to your Clockodo data through the standardized MCP protocol, enabling Claude Desktop and other MCP clients to interact with users, time entries, and projects from your Clockodo instance.

Features

  • Users Resource: Access all registered users from your Clockodo instance
  • Entries Resource: Retrieve time entries for specific users within date ranges
  • Projects Resource: Access all projects with detailed information including budgets and status
  • Automatic Pagination: Handles multiple pages of data automatically
  • Real-time Data: Fetches live data from Clockodo API
  • Comprehensive Logging: Detailed API request/response logging for debugging
  • Type Safety: Full TypeScript implementation with Zod validation
  • MCP Compliant: Follows Model Context Protocol standards for seamless integration

Prerequisites

  • Node.js (v18 or later)
  • npm or yarn
  • Clockodo account with API access
  • Clockodo API credentials (email and API key)

Installation

  1. Clone the repository:
git clone <repository-url>
cd clockodo-ts
  1. Install dependencies:
npm install
  1. Create environment file:
cp .env.example .env
  1. Configure your Clockodo credentials in .env (see Configuration)

  2. Build the project:

npm run build

Configuration

Create a .env file in the project root with your Clockodo credentials:

CLOCKODO_EMAIL=your-email@example.com
CLOCKODO_API_KEY=your-api-key-here

Getting Clockodo API Credentials

  1. Log in to your Clockodo account
  2. Go to Settings → API
  3. Generate or copy your API key
  4. Use your Clockodo login email as CLOCKODO_EMAIL

Usage

Development Mode

For development with live TypeScript compilation:

npm run dev

Production Mode

Build and run the compiled server:

npm run build
node build/index.js

MCP Client Integration

Claude Desktop

Add to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "clockodo": {
      "command": "node",
      "args": ["/absolute/path/to/your/clockodo-ts/build/index.js"],
      "env": {
        "CLOCKODO_EMAIL": "your-email@example.com",
        "CLOCKODO_API_KEY": "your-api-key"
      }
    }
  }
}

Or using your existing .env file:

{
  "mcpServers": {
    "clockodo": {
      "command": "node",
      "args": ["/absolute/path/to/your/clockodo-ts/build/index.js"],
      "cwd": "/absolute/path/to/your/clockodo-ts"
    }
  }
}

Note: Replace /absolute/path/to/your/clockodo-ts with the actual absolute path to your project directory.

MCP Inspector

For development and testing:

npx @modelcontextprotocol/inspector

Configure with:

  • Server Command: npx tsx /absolute/path/to/your/clockodo-ts/src/index.ts
  • Transport: stdio
  • Working Directory: /absolute/path/to/your/clockodo-ts

Available Resources

Users Resource

  • URI: clockodo://users
  • Description: Retrieves all registered users from your Clockodo instance
  • Data: Complete user information including names, emails, roles, and settings
  • Format: JSON array of user objects

Example usage in Claude:

Can you show me all users from my Clockodo instance?

Entries Resource

  • URI: clockodo://entries/{userId}/{timeSince}/{timeUntil}
  • Description: Retrieves time entries for a specific user within a given timeframe
  • Parameters:
    • userId: Clockodo user ID (number)
    • timeSince: Start date in ISO 8601 format (e.g., 2025-09-01T00:00:00Z)
    • timeUntil: End date in ISO 8601 format (e.g., 2025-09-30T23:59:59Z)
  • Data: Complete time entry information including project details, time spent, and descriptions
  • Format: JSON array of entry objects

Example usage in Claude:

Show me time entries for user 148226 from September 1-30, 2025
What did I work on last week? --clockodo

Example URIs:

  • clockodo://entries/148226/2025-09-01T00:00:00Z/2025-09-30T23:59:59Z
  • clockodo://entries/123/2024-12-01T00:00:00Z/2024-12-31T23:59:59Z

Projects Resource

  • URI: clockodo://projects
  • Description: Retrieves all projects from your Clockodo instance
  • Data: Complete project information including:
    • Project names, numbers, and descriptions
    • Customer assignments and relationships
    • Budget information (monetary amounts, hard/soft budgets)
    • Project status (active, completed, dates)
    • Billing settings and revenue factors
    • Detailed notes and contact information
  • Format: JSON array of project objects

Example usage in Claude:

Show me all projects from Clockodo
Which projects are currently active?
What's the budget for project "Agile Coaching 2025"?

API Structure

Project Structure

src/
├── index.ts          # Main MCP server entry point
├── clockodo.ts       # Clockodo API client
build/
├── index.js          # Compiled executable
├── clockodo.js       # Compiled API client

Key Components

  • McpServer: Main server instance handling MCP protocol
  • ClockodoAPI: API client for Clockodo integration with comprehensive logging
  • StdioServerTransport: Communication layer for MCP clients
  • Zod Schemas: Type validation for API responses (Users, Entries, Projects)
  • Logger: Built-in logging system that writes to clockodo-api.log

Development

Scripts

  • npm run dev - Start development server with live reload
  • npm run build - Build TypeScript to JavaScript
  • npm test - Run tests (if implemented)

Testing API Integration

Test your Clockodo API connection directly:

curl "https://my.clockodo.com/api/v3/users?page=1" \
  -H "Accept: application/json" \
  -H "X-ClockodoApiUser: your-email@example.com" \
  -H "X-ClockodoApiKey: your-api-key" \
  -H "X-Clockodo-External-Application: mcp-ts"

MCP Protocol Testing

Test MCP protocol responses:

# List all available resources
echo '{"jsonrpc": "2.0", "method": "resources/list", "id": 1, "params": {}}' | npm run dev

# Test users resource
echo '{"jsonrpc": "2.0", "method": "resources/read", "id": 2, "params": {"uri": "clockodo://users"}}' | npm run dev

# Test projects resource
echo '{"jsonrpc": "2.0", "method": "resources/read", "id": 3, "params": {"uri": "clockodo://projects"}}' | npm run dev

# Test entries resource (replace with actual user ID and dates)
echo '{"jsonrpc": "2.0", "method": "resources/read", "id": 4, "params": {"uri": "clockodo://entries/148226/2025-09-01T00:00:00Z/2025-09-30T23:59:59Z"}}' | npm run dev

Logging and Debugging

The server includes comprehensive logging that writes to clockodo-api.log:

  • All API requests and responses
  • Authentication details (API keys are masked)
  • Data validation results
  • Error details and stack traces

To monitor logs in real-time:

tail -f clockodo-api.log

Error Handling

The server includes comprehensive error handling:

  • Authentication Errors: Invalid Clockodo credentials
  • API Errors: Clockodo API failures or rate limits
  • Validation Errors: Invalid API response formats
  • Network Errors: Connection timeouts or network issues

All errors are properly formatted as MCP protocol error responses.

Security

  • Environment variables are required for API credentials
  • No credentials are logged or exposed in error messages
  • API requests include proper authentication headers
  • All API responses are validated before processing

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Troubleshooting

Common Issues

"Environment variables are required" error:

  • Ensure .env file exists with correct credentials
  • Check that dotenv.config() is called before importing other modules

"Invalid API response format" errors:

  • Verify your Clockodo API credentials are correct
  • Check if your API key has proper permissions
  • Ensure your Clockodo account has access to the users endpoint

MCP connection issues:

  • Verify the server starts without errors in development mode
  • Check that your MCP client configuration points to the correct path
  • Ensure the server process has proper permissions

Debug Mode

Run with debug output:

DEBUG=* npm run dev

License

[Add your license here]

Support

For issues related to:

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选