Quick Start
Recommended Path
Section titled “Recommended Path”Start with MCP when you are connecting an AI agent. Use the CLI when you want to test or script the same workflows from a terminal.
Connect your MCP client to MidLyr’s remote MCP server:
https://mcp.midlyr.com/mcpFor self-configured clients, set your API key in the environment used by the client:
export MIDLYR_API_KEY="ml_..."Then add the copy-paste configuration from MCP Configuration and call tools like readRegulatoryContent, startComplianceScreening, and getJob. ChatGPT apps and connectors use OAuth instead of an API-key header.
Install the MidLyr CLI:
npm install -g @midlyr/cliAuthenticate (opens a browser to provision an API key):
midlyr loginSubmit a screening job. By default the CLI polls until the job succeeds or fails and prints the terminal result:
midlyr screen-analysis \ --scenario dispute \ --text "we can't provide a provisional dispute credit until the investigation is completed"Pass --no-wait to return immediately with the pending job record instead of polling.
Install the TypeScript SDK:
npm install @midlyr/sdk-jsCreate a client and submit a screening call:
import { Midlyr } from "@midlyr/sdk-js";
const midlyr = new Midlyr({ apiKey: process.env.MIDLYR_API_KEY!,});
const response = await midlyr.analysis.screen({ content: { type: "text", text: "Get 0% APR for life!" }, scenario: "marketing_asset",});
const job = await midlyr.jobs.get(response.id);The SDK uses native fetch, authenticates via the x-api-key header, and has no runtime HTTP dependency.