Metadata-Version: 2.4
Name: denario-mcp
Version: 0.2.0
Summary: Local MCP client for Denario — owns local file/git I/O, delegates private research compute to the Cloud Run API.
License-Expression: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: mcp>=1.0.0
Description-Content-Type: text/markdown

# denario-mcp

A lightweight, local **MCP client** for Denario. It runs on the user's machine
and owns all **local filesystem + git** work; the private Denario research
pipeline runs remotely on Cloud Run and only returns data. This is the
[`air-sdk`](../../air-sdk)-style split applied to Denario — see
[`../DESIGN.md`](../DESIGN.md) for the full architecture and rationale.

## Why a local client

Running `denario_setup` remotely can never create a project on the user's disk,
and `gh repo create` in a container would use the *server's* GitHub identity.
So file/git work must be local. Only the confidential research compute is
remote. See `DESIGN.md` §1.

## Install

```bash
pip install -e ./denario-mcp     # from web/, during development
# or, once published:  pip install denario-mcp
```

The package is intentionally light — it depends only on `mcp` and `httpx`, not
on the heavy Denario research stack. The `denario_setup` logic is vendored
(stdlib-only) in `setup_local.py`.

## Use with Claude Code

```jsonc
{
  "mcpServers": {
    "denario": {
      "command": "denario-mcp",
      "env": {
        "DENARIO_API_KEY": "…",                       // for remote compute steps
        "DENARIO_CLOUD_URL": "https://denario-web-….run.app"
      }
    }
  }
}
```

`denario-mcp` requires `git` and the GitHub CLI (`gh`, authenticated as the
user) on `PATH` for `denario_setup`'s repo creation.

## Status

| Tool            | State                                                       |
|-----------------|-------------------------------------------------------------|
| `denario_setup` | ✅ Implemented — runs fully locally, no network.            |
| `denario_idea`  | ✅ Implemented — private compute runs remotely (`POST /v1/compute/idea`); idea.md is written + committed locally. |
| methods / results / paper / eda / literature | ⏳ remaining — same pattern; long steps move to async jobs (`/v1/jobs`). |

### How a compute step flows (`denario_idea`)

```
client (denario-mcp)                         server (Cloud Run)
  read local data_description.md
  POST /v1/compute/idea  ───────────────────►  denario_compute.run_step("idea")
                                                  ephemeral dir, run pipeline,
                                                  return idea.md as data
  ◄─────────────────────────────────────────  { artifacts, log }
  write idea.md into local project dir
  git commit && push  (user identity)
```

The server never touches the user's disk or git; the client owns both.

## Environment

| Var                  | Purpose                                             |
|----------------------|-----------------------------------------------------|
| `DENARIO_API_KEY`    | Bearer token for the remote compute API.            |
| `DENARIO_CLOUD_URL`  | Base URL of the Cloud Run compute API.              |
| `GITHUB_ORG`         | Org/account for repo creation (default `ParallelScience`; see DESIGN §9). |
| `SCIENTIST_NAME`     | Used in derived repo slug + README (default `denario`). |
| `DENARIO_MCP_LOG`    | If set, log file path (keeps logs off stdout).      |
