UNPKG

@aot-tech/clockify-mcp-server

Version:

MCP Server for Clockify time tracking integration with AI tools

114 lines (112 loc) 4.46 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TOOLS_CONFIG = exports.SERVER_CONFIG = exports.reportsApi = exports.api = void 0; exports.updateApiToken = updateApiToken; exports.updateReportsApiToken = updateReportsApiToken; exports.getApi = getApi; exports.getReportsApi = getReportsApi; const axios_1 = __importDefault(require("axios")); exports.api = axios_1.default.create({ baseURL: 'https://api.clockify.me/api/v1', headers: { 'X-Api-Key': ``, }, }); exports.reportsApi = axios_1.default.create({ baseURL: 'https://reports.api.clockify.me/v1', headers: { 'X-Api-Key': ``, }, }); function updateApiToken(token) { exports.api = axios_1.default.create({ baseURL: 'https://api.clockify.me/api/v1', headers: { 'X-Api-Key': token, }, }); } function updateReportsApiToken(token) { exports.reportsApi = axios_1.default.create({ baseURL: 'https://reports.api.clockify.me/v1', headers: { 'X-Api-Key': token, }, }); } function getApi() { return exports.api; } function getReportsApi() { return exports.reportsApi; } exports.SERVER_CONFIG = { name: "Clockify MCP Server", version: "1.1.0", description: "A service that integrates with Clockify API to manage time entries (stateless with user-specific tokens)", }; exports.TOOLS_CONFIG = { workspaces: { list: { name: "clockify_get_workspaces", description: "Get clockify user available workspaces id and name, a workspace is required to manage time entries", }, }, projects: { list: { name: "clockify_get_projects", description: "Get clockify workspace projects id,name, billable,userIds under the project. returns always a list of projects with userIds associated with that specific project", }, }, users: { current: { name: "clockify_current_user", description: "Get the clockify current user id and name, to search for entries is required to have the user id", }, all: { name: "clockify_all_users", description: `Get all users from Clockify workspace, optionally filtered by project. Usage examples: - To get all workspace users: provide only workspace_id - To get users for a specific project: provide both workspace_id and project_id IMPORTANT: If user mentions a project NAME, first use clockify_get_projects to get the project_id, then use that ID here.` }, allGroups: { name: "clockify_all_groups", description: "Get all clockify groups id and name, to search for entries is required to have the group id", }, teamManagers: { name: "clockify_team_managers", description: "Get all clockify team managers or reporting managers from Clockify workspace, to search for team managers is required to have the user id", }, }, entries: { create: { name: "clockify_create_time_entry", description: "Register a new clockify time entry of a task or break in a workspace", }, list: { name: "clockify_search_single_user_time_entries", description: "Get clockify time entries of a single user in a workspace by user id. The user id is required to get the time entries. IT MUST BE A REAL USER ID FROM CLOCKIFY WORKSPACE.(NEVER USE 'all', 'user', or any placeholder. MUST BE A REAL USER ID FROM CLOCKIFY WORKSPACE.)", }, }, tasks: { find: { name: "clockify_find_task", description: "Find a clockify task of a project by its name if provided, the task must be associated with a project and a workspace", }, }, reports: { detailed: { name: "clockify_get_detailed_reports", description: "Get detailed clockify time tracking reports for a workspace, including breakdowns by projects, users, and time periods", }, summary: { name: "clockify_get_timesheet_summary", description: "Get summary of clockify time tracking reports for a workspace, grouped by users and time entries with project details", }, } };