Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Affinda MCP server

Vendor MCP
Open markdown

The Affinda MCP connector routes your AI agent's tool calls to Affinda's own MCP server through Scalekit. Each user signs in to Affinda once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 85 tools.

Tools
85
What they doRead · write · destructive
35 · 36 · 1435 read36 write14 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Affinda MCP connection

    In AgentKit > Connections, create an Affinda MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Affinda MCP server, so you don't need to register an OAuth app.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'affindamcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Affinda MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'affindamcp_list_organizations',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • affindamcp_get_data_sourceGet one data source by ID — name, schema, and key/display properties.Read-only

    Get data source

    Get one data source by ID — name, schema, and key/display properties.

    Inputs

    data_source_idstringrequired
    No description.
  • affindamcp_get_documentGet one document by ID — state, workspace, document type, and basic metadata.Read-only

    Get document

    Get one document by ID — state, workspace, document type, and basic metadata.

    Inputs

    document_idstringrequired
    No description.
  • affindamcp_get_document_extractionGet the extracted data for one document — raw text plus all field values.Read-only

    Get document extraction

    Get the extracted data for one document — raw text plus all field values.

    Inputs

    document_idstringrequired
    No description.
  • affindamcp_get_document_page_imagesView a document's pages as rendered images, to see the actual document rather than just OCR text.Read-only

    Get document page images

    View a document's pages as rendered images, to see the actual document rather than just OCR text. Use this when the visual appearance of a document matters and text alone is ambiguous — layout questions, checkboxes and selection marks, signatures, stamps, handwriting, logos, or diagnosing why extraction misread something. The images show each page as it appears in the document review UI. With show_annotations, the extracted annotations are drawn on top of each page as colored rectangles tagged with their field slug — use this to check where a value was read from (wrong instance picked, value attributed to the wrong field, table rows/columns mapped incorrectly). On dense documents, pass field_slugs to only draw the fields you are debugging (a table's slug also draws its cells). Images are expensive in tokens — request only the pages you need, at most 5 per call. For extracted values and raw text, use get_document_extraction instead; only reach for images when text output isn't enough.

    Inputs

    document_idstringrequired
    ID of the document to view.
    field_slugsarray
    Only draw annotations for these field slugs (implies show_annotations). Omit to draw all annotated fields.
    page_indicesarray
    Zero-based page indices to fetch (e.g. [0] for the first page). Omit to get the first 5 pages. Request at most 5 pages per call.
    show_annotationsboolean
    Draw the extracted annotations on the page images as colored rectangles labelled with their field slug.default false
  • affindamcp_get_document_typeGet one document type by ID — name, organization, and counts only.Read-only

    Get document type

    Get one document type by ID — name, organization, and counts only.

    Inputs

    document_type_idstringrequired
    No description.
  • affindamcp_get_document_type_detailsGet a document type's full configuration — settings + counts.Read-only

    Get document type details

    Get a document type's full configuration — settings + counts.

    Inputs

    document_type_idstringrequired
    No description.
  • affindamcp_get_fieldGet one field by ID — full settings, formatter, and relationships.Read-only

    Get field

    Get one field by ID — full settings, formatter, and relationships.

    Inputs

    field_idstringrequired
    No description.
  • affindamcp_get_field_groupGet one field group by ID — label, position, parent document type.Read-only

    Get field group

    Get one field group by ID — label, position, parent document type.

    Inputs

    field_group_idstringrequired
    No description.