# Ask questions from PDF files: web app and MCP

## What it does
AskPdf builds a searchable index of uploaded PDF documents and answers natural‑language questions. Each answer includes citations that reference the exact page numbers where the information appears.

## Inputs and limits
* Up to 10 PDF files per session.  
* Total upload size limited to 100 MB.  
* Files must contain searchable text; scanned PDFs need OCR first.

## Web app
The page **/ai-prod/ask-pdf** lets users upload PDFs (up to ten, 100 MB total) and type a question. The interface explains the process, displays the answer with page‑number citations, and notes that uploaded files are kept for about one day and then deleted.

## MCP
The hosted MCP tool **ChatWithDocument** accepts a question and a public PDF URL, creates a RAG index of the document, and returns a PDF containing the answer with page citations.  
Client configuration (the key comes from your Documentize account):

```json
{
  "mcpServers": {
    "documentize": {
      "url": "https://api.documentize.app/mcp",
      "headers": {
        "Authorization": "Bearer dmk_YOUR_KEY_HERE"
      }
    }
  }
}
```

Tool call (`tools/call`). The tool returns a task id; poll `get_task_status` until it reports 200, then download the file from `uploadFileName`:

```json
{
  "name": "chat_with_document",
  "arguments": {
    "query": "What is the dummy PDF?",
    "fileUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  }
}
```

## Verified

Every code sample on this page was run on 2026-11-03 and its result was checked:

- AskPdf via MCP with page count check (hosted MCP server): passed in 26 s
