# Connecting an MCP host

For local stdio, install the MCP package and make `clockify115-mcp` available to the host. Give **that child process** `CLOCKIFY_API_KEY` and `CLOCKIFY_WORKSPACE_ID`. For remote HTTP, use a trusted HTTPS endpoint ending in `/mcp`. In the examples below, replace `WORKSPACE` with the 24-hex workspace ID. Keep the API key in a header. Only the host that sends the request needs the credential.

| Host | Local stdio | Remote API-key HTTP | Tool loading and limits | Evidence |
|---|---|---|---|---|
| Claude Code | Local binary | Configured Authorization header | Tool search by default; four always-load hints | tested in this repository |
| Claude Desktop | MCPB extension | Custom connector with request headers | Bundle lists 30 tools up front; model loading is host-controlled | vendor-documented, not tested here |
| Claude API MCP connector | Remote only | Bearer field plus workspace in URL | MCP toolset, optional deferred loading | vendor-documented, not tested here |
| Codex CLI | Command in TOML | Environment-backed HTTP headers | Discovers the list; model exposure depends on client configuration | tested in this repository |
| Cursor | Command in mcp.json | Headers in mcp.json | Dynamic discovery of tool descriptions | vendor-documented, not tested here |
| VS Code | Command in mcp.json | HTTP server with headers | Enabled tools, on-demand groups; 128 tools per request | vendor-documented, not tested here |
| Gemini CLI | Command in settings.json | httpUrl with headers | Discovers into the tool registry; names over 63 characters truncated | vendor-documented, not tested here |
| ChatGPT connectors | Remote only | Cannot present a custom API key | Workspace approval freezes tools and inputs | not supported |
| OpenAI Responses API | Remote only | MCP tool with headers | Imports the list up front; can filter or defer | vendor-documented, not tested here |

The two "Tested here" notes below cover only the steps explicitly named. Host-managed discovery is independent of this server's stable lean list of 25 tools. Select `CLOCKIFY_MCP_TOOLS=full` for 165 direct tools or `lean,group:reports` for the five direct report tools alongside lean. In lean mode, call `clockify_tools_search` and invoke the returned target through `clockify_tools_read` or `clockify_tools_write`.

## Claude Code

Local registration is `claude mcp add --transport stdio clockify -- clockify115-mcp`. Remote registration is shown below. The single quotes let Claude expand the environment references. When a configured Authorization header gets a 401 or 403 at connection time, Claude reports a connection failure. By default the host limits upfront descriptions and instructions to 4,096 characters and descriptions loaded through search to 16,384. With tool search enabled it can keep status, search and both executors available through their always-load hints. [Claude Code configuration and tool search](https://code.claude.com/docs/en/mcp)

```sh
claude mcp add --transport http clockify 'https://mcp.example.com/mcp?workspace_id=WORKSPACE' --header 'Authorization: Bearer ${CLOCKIFY_API_KEY}'
```

Tested here: Claude Code 2.1.332 registered the compiled stdio entry and `claude mcp get clockify-docs` reported **Connected** with credentials blank. The same host connected to the compiled HTTP service with the documented Bearer header and workspace query. A loopback upstream verified receipt of the ephemeral key. These checks cover both handshakes.

## Claude Desktop

In Settings → Desktop app → Extensions → Advanced settings, select **Install Extension…**, choose the release’s `.mcpb`, and fill in its API-key and workspace prompts. The bundle requests `lean,group:reports` for direct interactive reports. For a remote custom connector, enter the HTTPS endpoint and set request headers `X-Api-Key: <key>` and `X-Clockify-Workspace-Id: <workspace>`. An organization-shared header grants users the shared credential's access. Choose the optional OAuth deployment for per-user grants. [Desktop extensions](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop) · [Remote connector request headers](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)

## Claude API MCP connector

Configure a URL server in `mcp_servers` with `type: "url"`, `name: "clockify"`, `url: "https://mcp.example.com/mcp?workspace_id=WORKSPACE"` and `authorization_token` set to the key at request construction. The wire header is `Authorization: Bearer <key>`. Include its `mcp_toolset` in `tools`. The connector offers a bearer field and URL, with optional `defer_loading` for tool search. The vendor documents the bearer mechanism; this repository has no hosted-connector integration receipt. [Claude API MCP connector](https://platform.claude.com/docs/en/agents-and-tools/mcp-connector)

## Codex CLI

Place one of these alternatives in the client configuration. The CLI can limit its enabled tools. This release has no measurement of which schemas a particular Codex model receives on its first turn. [Codex MCP configuration](https://developers.openai.com/codex/mcp/)

```toml
[mcp_servers.clockify]
command = "clockify115-mcp"
env_vars = ["CLOCKIFY_API_KEY", "CLOCKIFY_WORKSPACE_ID"]
```

```toml
[mcp_servers.clockify]
url = "https://mcp.example.com/mcp"
env_http_headers = { "X-Api-Key" = "CLOCKIFY_API_KEY", "X-Clockify-Workspace-Id" = "CLOCKIFY_WORKSPACE_ID" }
```

Tested here: Codex CLI 0.169.0 parsed both entries with `codex mcp get clockify`. It reported the stdio command and the HTTP transport with both environment-header mappings. This check covers configuration only.

## Cursor

Under `mcpServers.clockify` in `mcp.json`, use `{"command":"clockify115-mcp","env":{"CLOCKIFY_API_KEY":"${env:CLOCKIFY_API_KEY}","CLOCKIFY_WORKSPACE_ID":"${env:CLOCKIFY_WORKSPACE_ID}"}}` locally. For HTTP use `{"url":"https://mcp.example.com/mcp?workspace_id=WORKSPACE","headers":{"Authorization":"Bearer ${env:CLOCKIFY_API_KEY}"}}`. Cursor makes tool descriptions available for on-demand lookup. [Cursor MCP configuration](https://cursor.com/docs/mcp) · [Dynamic context discovery](https://cursor.com/blog/dynamic-context-discovery)

## VS Code

In `.vscode/mcp.json`, configure `servers.clockify` as `{"type":"stdio","command":"clockify115-mcp","env":{"CLOCKIFY_API_KEY":"${input:clockify-key}","CLOCKIFY_WORKSPACE_ID":"${env:CLOCKIFY_WORKSPACE_ID}"}}`. For remote use `{"type":"http","url":"https://mcp.example.com/mcp?workspace_id=WORKSPACE","headers":{"Authorization":"Bearer ${input:clockify-key}"}}`. At the top level set `"inputs":[{"id":"clockify-key","type":"promptString","description":"Clockify API key","password":true}]`. Lean leaves room for other tools under the 128-tool limit. VS Code can group tools for on-demand discovery. [MCP configuration](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) · [Agent tool limits](https://code.visualstudio.com/docs/agents/run/tools)

## Gemini CLI

Under `mcpServers.clockify` in `settings.json`, use `{"command":"clockify115-mcp","env":{"CLOCKIFY_API_KEY":"$CLOCKIFY_API_KEY","CLOCKIFY_WORKSPACE_ID":"$CLOCKIFY_WORKSPACE_ID"}}`. For HTTP use `{"httpUrl":"https://mcp.example.com/mcp?workspace_id=WORKSPACE","headers":{"Authorization":"Bearer <key>"}}` with the key supplied by your private configuration process. Discovery registers tools on connection. Gemini truncates names over 63 characters. [Gemini MCP configuration](https://geminicli.com/docs/tools/mcp-server/)

## ChatGPT connectors

Custom connectors cannot supply a Clockify API key. Use the [optional OAuth service](mcp-remote-operations.md#optional-oauth-with-postgresql) and provision a principal. ChatGPT connects remotely. After workspace approval, an admin reviews and publishes updates to the tool snapshot. [ChatGPT developer mode and MCP connectors](https://help.openai.com/en/articles/12584461-developer-mode-and-full-mcp-connectors-in-chatgpt-beta)

## OpenAI Responses API

Include an MCP tool with `type: "mcp"`, `server_label: "clockify"`, `server_url: "https://mcp.example.com/mcp"` and runtime `headers: {"X-Api-Key": key, "X-Clockify-Workspace-Id": workspaceId}`. Supply credentials on subsequent requests too. The API returns an `mcp_list_tools` item. Use `allowed_tools` to limit imports, or use `tool_search` with `defer_loading: true` on a supported model. [Remote MCP tools](https://developers.openai.com/api/docs/guides/tools-connectors-mcp)

## Reports App

Claude Desktop, Cursor, VS Code and ChatGPT document MCP Apps rendering. ChatGPT needs the OAuth deployment here. Advertise the five report tools directly with `lean,group:reports` and call one from an Apps-capable client. In a text-only host or through the read executor, the caller gets the requested report page in the normal text and structured result envelope. The server skips the additional fetch for the interactive dashboard. API clients can consume the data directly. [MCP Apps support](https://blog.modelcontextprotocol.io/posts/2026-01-26-mcp-apps/) · [Cursor Apps support](https://cursor.com/docs/mcp) · [Reports App interop test](../mcp/tests/reports-app-ext-apps-interop.test.ts)
