Skip to main content
Serval exposes its entire public API as an MCP (Model Context Protocol) server, allowing AI agents and LLM-powered tools to interact with your Serval workspace programmatically. Every public API endpoint is automatically available as an MCP tool.

Base URL

The MCP server is available at:
The server implements the Streamable HTTP transport defined by the MCP specification.

Authentication

The MCP server uses OAuth 2.1. Your MCP client handles authentication automatically — you provide the server URL, the client discovers OAuth endpoints, opens your browser for approval, and manages tokens. No credentials to copy or rotate.
  1. Configure your MCP client with the server URL: https://public.api.serval.com/mcp/
  2. When the client connects, it will open your browser to approve access to your Serval workspace.
  3. After approval, the client receives tokens and refreshes them automatically.

Client Configuration

Add the following to your .cursor/mcp.json file:
When you first connect, Cursor will open your browser to approve access.

Available Tools

Every endpoint in the Serval public API is available as an MCP tool. Tool names, descriptions, and input schemas are derived directly from the API specification. Tools follow a consistent snake_case naming convention matching the API operation name. The tools most commonly used by employees connecting through an AI assistant: Tickets Access requests Workflows Identity
Use the MCP tools/list method to discover all available tools and their input schemas at runtime. Your MCP client handles this automatically.

How It Works

The MCP server translates each tool call into a REST API request:
  1. Your AI agent calls an MCP tool (e.g., list_tickets) with the required arguments
  2. The server maps the tool call to the corresponding REST endpoint (GET /v2/tickets)
  3. Path parameters, query parameters, and request bodies are constructed from the tool arguments
  4. The response is returned as the tool result
The MCP server has the same capabilities, permissions, and rate limits as the REST API. Any action you can perform through the API, your AI agent can perform through MCP.

Example Usage

Here is an example of an AI agent using the Serval MCP server to list open tickets:

Running Workflows

AI agents can run Serval workflows directly through MCP. Workflow runs are asynchronous: starting a run returns immediately, and the agent waits for (or polls) the result.
  1. Find the workflow with list_workflows (or get_workflow if the ID is known).
  2. Start the run with start_workflow_run, passing the workflow_id and any workflow arguments in arguments as a JSON object encoded into a string — not a raw JSON object (see the example below). The run starts on the workflow’s currently-published version; pass workflow_version_id to pin a specific version. The response returns the run immediately with a pending or running status.
  3. Wait for the result with await_workflow_run_result, which blocks until the run reaches a terminal status or wait_timeout_seconds elapses (default 30s, capped at 60s). If the response has timed_out: true, call it again to keep waiting — or use get_workflow_run to poll.
Runs execute under your identity and permissions, exactly as if you started the workflow in Serval. Starting a run requires the run_published_workflow permission (team contributor role or above), so users without it won’t see the workflow-run tools in their tool list. Running an unpublished draft version instead requires create_workflow_run (team builder role or higher). Workflows with approval requirements still go through their normal approval process. The run stays in progress until approvers act, so long-running runs are expected.

Pagination

List endpoints return paginated results. Use the page_token parameter to retrieve subsequent pages:
  1. Call the list tool without page_token to get the first page
  2. If the response includes a next_page_token, pass it as page_token in the next call
  3. Repeat until no next_page_token is returned

Error Handling

Tool calls that result in API errors return an error message with the HTTP status code and response body. Common errors include: