# Aryn — how to use (mcp.ai)

Connect your Aryn account and use 9 tools for document data extraction straight from your AI agent. Connect with your own API key. Aryn is an AI-powered platform for document parsing, data extraction, and analytics, enabling users to process and query unstructured documents at scale.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_aryn?ms=1787293380000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `aryn_create_docset`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/aryn`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/aryn/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/aryn/create/docset` — Tool to create a new DocSet. Use when you need to allocate a storage container before adding documents.
  - body: { name: string, schema?: object, prompts?: object, properties?: object }
- `POST https://api.mcp.ai/api/aryn/delete/docset` — Tool to delete a DocSet and all its documents. Use after confirming the DocSet ID, when you need to permanently remove a DocSet and its contents.
  - body: { docset_id: string }
- `POST https://api.mcp.ai/api/aryn/generate/plan` — Tool to generate a query plan without executing it. Use when you need to review the logical plan before running your query (e.g., "Generate a plan for revenue breakdown by region").
  - body: { query: string, rag_mode?: boolean, docset_id: string }
- `POST https://api.mcp.ai/api/aryn/get/doc/set` — Tool to retrieve metadata for a specific DocSet by its ID. Use when you need to check DocSet details like name, creation time, properties, or prompts.
  - body: { docsetId: string }
- `POST https://api.mcp.ai/api/aryn/get/document` — Retrieve a document by ID from Aryn DocParse storage. Returns the document's parsed elements (text, tables, sections with embeddings), custom properties, and optionally the original binary content. Us
  - body: { doc_id: string, docset_id: string, include_binary?: boolean, include_elements?: boolean }
- `POST https://api.mcp.ai/api/aryn/get/document/binary` — Download the original binary content (e.g., PDF, image) of a document from an Aryn DocSet. This action retrieves the raw binary file that was originally uploaded to the DocSet. Use this when you need 
  - body: { docsetId: string, documentId: string }
- `POST https://api.mcp.ai/api/aryn/list/async/tasks` — Tool to list all outstanding asynchronous tasks for the account. Use when you need to check pending or running tasks.
- `POST https://api.mcp.ai/api/aryn/partition/document` — Partition a document using Aryn DocParse to extract and structure its content elements including text, tables, and images. Supports file upload or URL input with extensive processing options for chunk
  - body: { file?: object, options?: object, file_url?: string }
- `POST https://api.mcp.ai/api/aryn/submit/async/add/doc` — Tool to submit a document for asynchronous addition to a DocSet. Returns a task ID to track the operation. Use when you need to add documents to an existing DocSet and want to track the processing sta
  - body: { file?: object, options?: string, file_url?: string, docset_id: string }

## Example prompts
- "What can I do in Aryn?"
- "Show me a summary of my Aryn account"

## More
- Page: https://mcp.ai/aryn
- Agent spec (llms.txt): https://mcp.ai/aryn/llms.txt
- Postman collection: https://mcp.ai/aryn/postman.json
