MCP Server

Give your AI agents direct access to the platform.

One server, every compatible client. Read data, execute actions, and build autonomous workflows through the Model Context Protocol.

What is MCP

Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data sources. Instead of building custom integrations for each AI tool, you run a single MCP server that any compatible client can connect to. The server advertises its resources (data it can read) and tools (actions it can perform), and the client presents them to the LLM at inference time.

Package

The MCP server lives in packages/mcp and runs as a standalone Node.js process. It acts as a thin adapter between MCP clients and the wrk!ng REST API -- the server itself holds no state.

Configuration

VariableDescriptionDefault
WRKING_API_URLBase URL of the wrk!ng APIhttp://localhost:3001
WRKING_API_KEYAPI key for authentication (required)--
MCP_TRANSPORTTransport mode: stdio or httpstdio
MCP_PORTPort for HTTP transport3002

Setup

Setup with Cursor

Add the following to your .cursor/mcp.json file:

{
  "mcpServers": {
    "wrking": {
      "command": "npx",
      "args": ["tsx", "packages/mcp/src/index.ts"],
      "env": {
        "WRKING_API_URL": "https://api.wrk.ing",
        "WRKING_API_KEY": "wrk_your_key_here"
      }
    }
  }
}

Cursor spawns the server as a child process and communicates over stdin/stdout.

Setup with Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "wrking": {
      "command": "npx",
      "args": ["tsx", "packages/mcp/src/index.ts"],
      "env": {
        "WRKING_API_URL": "https://api.wrk.ing",
        "WRKING_API_KEY": "wrk_your_key_here"
      }
    }
  }
}

On macOS, the config file is at ~/Library/Application Support/Claude/claude_desktop_config.json.

Transports

stdio (default)

The default mode for local integrations. The MCP client spawns the server as a child process and communicates over stdin/stdout. Use this with Cursor, Claude Desktop, and CLI-based agent frameworks.

WRKING_API_KEY=wrk_abc123... npx tsx packages/mcp/src/index.ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const transport = new StdioClientTransport({
  command: "npx",
  args: ["tsx", "packages/mcp/src/index.ts"],
  env: { WRKING_API_KEY: "wrk_abc123..." },
});
const client = new Client({ name: "my-agent" });
await client.connect(transport);
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

params = StdioServerParameters(
    command="npx",
    args=["tsx", "packages/mcp/src/index.ts"],
    env={"WRKING_API_KEY": "wrk_abc123..."},
)
async with stdio_client(params) as (read, write):
    async with ClientSession(read, write) as session:
        await session.initialize()

Streamable HTTP

For remote or hosted deployments where multiple clients connect over the network. The server exposes a single /mcp endpoint that handles POST (JSON-RPC requests), GET (SSE streams), and DELETE (session termination).

MCP_TRANSPORT=http MCP_PORT=3002 WRKING_API_KEY=wrk_abc123... \
  npx tsx packages/mcp/src/index.ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("http://localhost:3002/mcp")
);
const client = new Client({ name: "my-agent" });
await client.connect(transport);
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async with streamablehttp_client("http://localhost:3002/mcp") as (read, write, _):
    async with ClientSession(read, write) as session:
        await session.initialize()

Clients connect to http://localhost:3002/mcp (or your deployed URL). Each client gets an independent session managed via the mcp-session-id header.

Resources

Resources are read-only data that AI agents can access. The server exposes both static collections and parameterized resources for individual records.

Static resources

URITitleDescription
wrking://workflowsWorkflowsAll workflows for the organization
wrking://employeesEmployeesEmployee directory
wrking://tasksTasksTask board with all tasks
wrking://surveysSurveysAll surveys
wrking://eventsRecent eventsThe 50 most recent lifecycle events
wrking://audit-logAudit logRecent audit log entries

Parameterized resources

URI templateTitleDescription
wrking://workflows/{id}Workflow detailA single workflow with its steps and elements
wrking://employees/{id}Employee detailA single employee record
wrking://events/{aggregateType}/{aggregateId}Entity event historyFull event history for a specific entity

Clients can call list on parameterized resources to discover all available instances (e.g. all workflow IDs and names), then fetch a specific one by URI.

Tools

Tools expose actions the AI agent can perform. Each tool has a typed input schema, a description, and behavioral annotations (readOnlyHint, destructiveHint) so clients present them appropriately.

Read-only tools

ToolDescriptionParameters
list_eventsQuery the event logaggregate_type?, event_type?, limit?
searchFull-text search across the platformquery, entity_type?

Write tools

ToolDescriptionParameters
create_taskCreate a new tasktitle, description?, status?, assigned_to?, due_at?, category?
update_task_statusMove a task to a new statustask_id, status, position?
send_kudosSend recognition to a team memberrecipient_employee_id, message, core_value_id?
add_feedbackCreate feedback for an employeetarget_employee_id, feedback_type?, content, is_anonymous?
create_webhookRegister a webhook endpointurl, description?, event_types?

Authentication

The MCP server authenticates to the wrk!ng API using an organization-scoped API key. Create and manage keys through the API:

MethodPathDescription
POST/api/api-keysCreate a key (raw key returned once)
GET/api/api-keysList keys
POST/api/api-keys/:id/revokeRevoke a key
DELETE/api/api-keys/:idPermanently delete a key

API keys use the format wrk_ followed by 64 hex characters. The first 12 characters serve as a visible prefix for identification. See Getting started for details on creating keys.

Event-driven AI loop

The complete automation loop

The MCP server, webhooks, and event system form a closed loop that enables fully automated, LLM-driven workflows.

  1. A user action fires a lifecycle event
  2. The webhook dispatcher delivers the event to your AI consumer
  3. Your AI agent processes the event and decides on an action
  4. The agent calls a wrk!ng MCP tool to execute the action
  5. The action fires a new event, continuing the loop

This enables fully automated, LLM-driven workflows where AI reviews submissions, analyzes data, makes recommendations, and takes action at every interaction point in the platform.