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
| Variable | Description | Default |
|---|---|---|
WRKING_API_URL | Base URL of the wrk!ng API | http://localhost:3001 |
WRKING_API_KEY | API key for authentication (required) | -- |
MCP_TRANSPORT | Transport mode: stdio or http | stdio |
MCP_PORT | Port for HTTP transport | 3002 |
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
| URI | Title | Description |
|---|---|---|
wrking://workflows | Workflows | All workflows for the organization |
wrking://employees | Employees | Employee directory |
wrking://tasks | Tasks | Task board with all tasks |
wrking://surveys | Surveys | All surveys |
wrking://events | Recent events | The 50 most recent lifecycle events |
wrking://audit-log | Audit log | Recent audit log entries |
Parameterized resources
| URI template | Title | Description |
|---|---|---|
wrking://workflows/{id} | Workflow detail | A single workflow with its steps and elements |
wrking://employees/{id} | Employee detail | A single employee record |
wrking://events/{aggregateType}/{aggregateId} | Entity event history | Full 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
| Tool | Description | Parameters |
|---|---|---|
list_events | Query the event log | aggregate_type?, event_type?, limit? |
search | Full-text search across the platform | query, entity_type? |
Write tools
| Tool | Description | Parameters |
|---|---|---|
create_task | Create a new task | title, description?, status?, assigned_to?, due_at?, category? |
update_task_status | Move a task to a new status | task_id, status, position? |
send_kudos | Send recognition to a team member | recipient_employee_id, message, core_value_id? |
add_feedback | Create feedback for an employee | target_employee_id, feedback_type?, content, is_anonymous? |
create_webhook | Register a webhook endpoint | url, 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:
| Method | Path | Description |
|---|---|---|
POST | /api/api-keys | Create a key (raw key returned once) |
GET | /api/api-keys | List keys |
POST | /api/api-keys/:id/revoke | Revoke a key |
DELETE | /api/api-keys/:id | Permanently 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.
- A user action fires a lifecycle event
- The webhook dispatcher delivers the event to your AI consumer
- Your AI agent processes the event and decides on an action
- The agent calls a wrk!ng MCP tool to execute the action
- 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.