# Search: web app, CLI and MCP

## What it does
Search for text within a document. Searches PDF text content, with optional regular-expression matching.

## Inputs and limits
**Command line options**

* `--query` (string, default ""): Text or pattern to search for.
* `--use-as-regex` (bool, default false): Treat the query as a regular expression.

**MCP parameters of `search_in_document`**

* `fileUrl` (string, required): Public URL of the document
* `query` (string, required): Text to search for
* `lang` (string): Language code (e.g. en, de, fr)

## Web app
Open the web app: [Search in a PDF](https://products.documentize.app/searching-in-pdf).

## Command line (CLI)
The `Documentize.Search` plugin: Searches PDF text content, with optional regular-expression matching.

Replace `input-file` with your file and add the options listed above after `--task-id job1`.

```bash
# Linux / macOS (needs the .NET 10 runtime and documentize.lic next to the DLL)
export PLUGIN_INPUT_DIR=./work/input
export PLUGIN_OUTPUT_DIR=./work/output
mkdir -p "$PLUGIN_INPUT_DIR/job1"
cp input-file "$PLUGIN_INPUT_DIR/job1/"
dotnet Documentize.Search.dll --task-id job1
ls "$PLUGIN_OUTPUT_DIR/job1"
```

```powershell
# Windows PowerShell
$env:PLUGIN_INPUT_DIR  = "$PWD\work\input"
$env:PLUGIN_OUTPUT_DIR = "$PWD\work\output"
New-Item -ItemType Directory -Force "$env:PLUGIN_INPUT_DIR\job1" | Out-Null
Copy-Item input-file "$env:PLUGIN_INPUT_DIR\job1\"
dotnet Documentize.Search.dll --task-id job1
Get-ChildItem "$env:PLUGIN_OUTPUT_DIR\job1"
```

All command line plugins: [Documentize CLI plugins](https://products.documentize.ai/pdf-cli).

## MCP
`search_in_document`: Search for text within a document. Returns a task ID.

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": "search_in_document",
  "arguments": {
    "fileUrl": "https://example.org/document.pdf",
    "query": "<query>"
  }
}
```

About the MCP server: [Documentize MCP server](https://products.documentize.ai/pdf-mcp).

## Related guides

* [Extract text from PDF: web app, CLI, MCP and C#](/docs/extract-text)
* [Extract images from PDF: web app, CLI](/docs/extract-image)
* [Extract PDF metadata: web app, CLI and MCP](/docs/extract-metadata)
* [Extract form data from PDF: web app, CLI, MCP and C# (FOSS)](/docs/extract-form-data)
* [Parse PDF documents: web app and CLI](/docs/parser)
* [OCR Image: web app, CLI and MCP](/docs/ocr-image)

## Verification status
**Not verified.** This guide is built from the product documentation and the app's own page. The commands and calls above have not been run successfully, so they may need changes, and the file names in them are placeholders. Written on 2026-11-04; a verified guide replaces this page when the app passes the checks.
