Skip to main content
Glama
README.md
# curvelens

Which published essays, checked claims, dated calls and model records does The Durability Curve archive hold on a topic? curvelens is a local forwarding client for the hosted Durability Curve archive MCP service: it answers `tools/list` locally from the captured tool definitions and forwards every call to the service, returning the answers exactly as the service sends them back.

All six tools are read-only retrievals over the publisher's own public archive. The archive's material is retrieved as published; nothing here certifies that any claim in it is true, and there is no write, send, or pricing tool in this surface.

## The tools

- **`search`** — Search the archive with a `query`, or list newest first with an empty query, filtered by `kind` (essay, claim, call, law, tool or model), `series`, `has_ledger` or `access`; `limit` is 1 to 25 (default 5). No required parameters.
- **`get_essay`** — One essay by `slug` (required): the full public text as markdown by default, or a single `part` — `meta`, `outline`, or one named `section`.
- **`get_claim_ledger`** — The claim ledger for one essay by `slug` (required): each checked claim with its source and status, optionally filtered by claim `ids` or `status`, or in `compact` rows.
- **`get_weekly_calls`** — The dated, checkable calls printed in The Durability Curve Weekly, filterable by `status`, `id`, `issue`, resolution dates and printed confidence. No required parameters.
- **`get_ai_models`** — The archive's record of AI model releases from ten labs, searchable by `query` or `lab` and filterable by release date, `frontier_only` and `on_free_plan`; `limit` is 1 to 50 (default 10). No required parameters.
- **`related_to`** — Compare a passage of `text` (required) with the whole archive and return what it has already published on it, grouped by kind, with `per_kind` results of each kind (1 to 10).

## Install and run

As an MCP server via npm:

```bash
npx -y @reneturcios/curvelens mcp
```

MCP client configuration:

```json
{
  "mcpServers": {
    "curvelens": {
      "command": "npx",
      "args": ["-y", "@reneturcios/curvelens", "mcp"]
    }
  }
}
```

As a container:

```bash
docker run -i ghcr.io/cloudcorprecords/curvelens
docker run --rm ghcr.io/cloudcorprecords/curvelens get_ai_models '{}'
```

## CLI

One binary serves both the command line and the MCP server. Each tool is a subcommand taking a single JSON string with that tool's arguments:

```bash
curvelens search '{"query":"agent reliability","limit":5}'
curvelens get_essay '{"slug":"some-essay","part":"outline"}'
curvelens get_claim_ledger '{"slug":"some-essay","compact":true}'
curvelens get_weekly_calls '{"status":"open"}'
curvelens get_ai_models '{"lab":"Anthropic"}'
curvelens related_to '{"text":"a passage about durable work"}'
curvelens --version
```

Exit codes: `0` when the forwarded call succeeds, `1` when the upstream result is an error, and `2` for usage problems such as an unknown subcommand or a malformed JSON argument.

## Configuration

- `DURABILITYCURVE_MCP_URL` — Overrides the upstream endpoint. The default is the pinned hosted endpoint, `https://mcp.durabilitycurve.com/mcp/c/registry`. (The override variable is a reconstruction added by this rebuild.)

The upstream registry record declares no auth headers, so no authentication header is ever sent; the tool surface was captured keyless.

Upstream failures — a JSON-RPC error from the service, a non-2xx response, an unreadable body, or a request that fails outright — are reported to the caller as an error result whose text starts with `curvelens error:`.

## How forwarding works

The first forwarded call opens a session: an `initialize` request (protocol version `2025-03-26`), followed by a `notifications/initialized` notification, then the `tools/call` itself. If the service answers the initialize request with an `Mcp-Session-Id` header, that value is carried on every later request, and the open session is reused for the rest of the process. Replies are accepted either as plain JSON or as server-sent events. Successful results pass through verbatim, including any `structuredContent`, any `isError` flag and any extra fields the service includes.

## Development

```bash
npm install
npm run build   # tsc -> dist/ (dist/cli.js is the bin)
npm test        # tsx --test test/*.test.ts — stubbed upstream, no network
npm run dev     # run the CLI from source
```

The test suite checks the served tool list against the captured surface (all 6 tools, deep-equal, in order, titles included, with no `required` key added to the three tools that carry none), exercises the session handshake and its reuse, verifies that no `Authorization` or `X-API-Key` header is ever sent under any environment, and verifies that arguments go upstream untouched and results come back untouched.

## License

MIT — see `LICENSE`. Copyright (c) 2026 Rene Turcios.