Metadata-Version: 2.3
Name: fraise-mcp
Version: 0.1.2
Summary: Fraise MCP server: remember and recall over a running Fraise daemon, with vectors embedded locally
Author: René-Jean Corneille
Author-email: René-Jean Corneille <corneille.r.j@gmail.com>
Requires-Dist: fraise-sdk[fastembed]>=0.4.1
Requires-Dist: mcp>=2.3.0,<3
Requires-Dist: pytest>=9.1.1 ; extra == 'dev'
Requires-Dist: pytest-cov>=7.1.0 ; extra == 'dev'
Requires-Python: >=3.12
Provides-Extra: dev
Description-Content-Type: text/markdown

# fraise-mcp

An MCP server for a running [Fraise](https://github.com/FraiseHQ/fraise) daemon. It exposes two tools, `recall` and `remember`, each taking one FQL statement: `recall` runs every read, a recall, a `when` or a `describe` in front of a recall, and `remember` every write. It embeds every statement's text locally so retrieval is hybrid (text and vector) out of the box. The model writes plain FQL and never a vector.

<!-- mcp-name: io.github.FraiseHQ/fraise -->

## Run

```bash
uvx fraise-mcp
```

Register it with your agent host:

```bash
claude mcp add fraise -- uvx fraise-mcp
codex mcp add fraise -- uvx fraise-mcp
```

The server forwards to a daemon that runs separately (`brew services start fraise`, or `systemctl --user start fraise`), like a database behind a connection URL.

## Provenance

Every release is published to PyPI from this repository's release workflow, with a [PEP 740](https://peps.python.org/pep-0740/) attestation that PyPI shows as the file's provenance. A downloaded file verifies against the repository:

```bash
uvx pypi-attestations verify pypi --repository https://github.com/FraiseHQ/fraise pypi:fraise_mcp-<version>-py3-none-any.whl
```

## Configure

Every setting is a flag, and each flag falls back to an environment variable:

| Flag | Environment | Default |
| --- | --- | --- |
| `--addr` | `FRAISE_ADDR` | `http://localhost:9876` |
| `--model` | `FRAISE_EMBEDDING_MODEL` | `BAAI/bge-small-en-v1.5` |
| `--no-vectors` | `FRAISE_NO_VECTORS=1` | vectors on |

The model is any text model [fastembed](https://qdrant.github.io/fastembed/examples/Supported_Models/) supports. It runs on ONNX Runtime, with no torch, and loads on the first statement that needs a vector, so the server starts without it. The first load downloads the model files into `~/.cache/fraise-mcp`, or `$XDG_CACHE_HOME/fraise-mcp` when `XDG_CACHE_HOME` is set, and later loads read them from there; `FASTEMBED_CACHE_PATH` names another directory. A graph's first vector fixes its dimension, so a graph keeps the model it was first written with.

## What gets embedded

A `remember` embeds its fact. A `recall` embeds its search terms, the words and phrases before its first clause. An `explain recall …` embeds the same terms as the recall it prefixes, which it ranks exactly alike. The server appends `vec:$v` and binds the vector beside the statement. A recall with no terms, where anchors alone seed the search, is sent as written, and so is a `describe recall`, which answers with the shape of what its recall reaches and would reach every fact holding a vector if it carried one, and any statement the server cannot read that far: the daemon checks every statement, and its error messages come back to the model as tool errors.

## What a recall answers

The `recall` tool answers with one line per fact, best first, each with the dates its fact holds in front, and beside them with the daemon's response as structured content, under the same output schema as the built-in `fraise mcp` bridge. An `explain recall …` carries its `explain` blocks in both: whole in the structured content, and in the lines as one for the query above the facts and one under each fact, written as the built-in bridge writes them. See [Explained recall](https://docs.getfraise.dev/docs/http-api/endpoints/explain).
