Metadata-Version: 2.4
Name: localparse-mcp
Version: 0.2.0
Summary: MCP server for LocalParse — accurate document parsing and schema-driven extraction for Cursor, Claude Desktop, and other MCP clients.
Project-URL: Homepage, https://localparse.com
Project-URL: Source, https://github.com/stevencoveta/Agent-ingestor
Author: LocalParse
License: MIT
Keywords: document parsing,extract,localparse,mcp,model context protocol,ocr,pdf,structured data
Requires-Python: >=3.10
Requires-Dist: localparse>=0.2.0
Requires-Dist: mcp>=1.2.0
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# localparse-mcp

An [MCP](https://modelcontextprotocol.io) server that gives your coding agent
(Cursor, Claude Desktop, etc.) **accurate document parsing** *and*
**schema-driven JSON extraction** via [LocalParse](https://localparse.com) —
table-detection recovery + arithmetic identity checks on the parse side, and
a server-validated JSON Schema contract on the extract side — instead of
letting it write throwaway OCR scripts.

## Tools

### Parse

| Tool | What it does |
|---|---|
| `parse_document(path, result_type)` | Parse a local file (PDF/image/PPTX/…). |
| `parse_url(url, result_type)` | Download a remote doc and parse it. |
| `parse_folder(path, case_id, resume)` | Ingest a whole folder into a named case; re-runs only parse changed files. |
| `get_structured(job_id)` | Fetch the structured ingestion contract for a job. |
| `case_manifest(case_id)` | List a case's ingested docs (path + hash + status). |
| `case_failures(case_id)` | List a case's failed docs for reingest. |

`result_type` ∈ `markdown` (default), `text`, `json`, `structured`.

### Extract *(Beta)*

| Tool | What it does |
|---|---|
| `extract_document(path, data_schema, system_prompt?)` | Parse a file **and** extract structured JSON in one call. Most useful tool for agents. |
| `extract(markdown, data_schema, system_prompt?)` | Run the extract step on already-parsed markdown. |

The server validates the model's output against your `data_schema` before
returning, so the JSON you get back is guaranteed to match the shape you asked
for. Example natural-language prompts an agent can use:

> *"Use `extract_document` on `./invoices/q3.pdf` with this schema:
> `{type:'object', properties:{vendor:{type:'string'}, total:{type:'number'}}, required:['vendor','total']}`"*

## Configure your client

You need a LocalParse API key (`LOCALPARSE_API_KEY`).

### Cursor — `~/.cursor/mcp.json` (or project `.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "localparse": {
      "command": "uvx",
      "args": ["localparse-mcp"],
      "env": { "LOCALPARSE_API_KEY": "lp-your-key" }
    }
  }
}
```

### Claude Desktop — `claude_desktop_config.json`

```json
{
  "mcpServers": {
    "localparse": {
      "command": "uvx",
      "args": ["localparse-mcp"],
      "env": { "LOCALPARSE_API_KEY": "lp-your-key" }
    }
  }
}
```

Then ask the agent things like *"parse the PDFs in ./data-room into case acme and
tell me which tables don't reconcile."*

## Local development (before it's on PyPI)

Run the server straight from the repo and point the client at it:

```json
{
  "mcpServers": {
    "localparse": {
      "command": "uv",
      "args": ["run", "--directory", "/abs/path/to/Agent-ingestor", "localparse-mcp"],
      "env": { "LOCALPARSE_API_KEY": "lp-your-key" }
    }
  }
}
```

Point at a self-hosted parser by also setting `LOCALPARSE_BASE_URL`.
