Skip to main content
Glama
flexorch-mcp

flexorch-mcp

Official
by flexorch

flexorch-mcp

PyPI version CI License: MIT Python 3.10+ flexorch-mcp MCP server Glama score

MCP server for FlexOrch — SDK for machines.

Connect Claude and other MCP-compatible agents to the FlexOrch document intelligence pipeline. Process documents, extract structured data, detect PII, and export LLM-ready datasets — all through natural language tool calls.


What this is

flexorch-mcp is a thin proxy that exposes the FlexOrch API as MCP tools. All processing happens on FlexOrch's managed infrastructure. A FlexOrch account and API key are required.

For humans writing code: use flexorch-sdk (Python) or flexorch-sdk-js (TypeScript).
For agents: use this package.


Related MCP server: Cognify MCP Server

Tools

Tool

Description

document.process

Upload and process a document (PDF, DOCX, TXT, XLSX, HTML, XML, EML, JPG, PNG, TIFF)

document.reprocess

Re-queue an already-uploaded document through the pipeline

job.status

Poll a processing job until completed or failed

job.result

Get structured extracted fields from a completed job

dataset.build

Build a structured dataset from a completed execution

dataset.search

Semantic search across indexed datasets (Pro+)

dataset.export

Export a dataset as JSONL, CSV, JSON, XML, MD, or RAG (LangChain/LlamaIndex chunks)

dataset.index

Trigger semantic vector indexing for a dataset (Pro+)

dataset.chunks

Retrieve paginated RAG-ready text chunks from an indexed dataset (Pro+)


Installation

pip install flexorch-mcp

Requires Python 3.10+.


Configuration

Claude Desktop

Add to your Claude Desktop config file (create it if it doesn't exist):

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "flexorch": {
      "command": "flexorch-mcp",
      "env": {
        "FLEXORCH_API_KEY": "dfx_your_key_here"
      }
    }
  }
}

Cursor

Add to your Cursor MCP config:

{
  "flexorch": {
    "command": "flexorch-mcp",
    "env": {
      "FLEXORCH_API_KEY": "dfx_your_key_here"
    }
  }
}

OpenAI Codex

Add to ~/.codex/config.toml:

[mcp_servers.flexorch]
command = "uvx"
args = ["flexorch-mcp"]

[mcp_servers.flexorch.env]
FLEXORCH_API_KEY = "dfx_your_key_here"

Get your API key from app.flexorch.com/settings.


Verify connection

flexorch-mcp --check
# → FlexOrch API key: dfx_xxx*** ✓
# → Connection: OK (api.flexorch.com)
# → Plan: Starter (1,200 credits/mo)
# → Tools: 9 registered

Example agent workflow

User: "Process this invoice and export it as JSONL for fine-tuning."

Agent:
  1. document.process(file_url="https://...")   → job_id: 1234
  2. job.status(1234)                           → completed, execution_id: 567
  3. job.result(567)                            → vendor, total, date, PII masked
  4. dataset.build(execution_id=567)            → job_id: 1235
  5. job.status(1235)                           → completed, dataset_id: 89
  6. dataset.export(89, format="jsonl")         → inline JSONL content

Plan limits

All FlexOrch plan limits apply to MCP tool calls. Credits are consumed per document processed.

Plan

Credits/mo

Semantic search

Trial

1,200 (30 days)

—

Starter

1,200

—

Pro

6,000

✓

Enterprise

Custom

✓


Security

  • API key is read from the FLEXORCH_API_KEY environment variable — never passed as a tool argument

  • No data is stored or cached by this server — stateless proxy

  • PII masking is applied by FlexOrch's pipeline before results are returned

  • All communication with api.flexorch.com uses HTTPS



License

MIT — see LICENSE.

Available Tools

8 tools
dataset.buildBuild DatasetA

Package extracted records into a dataset for export (Step 4).

Triggers an async dataset build from a completed execution. Returns a job_id immediately — poll with job.status until status='completed'. The completed response includes dataset_id, which you pass to dataset.export to retrieve all records as text. This step is required before calling dataset.export.

Args: execution_id: Execution ID from a completed data_process job (from job.status or job.result). name: Dataset name. Auto-generated from the source filename if omitted. description: Optional description for this dataset.

Inputs: execution_id (required), name, description. Returns: error, job_id, status, isError, +1 more

dataset.chunksList RAG ChunksA
Read-onlyIdempotent

Retrieve LangChain/LlamaIndex-ready text chunks from an indexed dataset (Pro+ plan).

Returns paginated RAG chunks. Each chunk includes text, token count, and metadata (quality grade, PII masking status, document type, language). Use FlexOrchRetriever or FlexOrchReader from the flexorch-sdk for automatic pagination. The dataset must be indexed first via dataset.index(dataset_id).

Args: dataset_id: ID of the indexed dataset. min_quality: Minimum quality grade to include: A, B, C, or D. Default: B. Chunks with grade at or above this threshold are returned. Example: "B" returns grade A and B chunks. pii_masked_only: When true, return only chunks where PII was masked. Default: false. page: Page number, 1-indexed. Default: 1. page_size: Chunks per page, max 100. Default: 20.

Inputs: dataset_id (required), page, page_size, min_quality, +1 more. Returns: page, error, total, chunks, +5 more

dataset.exportExport DatasetA
Read-onlyIdempotent

Download all records from a built dataset as text (Step 5 — final step).

Returns the complete dataset content as a UTF-8 string directly in the response — no file download or separate URL needed. Call get_job_status after build_dataset and wait for status='completed' before calling this tool. Use the dataset_id from that completed response.

Format guide: jsonl = LLM fine-tuning, rag = LangChain/LlamaIndex chunks, csv = spreadsheets, md = human-readable, xml = structured interchange. Binary formats (parquet, hf) cannot be returned via MCP — export them from the FlexOrch dashboard directly.

Args: dataset_id: Dataset ID from the get_job_status completed build response. format: Text export format — jsonl, csv, json, md, xml, rag. Default: jsonl.

Inputs: dataset_id (required), format. Returns: error, format, content, isError, +3 more

dataset.indexIndex Dataset for RAGA
Idempotent

Trigger semantic indexing for a dataset — required before using dataset.chunks (Pro+ plan).

Starts an async indexing job that splits the dataset into RAG-ready text chunks, generates embeddings, and stores them for semantic search. Indexing is idempotent: calling it again on an already-indexed dataset re-indexes with fresh embeddings. Indexing typically completes in 10–60 seconds depending on dataset size. After indexing, use dataset.chunks(dataset_id) to retrieve the text chunks.

Args: dataset_id: ID of the built dataset to index (from job.status after dataset.build).

Inputs: dataset_id (required). Returns: error, status, isError, message, +2 more

dataset.searchSearch DocumentsA
Read-onlyIdempotent

Search across all indexed FlexOrch datasets by keyword or meaning.

Use this to find specific documents or records without processing a new file. Requires at least one dataset to exist. Structured search works on all plans. Semantic and hybrid modes require a Pro plan — a clear upgrade message is returned if the plan is insufficient. mode='auto' picks structured on free plans, hybrid on Pro+.

Args: query: Search query — natural language or keyword. Max 1000 characters. top_k: Number of results to return. Default: 5, max: 50. mode: Search strategy — auto (default), structured, semantic, hybrid. semantic and hybrid require Pro plan. document_type: Filter to a specific document type, e.g. invoice (optional). language: Filter by document language, ISO 639-1 code, e.g. en, de, tr (optional). quality_grade: Filter by quality grade: A, B, C, or D (optional).

Inputs: query (required), mode, top_k, language, +2 more. Returns: mode, error, query, isError, +2 more

document.processProcess DocumentA

Submit a document for processing — this is always the first step (Step 1 of 5).

Downloads the file from file_url, then submits it to FlexOrch for automatic classification, structured field extraction, PII detection/masking, and quality scoring. Processing is asynchronous — this tool returns immediately with a job_id. You MUST call job.status(job_id) every 3–5 seconds until status='completed' before calling job.result.

Args: file_url: Publicly accessible URL of the document (http/https only, max 50 MB). Supported: PDF, DOCX, TXT, XLSX, HTML, XML, EML, JPG, PNG, TIFF. mask_pii: Replace detected PII (names, IDs, emails, phone numbers) with [MASKED_TYPE] placeholders in all output. Default: true. document_type: Optional classification hint — FlexOrch auto-detects if omitted. Values: invoice, expense_report, purchase_order, sales_proposal, bank_statement, payroll.

Inputs: file_url (required), mask_pii, document_type. Returns: error, job_id, status, isError, +1 more

job.resultGet Extraction ResultA
Read-onlyIdempotent

Read structured fields extracted from a completed document (Step 3).

Use the execution_id from a completed data_process job (job.status response). Returns document type, detected language, quality grade (A–D), PII summary, column list, and extracted field values. If no dataset has been built yet, the response includes a fields_hint guiding you to call dataset.build next. To retrieve all rows as a file, proceed to dataset.build → dataset.export.

Note: Masked fields appear as [MASKED_TYPE] placeholders — raw PII is never returned. Note: execution_id comes from data_process jobs only; dataset_build jobs use dataset_id.

Args: execution_id: Execution ID from the job.status completed response.

Inputs: execution_id (required). Returns: error, fields, columns, isError, +10 more

job.statusGet Job StatusA
Read-onlyIdempotent

Poll a job until it finishes — call this after document.process or dataset.build (Step 2).

Call repeatedly every 3–5 seconds until status is 'completed' or 'failed'. For data_process jobs: the completed response includes execution_id — pass it to job.result. For dataset_build jobs: the completed response includes dataset_id — pass it to dataset.export.

Args: job_id: Job ID returned by document.process or dataset.build.

Inputs: job_id (required). Returns: error, stage, job_id, reason, +14 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.8/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct role in the pipeline: document.process starts a job, job.status polls it, job.result retrieves extracted fields, and dataset.* tools handle building, exporting, searching, indexing, and chunk retrieval. Even job.status and job.result are clearly separated by their polling vs. result-reading purposes.

    Naming Consistency5/5

    All tools follow a consistent <domain>.<operation> pattern (document., job., dataset.) with lowercase snake_case. The operations mix verbs (process, build, export, index) and nouns (status, result, search, chunks), but the pattern is uniform and predictable, making it easy to infer the tool's function from its name.

    Tool Count5/5

    Eight tools is well-scoped for the server's purpose: a document processing and RAG preparation pipeline. Each tool covers a necessary step in the workflow, with no redundancy and no unnecessary additions.

    Completeness5/5

    The toolset fully covers the document processing lifecycle: submit document, monitor job, retrieve results, build dataset, export dataset, plus additional search/index/chunks capabilities for RAG. The workflow is clearly described with numbered steps, and there are no dead ends—every tool's output feeds into the next appropriate tool.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables querying enterprise documents (DOCX, PDF, PPTX) using natural language, with hybrid search and MCP integration for Claude Desktop and other agents.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables document ingestion and typed knowledge graph queries through Claude MCP tools, allowing agents to extract, store, and retrieve typed entities and relations from documents.
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to extract structured data from PDFs with confidence scores and provenance, and to search, review, and correct documents via MCP tools, resources, and prompts.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-compatible agents to run the complete document extraction loop as remote tools: upload files, submit extraction jobs with plain-language instructions, answer clarifying questions, inspect review-needed rows and failed pages, and download results as spreadsheets or JSON.
      MIT