MCP & AI Agents
Verifik exposes SmartReports natively over the Model Context Protocol (MCP) via a Streamable HTTP JSON-RPC 2.0 server, alongside machine-readable discovery files (/openapi.json, /llms.txt, /agent-card.json) and an in-app Developer & AI Agent Kit inside the Smart-Agent portal.
Streamable HTTP MCP Endpoints
| Method | Endpoint | Behavior |
|---|---|---|
POST | https://ai.verifik.co/mcp | Primary Streamable HTTP JSON-RPC 2.0 MCP endpoint. |
POST | https://ai.verifik.co/api/mcp | Equivalent /api alias for the Streamable HTTP MCP endpoint. |
GET | https://ai.verifik.co/mcp | Unauthenticated discovery metadata (name, version, protocolVersion, transport, authentication, and tool list). |
GET | https://ai.verifik.co/api/mcp | Equivalent /api alias for unauthenticated MCP discovery metadata. |
Protocol & Server Metadata
Every MCP handshake and JSON-RPC exchange conforms to:
- Wire protocol: JSON-RPC 2.0 (
"jsonrpc": "2.0") - MCP protocol version:
"2025-03-26" - Server info:
{ "name": "verifik-mcp", "version": "1.0.0" } - Capabilities:
{ "tools": { "listChanged": false } } - Supported methods:
initialize,notifications/initialized,ping,tools/list, andtools/call(unrecognized methods return JSON-RPC error-32601).
Authentication & Tenant Isolation
MCP discovery is separated from tenant-billed execution:
- Unauthenticated discovery:
GET /mcp,initialize,ping,notifications/initialized, andtools/listwork directly without anAuthorizationheader so MCP hosts and agent frameworks can inspect tool schemas. - Strict per-client JWT on
tools/call: Everytools/callinvocation enforces a caller-supplied per-client Verifik Bearer JWT:
Authorization: Bearer <VERIFIK_JWT>
If the Authorization header is missing, malformed, or matches the shared proxy service token, the MCP server rejects tools/call with HTTP 401 and JSON-RPC error code -32001:
{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": -32001,
"message": "Per-client Authorization: Bearer <VERIFIK_JWT> header is required to invoke Verifik MCP tools."
}
}
VERIFIK_JWT server-sideNever embed or expose VERIFIK_JWT in browser JavaScript, public repositories, or client-facing prompts. Configure MCP headers only in server-side runtimes, local desktop MCP clients (Claude Desktop, Cursor, Windsurf), or secure agent tool runners.
Channel Tracking & PDF Handling in MCP
- When an agent invokes
smart_report_runand omitscreatedByChannel, the MCP controller automatically injects"createdByChannel": "mcp"before forwarding toPOST /v2/smart-reports/run. - When an agent invokes
smart_report_download_pdf, the MCP server fetches the PDF binary from Verifik and returns{ reportId, contentType, byteLength, downloadUrl }by default—only embeddingbase64when"includeBase64": trueis explicitly requested so large PDFs do not overflow LLM context windows.
Discovery Files for AI Agents
Agent frameworks, OpenAPI importers, and LLM crawlers can discover SmartReports capabilities automatically using four public endpoints:
| Discovery URL | Format | Details |
|---|---|---|
https://ai.verifik.co/mcp (GET & POST) | JSON / JSON-RPC 2.0 | Live Streamable HTTP MCP discovery metadata and JSON-RPC tool execution. |
https://ai.verifik.co/openapi.json | OpenAPI 3.0.3 | Includes all 10 SmartReports routes under tags ["SmartReports", "Data"] with security: [{ "bearerAuth": [] }] and no x-payment-info (per-client JWT required rather than pay-per-call x402). |
https://ai.verifik.co/llms.txt | Markdown (text/plain) | Concise LLM-readable overview of Verifik products, including the SmartReports headless REST API and MCP endpoint links. |
https://ai.verifik.co/agent-card.json | JSON | Agent discovery card advertising "smart-reports" and "mcp-tools" capabilities and endpoints.mcp (https://ai.verifik.co/mcp). |
SmartReports MCP Tools Reference (10 Tools)
The MCP server exposes 10 SmartReports tools (plus smart_link_create_session from SmartLink, for 11 total tools returned by tools/list).
Tool Catalog
| # | Tool Name | HTTP Method & Path | Purpose |
|---|---|---|---|
| 1 | smart_report_list_presets | GET /v2/smart-batch-presets | List system presets (citizen, company, vehicle) with systemKey, step count, and inputSchema. |
| 2 | smart_report_clone_preset | POST /v2/smart-batch-presets/{systemKey}/clone | Idempotently clone a preset into a client-owned BatchConfiguration + SmartReportTemplate. |
| 3 | smart_report_get_input_schema | GET /v2/batch-configurations/{id}/input-schema | Inspect exact required/optional input fields, JSON Schema, exampleInput, and estimatedCreditsPerRow. |
| 4 | smart_report_run | POST /v2/smart-reports/run | End-to-end execution (preset or config -> verification steps -> Verification Score -> PDF -> optional email & webhooks). |
| 5 | smart_report_get | GET /v2/smart-reports/{id} | Retrieve report status, metadata, verificationScoreSummary, emailHistory, downloadUrl, and htmlUrl. |
| 6 | smart_report_get_html | GET /v2/smart-reports/{id}/html | Fetch rendered HTML, structured row results, and verificationScore without PDF rendering. |
| 7 | smart_report_generate_pdf | POST /v2/smart-reports/{id}/generate | Render or regenerate a PDF for an existing SmartReport and emit smart_batch_report_generated webhooks. |
| 8 | smart_report_download_pdf | GET /v2/smart-reports/{id}/download | Download PDF metadata + downloadUrl (and optional base64 when includeBase64: true). |
| 9 | smart_report_send_email | POST /v2/smart-reports/{id}/send-email | Email a generated PDF to recipients and trigger smart_batch_report_sent / delivery_failed webhooks. |
| 10 | smart_report_list_templates | GET /v2/smart-report-templates | List client-owned and "System" SmartReport templates. |
tools/listCalling tools/list returns 11 tools: the 10 smart_report_* tools documented above plus smart_link_create_session (POST /v3/smart-links/sessions) for generating signed SmartLink verification links.
Detailed Tool Input Schemas
1. smart_report_list_presets
- Upstream:
GET /v2/smart-batch-presets - Arguments (all optional):
country(string) — ISO country filter (e.g."CO","MX","PE","US").category(string:"citizen" | "company" | "vehicle") — Domain filter.tier(string:"essential" | "comprehensive") — Preset tier filter.search(string) — Text filter acrossname,description, andsystemKey.
2. smart_report_clone_preset
- Upstream:
POST /v2/smart-batch-presets/{systemKey}/clone - Required:
systemKey(string, e.g."co.citizen.comprehensive").
3. smart_report_get_input_schema
- Upstream:
GET /v2/batch-configurations/{id}/input-schema - Required:
id(string) —BatchConfigurationObjectId.
4. smart_report_run
- Upstream:
POST /v2/smart-reports/run(defaultscreatedByChannelto"mcp"if omitted) - Arguments:
systemKey(string) — System preset key to clone/reuse whenbatchConfigurationIdis omitted.batchConfigurationId(string) — Existing clientBatchConfigurationID.templateId(string) — OptionalSmartReportTemplateID override.name(string) — Optional report/batch display name.inputs(object or array of up to500objects) — Verification subject inputs (e.g.{"documentType": "CC", "documentNumber": "123456789"}).mode("sync" | "async") —syncwaits (up to5rows,90sdeadline);asyncreturns202 Acceptedimmediately.generatePdf(boolean, defaulttrue) — Setfalseto skip PDF generation and return batch + Verification Score only.includePdfBase64(boolean, defaultfalse) — Inline base64 PDF bytes in the JSON response.pdfEngine("puppeteer" | "pdfkit") — PDF rendering engine override.score(boolean) — Whether to compute Verification Score.scoreProfile(string) — Verification Score profile identifier (e.g."cabify_driver","kyc","kyb","fleet").emailTo(string[]) — Recipient email addresses to deliver the finished PDF.emailSubject(string) — Optional custom email subject.emailLanguage("en" | "es", default"es") — Email body language.webhookUrl(string) — Per-run HTTPS webhook URL receivingsmart_batch_report_*events.externalRefId(string) — Caller correlation ID persisted on the report and included in webhook payloads.
5. smart_report_get
- Upstream:
GET /v2/smart-reports/{id} - Required:
id(string) — SmartReport ObjectId.
6. smart_report_get_html
- Upstream:
GET /v2/smart-reports/{id}/html - Required:
id(string) — SmartReport ObjectId. - Optional:
rowIndex(number, zero-based, default0),preview(boolean).
7. smart_report_generate_pdf
- Upstream:
POST /v2/smart-reports/{id}/generate - Required:
id(string) — SmartReport ObjectId. - Optional:
rowIndex(number),engine("puppeteer" | "pdfkit"),score(boolean),scoreProfile(string).
8. smart_report_download_pdf
- Upstream:
GET /v2/smart-reports/{id}/download - Required:
id(string) — SmartReport ObjectId. - Optional:
rowIndex(number),includeBase64(boolean, defaultfalse).
9. smart_report_send_email
- Upstream:
POST /v2/smart-reports/{id}/send-email - Required:
id(string) — SmartReport ObjectId;recipients(string[], valid emails). - Optional:
subject(string),language("en" | "es", default"es"),rowIndex(number),sendAll(boolean, up to50rows as separate attachments).
10. smart_report_list_templates
- Upstream:
GET /v2/smart-report-templates - Optional:
type("System" | "client"),country(string),category(string),search(string),limit(number),page(number).
Client Setup & Raw JSON-RPC 2.0 Examples
- Claude Desktop / Cursor / Windsurf
- cURL (JSON-RPC 2.0)
- Node.js
- Python
Add the Verifik Streamable HTTP MCP server to your client's mcpServers JSON configuration (claude_desktop_config.json, .cursor/mcp.json, or Windsurf mcp_config.json):
{
"mcpServers": {
"verifik": {
"url": "https://ai.verifik.co/mcp",
"headers": {
"Authorization": "Bearer <VERIFIK_JWT>"
}
}
}
}
# 1) Initialize MCP session (no auth required)
curl -sS -X POST "https://ai.verifik.co/mcp" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": { "name": "verifik-cli", "version": "1.0.0" }
}
}'
# 2) List available MCP tools (no auth required)
curl -sS -X POST "https://ai.verifik.co/mcp" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}'
# 3) Discover presets (Authorization: Bearer <VERIFIK_JWT> required for tools/call)
curl -sS -X POST "https://ai.verifik.co/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "smart_report_list_presets",
"arguments": { "country": "CO", "category": "citizen" }
}
}'
# 4) Execute a SmartReport via MCP
curl -sS -X POST "https://ai.verifik.co/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "smart_report_run",
"arguments": {
"systemKey": "co.citizen.comprehensive",
"inputs": { "documentType": "CC", "documentNumber": "123456789" },
"mode": "sync",
"generatePdf": true,
"score": true,
"externalRefId": "agent-case-001"
}
}
}'
const MCP_URL = 'https://ai.verifik.co/mcp';
const JWT = process.env.VERIFIK_JWT;
async function mcpCall(method, params, id, withAuth = false) {
const headers = { 'Content-Type': 'application/json' };
if (withAuth) {
if (!JWT) throw new Error('Set VERIFIK_JWT in your server environment');
headers.Authorization = `Bearer ${JWT}`;
}
const res = await fetch(MCP_URL, {
method: 'POST',
headers,
body: JSON.stringify({ jsonrpc: '2.0', id, method, params }),
});
const body = await res.json();
if (body.error) {
throw new Error(`MCP error ${body.error.code}: ${body.error.message}`);
}
return body.result;
}
async function main() {
// 1. Initialize & list tools
const init = await mcpCall('initialize', { protocolVersion: '2025-03-26' }, 1);
console.log('Connected to:', init.serverInfo, init.protocolVersion);
const { tools } = await mcpCall('tools/list', {}, 2);
console.log('Total MCP tools:', tools.length);
// 2. Call smart_report_run with per-client Bearer JWT
const runResult = await mcpCall(
'tools/call',
{
name: 'smart_report_run',
arguments: {
systemKey: 'co.citizen.comprehensive',
inputs: { documentType: 'CC', documentNumber: '123456789' },
mode: 'sync',
generatePdf: true,
score: true,
externalRefId: 'agent-case-001',
},
},
3,
true
);
if (runResult.isError) {
throw new Error(runResult.content[0].text);
}
const parsed = JSON.parse(runResult.content[0].text);
console.log('SmartReport result:', parsed.data.report._id, parsed.data.verificationScore);
}
main().catch((err) => {
console.error(err);
process.exit(1);
});
import json
import os
import requests
MCP_URL = "https://ai.verifik.co/mcp"
JWT = os.environ["VERIFIK_JWT"]
def mcp_call(method: str, params: dict, req_id: int, with_auth: bool = False) -> dict:
headers = {"Content-Type": "application/json"}
if with_auth:
headers["Authorization"] = f"Bearer {JWT}"
resp = requests.post(
MCP_URL,
headers=headers,
json={"jsonrpc": "2.0", "id": req_id, "method": method, "params": params},
timeout=120,
)
data = resp.json()
if "error" in data:
raise RuntimeError(f"MCP error {data['error']['code']}: {data['error']['message']}")
return data["result"]
def main() -> None:
# 1. Initialize & list tools
init = mcp_call("initialize", {"protocolVersion": "2025-03-26"}, 1)
print("Server:", init["serverInfo"], "Protocol:", init["protocolVersion"])
tools = mcp_call("tools/list", {}, 2)["tools"]
print("Available tools:", [t["name"] for t in tools])
# 2. Execute smart_report_run
result = mcp_call(
"tools/call",
{
"name": "smart_report_run",
"arguments": {
"systemKey": "co.citizen.comprehensive",
"inputs": {"documentType": "CC", "documentNumber": "123456789"},
"mode": "sync",
"generatePdf": True,
"score": True,
"externalRefId": "agent-case-001",
},
},
3,
with_auth=True,
)
if result.get("isError"):
raise RuntimeError(result["content"][0]["text"])
payload = json.loads(result["content"][0]["text"])
print("Report ID:", payload["data"]["report"]["_id"])
print("Score:", payload["data"].get("verificationScore"))
if __name__ == "__main__":
main()
Ready-to-Use AI Agent System Prompt
You are a verification automation assistant connected to the Verifik SmartReports MCP server (https://ai.verifik.co/mcp).
Workflow rules:
1. Before running any verification, discover required inputs:
- Call `smart_report_list_presets` (if running by systemKey) or `smart_report_get_input_schema` (if given a batchConfigurationId).
- Confirm that every required field in `inputSchema.requiredFields` is present and valid before spending credits.
2. Execute the report with `smart_report_run`:
- Pass `mode: "sync"` for 1 to 5 rows, or `mode: "async"` for 6 to 500 rows (or slow upstream lookups).
- Include a correlation `externalRefId` and optional `webhookUrl` / `emailTo` when provided by the caller.
3. Handle asynchronous responses:
- If `smart_report_run` returns `mode: "async"` (HTTP 202), poll `smart_report_get` until `status` is "generated", "sent", or "failed".
4. Retrieve results without bloating context:
- Use `smart_report_get_html` to inspect structured row findings and `verificationScore`.
- Use `smart_report_download_pdf` with `includeBase64: false` to get `downloadUrl` unless raw base64 bytes are explicitly required.
5. Security:
- Never ask the user to paste `VERIFIK_JWT` into chat logs or browser code; rely on the MCP client's server-side Authorization header.
In-App Developer & AI Agent Kit UI
Inside the Smart-Agent web portal (https://ai.verifik.co), the Developer & AI Agent Kit (SmartReportAgentKitComponent) automatically generates copy-ready integration snippets scoped to whichever preset, batch configuration, template, or generated report you are viewing.
Where to Open It in Smart-Agent
- Batch Dashboard (
BatchDashboardComponent): ClickAPI & AI Agentin the dashboard header to toggle the expanded Developer & AI Agent Kit panel pre-filled with the active configuration'sConfig ID,Template ID,Preset Key(if cloned), required input example, and linked webhook URL. - Report Viewer Modal (
ReportViewerComponent): ClickAPI & AI Agentin the viewer toolbar to open theDeveloper & AI Agent Kitdialog scoped to the activeReport ID(and selected row index), including live/download,/html, and/send-emailcalls. - Template Preview Modal (
SmartBatchComponent): ClickAPI / MCPin the preview modal header (clickBack to Previewto return) to inspect the compact kit pre-populated for that template or system preset.
Kit Controls, Chips & Tabs
- Header: Displays the eyebrow
HEADLESS API & AI AGENT KIT, titleDeveloper & AI Agent Kit, and direct links toAPI Docs(/smart-reports) andReport Webhooks(/resources/smart-reports-webhooks). - Click-to-Copy Identifier Chips: Surfaces contextual badges for
Config ID,Template ID,Preset Key,Report ID, and the linked webhook URL when present. - Four Integration Tabs:
AI Agent Prompt— Ready-to-paste instructions for coding assistants and autonomous agents with input discovery,POST /v2/smart-reports/run, retrieval endpoints, webhook events, and MCP endpoint rules.MCP Tool— Ready-to-copymcpServers.verifikJSON block plus a pre-filledsampleToolCallforsmart_report_run(andfollowUpToolswhen viewing an active report).Webhook Handler— Copy-ready Express.js receiver handling all 6smart_batch_*event types with200 OKfast acknowledgement and PDF download URL hints.cURL Workflow— End-to-end shell commands for input-schema inspection,POST /v2/smart-reports/run, PDF download, and email delivery.
- Action Button: Click
Copy Snippet(displaysCopied!after copying) to copy the active tab's snippet to your clipboard.