MCP Server Manual

Version: 1.0


Overview

LayerClock exposes its external API (/api/external/*) as an MCP (Model Context Protocol) server. MCP-compatible clients such as Claude, Cursor, and custom agents can operate on WBS items, work logs, and timers in natural language.

  • Endpoint: POST /api/mcp
  • Base URL: https://layerclock.com
  • Transport: Streamable HTTP (JSON-RPC 2.0, stateless)
  • No inference cost to us: reasoning happens on the client side; this server is a thin wrapper around the existing API.

Each tool calls the same business logic as the external API. See the API Manual for detailed argument/response specs.


Authentication

Uses the same Personal Access Token (PAT) as the external API.

Authorization: Bearer lc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Issue one from Settings → API Keys tab (Business plan and above).
  • Every POST /api/mcp request requires the Authorization header.
  • Authentication failures are returned as an HTTP status, not a JSON-RPC error.
HTTP code Description
401 UNAUTHORIZED Token invalid/expired, or header missing
403 FORBIDDEN Business plan or higher required
429 RATE_LIMITED Rate limit exceeded (Retry-After: 3600)

Rate limits

Same limits as the external API.

Limit Value
Request cap 1000 requests / hour / token
Window type Fixed window (1 hour)

Each initialize / tools/list / tools/call POST counts as one request.


Transport / protocol

  • Requests are sent as a single JSON-RPC 2.0 object in the POST /api/mcp body (batch arrays are not supported).
  • Requests with an id receive a JSON-RPC response.
  • Notifications without an id (e.g. notifications/initialized) are processed for their side effects only, returning 202 No Content.
  • GET /api/mcp returns 405 Method Not Allowed (this is a stateless implementation with no server-initiated SSE).

Supported methods

Method Description
initialize Returns protocol version, server info, tool capabilities
tools/list Returns the list of available tools
tools/call Executes a tool
ping Health check (returns an empty object)

initialize

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": { "name": "my-agent", "version": "1.0.0" }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": { "tools": {} },
    "serverInfo": { "name": "layerclock", "version": "1.0.0" }
  }
}

tools/call result format

Tool execution results are returned as a JSON string in content[].text.

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "{\"id\":\"uuid\",\"name\":\"...\"}" }]
  }
}

Domain errors (nonexistent ID, invalid hierarchy, missing required field, etc.) are returned with isError: true (still a JSON-RPC success).

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{ "type": "text", "text": "Parent item not found" }],
    "isError": true
  }
}

JSON-RPC errors

Protocol-level errors are returned as a JSON-RPC error object.

code Meaning
-32700 Parse error (invalid JSON)
-32600 Invalid request (not an object, is an array, etc.)
-32601 Method not found
-32602 Invalid params (missing params.name, unknown tool name)
-32603 Internal server error

Tool list

Arguments use the same snake_case as the external API. ? marks optional arguments; everything else is required.

WBS

Tool Arguments Description
list_wbs level?(1-4), parent_id?, status? List WBS items (with filters)
get_wbs id Get a WBS item, including its descendant tree
create_wbs name, level(1-4), parent_id?, status?, estimated_hours?, start_date?, due_date?, notes? Create a WBS item (level=1 needs parent_id: null, level>=2 requires it)
update_wbs id, name?, status?, parent_id?, order?, estimated_hours?, start_date?, due_date?, notes? Update a WBS item (at least one field required; null clears it)
delete_wbs id Delete a WBS item along with the WBS items below it (fails if a timer is running underneath). Work logs are kept with their task name; impact.logs is the number of logs detached from the WBS
  • status: NOT_STARTED / IN_PROGRESS / COMPLETED / ON_HOLD
  • start_date / due_date: YYYY-MM-DD

Each item in the responses of list_wbs, get_wbs, create_wbs, and update_wbs (including children) carries ticket integration details in integration.

Field Content
integration.ticket The ticket linked to the item: provider (GITHUB), repository (owner/name), number (issue number, as a string), url, and state (open / closed). null if there is no link
integration.repositories Names (owner/name) of the repositories that import issues into this item. Empty array if none

Work logs

Tool Arguments Description
list_logs start_date?, end_date?, project_id?, tag_id?(array), page?, per_page? List work logs (paginated)
get_log id Get a work log
logs_summary start_date?, end_date?, project_id?, tag_id?(array) Aggregated project > phase > deliverable tree
create_log wbs_item_id, start_time, end_time Create a work log on a task (level=4)
update_log id, start_time?, end_time? Update a work log's times (duration recalculated)
delete_log id Delete a work log
  • start_time / end_time: ISO 8601 (e.g. 2026-04-01T09:00:00Z). end_time must be after start_time.

Timer

Tool Arguments Description
current_timer (none) Get the currently running timer (null if none)
start_timer task_id Start a timer on a task (only one at a time)
stop_timer task_id Stop the timer and record a work log (does not complete the task — status stays IN_PROGRESS; complete it separately via update_wbs)

Client quickstarts

First, issue a PAT (lc_...) from Settings → API Keys tab (Business plan and above — the token is shown only once, at creation). The same tab also shows a ready-made config snippet for MCP. Below are the steps to register an already-issued token with each client. Replace lc_your_token_here with your own token.

Claude Code (CLI)

claude mcp add --transport http layerclock https://layerclock.com/api/mcp \
  --header "Authorization: Bearer lc_your_token_here"

Run claude mcp list afterward — if layerclock appears, the connection is set up.

Claude Desktop (custom connector)

Go to Settings → Connectors → Add custom connector and set the URL to https://layerclock.com/api/mcp. If your client can't set an auth header directly, add the JSON from "Remote MCP connector (URL + header)" below to its config file instead.

Cursor

Add the JSON below to ~/.cursor/mcp.json (or .cursor/mcp.json for a project-scoped setup).

Remote MCP connector (URL + header, generic)

A common configuration for any client that lets you specify a remote MCP by URL and header — Cursor, VS Code, custom agents, Claude's custom connector, etc.

{
  "mcpServers": {
    "layerclock": {
      "url": "https://layerclock.com/api/mcp",
      "headers": { "Authorization": "Bearer lc_your_token_here" }
    }
  }
}

Examples

curl

TOKEN="lc_your_token_here"
BASE="https://layerclock.com"

# List available tools
curl -X POST "$BASE/api/mcp" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# Get this week's time summary
curl -X POST "$BASE/api/mcp" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
       "params":{"name":"logs_summary",
                 "arguments":{"start_date":"2026-04-01","end_date":"2026-04-07"}}}'

# Start a timer on a task
curl -X POST "$BASE/api/mcp" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call",
       "params":{"name":"start_timer","arguments":{"task_id":"your-task-uuid"}}}'

What natural-language use looks like

Once an MCP-compatible client (Claude, Cursor, etc.) is connected to LayerClock, instructions like these get translated into the tool calls above:

  • "Stop the timer on my current task" → current_timer → stop_timer
  • "How many hours did I work this week?" → logs_summary
  • "Add a 'Design' phase to project A" → list_wbs → create_wbs

See also