Metadata-Version: 2.5
Name: llm-refract
Version: 0.1.2
Summary: Provider-neutral Python instrumentation, portable execution artifacts, and an MCP interface for the Refract execution engine.
Project-URL: Repository, https://github.com/khaleddeissa/llm-refract
Project-URL: Documentation, https://github.com/khaleddeissa/llm-refract/tree/main/docs
Project-URL: Issues, https://github.com/khaleddeissa/llm-refract/issues
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai,execution,mcp,observability,replay
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.11
Provides-Extra: mcp
Requires-Dist: mcp<2,>=1.26; extra == 'mcp'
Description-Content-Type: text/markdown

# llm-refract

Provider-neutral Python instrumentation for AI applications, plus an optional MCP interface to the
Refract execution engine. Export portable `.rfr` files or submit snapshots to the Refract REST service.

## Install

```bash
pip install llm-refract
```

MCP support is an optional extra:

```bash
pip install "llm-refract[mcp]"
```

## SDK usage

```python
import refract

with refract.run("agent", path="run.rfr"):
    refract.event(type="generation", name="answer", output={"text": "Hello"})
```

See the [usage guide](https://github.com/khaleddeissa/llm-refract/blob/main/docs/usage/python.md).

## MCP server

Executable stdio interface to the Rust Refract API: ten read-only tools, plus import/fork tools when
`REFRACT_MCP_ALLOW_WRITES=1`. Requires the `mcp` extra above. Start with:

```bash
refract-mcp
```

See [configuration, tool inventory and limits](https://github.com/khaleddeissa/llm-refract/blob/main/docs/usage/mcp.md).
Implementation: [server.py](src/refract_mcp/server.py).
