Skip to content
Agent Process
All agents

Connect TypeScript SDK

One block of settings gives TypeScript SDK your processes, the data and email templates you've allowed, and a way to wait for your approval.

Setup

  1. Get your address and an access token

    In your workspace, open Agents and create an access token. The page shows your exact MCP address and fills it, and the token, into these settings for you. Tokens are shown once, so keep yours somewhere safe.

  2. For an agent you build, with the official MCP TypeScript SDK.

    Example
    import { Client } from "@modelcontextprotocol/sdk/client/index.js";
    import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
    
    const client = new Client({ name: "my-agent", version: "1.0.0" });
    await client.connect(
      new StreamableHTTPClientTransport(new URL("https://<your-mcp-endpoint>/mcp"), {
        requestInit: {
          headers: { Authorization: `Bearer ${process.env.PROCESS_FLOW_TOKEN}` },
        },
      }),
    );
    
    const work = await client.callTool({ name: "get_work", arguments: {} });
  3. Check it's connected

    Ask TypeScript SDK: “What processes can you see?” It should list the published processes in your workspace. If it can't reach the server, check the address and that the token hasn't been revoked.

This setup is written from TypeScript SDK's own MCP documentation.