Metadata-Version: 2.4
Name: laiaric-mcp
Version: 0.1.0
Summary: MCP server for xeditai/laiaric-open: local text-to-JSON extraction for agents, through Ollama
Keywords: mcp,ollama,json,extraction,agents,llm
Author: xeditai
License-Expression: Apache-2.0
Requires-Dist: httpx>=0.29.0
Requires-Dist: mcp>=1.10
Requires-Python: >=3.11
Project-URL: Repository, https://github.com/raycollabs/laiamcp
Project-URL: Model, https://huggingface.co/xeditai/laiaric-open
Project-URL: Ollama, https://ollama.com/xeditai/laiaric-open
Description-Content-Type: text/markdown

# laiaric-mcp

An MCP server for [xeditai/laiaric-open](https://huggingface.co/xeditai/laiaric-open). Laiaric-open is a small open-weight model that turns unstructured text into JSON.

Agents make many small extraction steps: read a ticket, a log line, or a spec, and fill typed fields. A large LLM for each step costs time and tokens. This server does the step locally in [Ollama](https://ollama.com/xeditai/laiaric-open).

- **Text in, typed JSON out.** You give a JSON Schema and the text.
- **Grounded values.** The model copies values from the text. A value that is not in the text is `null`.
- **Local and small.** 2.7 GB (Q4_K_M) runs on a laptop GPU.

<!-- MCP Registry ownership marker. Do not remove. -->
mcp-name: io.github.raycollabs/laiaric-mcp

## 1. Install the model

```bash
ollama pull xeditai/laiaric-open
```

## 2. Add the server to your client

You need [uv](https://docs.astral.sh/uv/). `uvx` downloads and runs the server.

**Claude Code**

```bash
claude mcp add laiaric -- uvx laiaric-mcp
```

**Claude Desktop, Cursor, and other JSON-config clients**

```json
{
  "mcpServers": {
    "laiaric": {
      "command": "uvx",
      "args": ["laiaric-mcp"]
    }
  }
}
```

- Claude Desktop: `claude_desktop_config.json`
- Cursor: `~/.cursor/mcp.json` or `.cursor/mcp.json` in the project

## Tools

### `extract(text, schema)`

| Argument | Type | Description |
|---|---|---|
| `text` | string | The source text, such as a bug ticket, log excerpt or spec. The limit is 24,000 characters. |
| `schema` | object | A JSON Schema of type `object`, or a map of field name to field schema. |

Example call:

```json
{
  "text": "Production incident: service 'auth-gateway' failed with HTTP 504. Root cause: redis-primary pool exhaustion.",
  "schema": {
    "service_name": {"type": "string"},
    "status": {"type": "integer"},
    "owner_email": {"type": ["string", "null"]}
  }
}
```

Result:

```json
{
  "data": {"service_name": "auth-gateway", "status": 504, "owner_email": null},
  "missing": [],
  "notes": {"service_name": "explicitly mentioned"},
  "audit": {"model": "xeditai/laiaric-open", "duration_ms": 3591, "text_chars": 108, "fields": 3}
}
```

- `data`: one value for each schema property.
- `missing`: properties that the model did not return. Their values in `data` are `null`.
- `notes`: a short reason or evidence from the model, when it gives one.
- `audit`: the model, the duration and the input size, for your logs.

### `health()`

This tool checks that Ollama runs and that the model is installed. If the model is not installed, it tells you the `ollama pull` command.

## Configuration

| Variable | Default | Description |
|---|---|---|
| `OLLAMA_HOST` | `http://localhost:11434` | Ollama URL |
| `LAIARIC_MODEL` | `xeditai/laiaric-open` | Model tag, for example `xeditai/laiaric-open:q8_0` |
| `LAIARIC_TIMEOUT` | `120` | Request timeout in seconds |

## Field F1 by domain

| Domain | F1 |
|---|---|
| Software app specifications | 1.000 |
| RL hillclimb proposals | 1.000 |
| System failure triage | 0.986 |
| General unseen schemas | 0.978 |
| Agent candidate configurations | 0.975 |
| SDK bug tickets | 0.905 |

## Development

```bash
uv sync
uv run pytest
```

The live test runs only if Ollama has the model installed.

## License

Apache-2.0
