Skip to main content

Agents, Public API, and MCP

TextMine supports two integration styles for agents and developer platforms:
  • Public API V3 is the primary integration path. Use it for signup, vaults, document types, uploads, tasks, records, workflows, agents, and billing.
  • TextMine MCP server is optional. Use it only when the client wants MCP tool discovery and tool calls instead of direct REST calls.

Which Path Should I Use?

Self-Service Agent Signup

Use the Public API base URL for the environment. For the UK multitenant deployment:
Start with machine-readable discovery:
Then create an RSA key pair in the trusted agent runtime and sign up:
The response includes:
  • credentialRef: a non-secret reference such as textmine:api-key:123
  • apiKeyPrefix: a display prefix that includes tm_
  • encryptedApiKey: the encrypted service-account API key
  • encryptedApiKeyAlgorithm
  • encryptedApiKeyEncoding
  • billingStatus
  • freeCreditsPerPeriod
  • setupChecklist
Decrypt encryptedApiKey in the trusted runtime, store the resulting tm_... key in a secret store, and keep the raw key out of model-visible prompts, task messages, logs, and transcripts. Use the key on future Public API calls:

OpenAPI Spec

Yes: provide a Public API V3 OpenAPI spec and link it from the developer hub, agent guide, and MCP docs. Agents and developers use the OpenAPI spec for REST endpoint discovery, SDK generation, typed clients, API-client imports, and exact request/response shapes. Use the published API reference at developers.textmine.com/reference. The checked-in source for the agent self-service surface is docs/openapi/textmine-public-api-v3-agent-self-service.openapi.json. The Public API OpenAPI spec should include the full self-service bootstrap path:
  • GET /.well-known/textmine-agent.json
  • GET /v3/third-party-agents/signup/discovery
  • POST /v3/third-party-agents/signup/self-service
  • GET /v3/agent-billing/status
  • POST /v3/vaults
  • POST /v3/document-types
  • POST /v3/documents
  • POST /v3/tasks
  • POST /v3/tasks/{taskId}/messages
MCP is different. MCP clients discover runtime tools through initialize, tools/list, and tools/call. Connector platforms may need their own OpenAPI wrapper around /mcp, but that wrapper is not the canonical Public API spec.

REST-First Bootstrap Flow

After signup:
  1. Check allowance and setup:
  2. Create the first vault:
  3. Create a document type:
  4. Upload a file:
    vault_id is optional. If the agent omits it, TextMine reuses the first accessible vault or creates the default Agent Vault for that API-key organization before uploading the document.
  5. Create and message a task:
  6. Re-check billing:
Document credits are recorded when document processing completes. Agent-task credits are recorded when an agent task completes. If billing status returns checkoutRequired=true, call POST /v3/agent-billing/checkout and send the returned Stripe Checkout URL to the billing owner so they can buy a one-time credit pack.

Optional TextMine MCP Server

The hosted TextMine MCP server is a Streamable HTTP MCP endpoint backed by Public API V3. Use the central setup URL:
Direct MCP clients can send the same tm_... key used for Public API V3:
Clients that cannot control Authorization, such as some connector platforms, can send the key in the alternate header:
OAuth is also supported for enabled marketplace/shared-host app flows. Those clients should use their OAuth connection flow and send the resulting access token as the MCP bearer token instead of asking users to paste tm_... keys into prompts or app manifests.
OAuth client registrations can use TextMine’s protected-resource metadata at https://public-api.textmine.com/.well-known/oauth-protected-resource. Streamable HTTP requires a session handshake:
  1. Send initialize to https://mcp.textmine.com/mcp.
  2. Keep the returned mcp-session-id response header.
  3. Send notifications/initialized with mcp-session-id.
  4. Call tools/list or tools/call with mcp-session-id.
A direct tools/call without mcp-session-id is rejected.

Common Confusions

  • https://developers.textmine.com/mcp is the developer hub documentation MCP endpoint. It helps MCP-aware clients query API docs.
  • The TextMine product MCP server is the hosted endpoint used to call TextMine tools.
  • Workbench MCP providers are third-party provider connections inside Workbench. They are not the TextMine product MCP server.
  • Agent self-service signup is REST-first. MCP is never required for signup.
  • The billing owner email collected during signup is a billing contact, not automatically a human web login.

Developer Documentation Checklist

Keep these phrases visible in page titles, descriptions, and first-screen copy:
  • TextMine Public API
  • Public API V3
  • OpenAPI spec
  • agent self-service signup
  • third-party agent API key
  • service-account API key
  • TextMine MCP server
  • MCP setup
  • /.well-known/textmine-agent.json
Link the agent docs, API reference, and MCP docs to each other so agents can choose the right path without guessing.
Last modified on July 7, 2026