# japisuru/aucterra-mcp architecture

> Architecture diagram of the GitHub repository japisuru/aucterra-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/japisuru/aucterra-mcp
- Repository: https://github.com/japisuru/aucterra-mcp

## Overview

Aucterra MCP exposes document classification and structured field extraction to LLM agents over stdio. The workflow starts with an agent invoking a registered tool; each tool normalizes a local-file, URL, or base64 input, then sends a request to the corresponding Aucterra API and returns structured JSON or an error. The main entry point starts the MCP server. Both tools and input preparation live in server.py, so their shared implementation path is shown. The API services are documented by endpoint constants in that source; no other internal stages are evident.

Main entry points: [`aucterra_mcp/server.py`](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py) (Field extraction), [`aucterra_mcp/main.py`](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/main.py) (stdio entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP interface"]
  node_entry["stdio entry point<br/>[main.py]"]
  node_mcp["MCP tool server<br/>[server.py]"]
end

subgraph group_handling["Document handling"]
  node_prep["Input preparation<br/>[server.py]"]
  node_extract["Field extraction<br/>[server.py]"]
  node_classify["Document classification<br/>[server.py]"]
end

subgraph group_services["Aucterra services"]
  node_extract_api{{"Extraction API"}}
  node_classify_api{{"Classification API"}}
end

node_agent(("LLM agent"))

node_agent -.->|"starts stdio"| node_entry
node_entry -->|"runs server"| node_mcp
node_agent -.->|"invokes tools"| node_mcp
node_extract -->|"normalizes input"| node_prep
node_classify -->|"normalizes input"| node_prep
node_extract -->|"posts payload"| node_extract_api
node_classify -->|"posts payload"| node_classify_api

click node_entry "https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/main.py"
click node_mcp "https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py"
click node_prep "https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py"
click node_extract "https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py"
click node_classify "https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_mcp toneBlue
class node_prep,node_extract,node_classify toneAmber
class node_extract_api,node_classify_api toneMint
class node_agent toneIndigo
```

## Components

### MCP interface

- [stdio entry point](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/main.py): `aucterra_mcp/main.py`
- [MCP tool server](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py): `aucterra_mcp/server.py`

### Document handling

- [Input preparation](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py): `aucterra_mcp/server.py`
- [Field extraction](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py): `aucterra_mcp/server.py`
- [Document classification](https://github.com/japisuru/aucterra-mcp/blob/main/aucterra_mcp/server.py): `aucterra_mcp/server.py`

### Aucterra services

- **Extraction API**
- **Classification API**

### Other components

- **LLM agent**

## Connections

- LLM agent → stdio entry point: starts stdio (evidence: `README.md`)
- stdio entry point → MCP tool server: runs server (evidence: `aucterra_mcp/main.py`)
- LLM agent → MCP tool server: invokes tools (evidence: `README.md`)
- Field extraction → Input preparation: normalizes input (evidence: `aucterra_mcp/server.py`)
- Document classification → Input preparation: normalizes input (evidence: `aucterra_mcp/server.py`)
- Field extraction → Extraction API: posts payload (evidence: `aucterra_mcp/server.py`)
- Document classification → Classification API: posts payload (evidence: `aucterra_mcp/server.py`)
