Skip to main content

MCP endpoint

The MCP endpoint turns a workflow into an MCP server: an AI agent connects to the URL, discovers the tools you exposed, and calls them. Each tool call runs your workflow and returns its result to the agent.

Unlike the other web endpoints, this one does not ingest a document — it speaks Model Context Protocol so that assistants such as Claude can use your workflow as a capability.

Pre-requisite

Your workflow must be configured with an MCP endpoint function node, and one Virtual tool node per tool you want to expose. Each Virtual tool declares the tool's name, description and arguments — that is exactly what the agent sees when it lists your tools.

Configuration

See platform reference: How to configure the MCP endpoint

Usage

The endpoint speaks JSON-RPC 2.0 over newline-delimited JSON. Each line of the request body is one JSON-RPC message, and the response streams back one JSON object per line, in order.

body (newline-delimited JSON-RPC)required

One JSON-RPC 2.0 message per line. Blank lines and unparseable lines are skipped.

Authorization (header)

If private workflow: Configured access key. Cf: How to handle Authentication.

Supported methods

MethodBehaviour
initializeReturns protocol version 2024-11-05, the tools capability, and the zparse-mcp-server identity.
notifications/initializedAcknowledged by the server, no response line is emitted.
tools/listReturns one entry per Virtual tool wired to the endpoint, with its name, description and argument schema.
tools/callRuns the workflow synchronously and returns the tool's result.

Any other method returns a JSON-RPC error with code 42 and the message method not found.

Example, listing tools with Curl:
curl https://api.zparse.io/workflow/e/mcp/xxx/yyy \
-H 'Authorization: {ACCESS_KEY}' \
-H 'Content-Type: application/json' \
-XPOST \
--data-binary '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
Example, calling a tool:
curl https://api.zparse.io/workflow/e/mcp/xxx/yyy \
-H 'Authorization: {ACCESS_KEY}' \
-H 'Content-Type: application/json' \
-XPOST \
--data-binary '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_invoice","arguments":{"reference":"ACME-42"}}}'
Synchronous by design

tools/call always runs the workflow in synchronous mode and waits for the result — the agent is blocked until your workflow answers. Keep the tool branch short, and move long processing to a separate workflow triggered downstream.

Response

Responses stream back as newline-delimited JSON with content type application/json, one object per request message, correlated by the JSON-RPC id.

The value returned for a tools/call is the JSON wired into the tool's response. If the workflow produces nothing on that connector, the agent receives a JSON-RPC error with code 404 and the message response was not found — wire a Virtual tool result so every call answers.