Anthropic API (no MCP)

You don't need an MCP-capable IDE to use Mneva. If you're building directly against the Anthropic SDK (or any LLM SDK), call the REST API yourself and feed the results back as tool results in your message loop.

Why bother

  • You're building your own coding agent and want a memory layer
  • You're running headless / scripted / CI-style agents
  • You want to mix Mneva with other tools your agent uses, without an MCP wrapper

Pattern

Standard Anthropic tool-use loop:

  1. Define a tool schema for each Mneva endpoint you want to expose
  2. When Claude returns a tool_use block, call the corresponding /v1/* endpoint
  3. Pass the JSON response back as the tool_result
  4. Continue the loop

The 16 tool schemas are documented under MCP Tools. Schemas there are zod; converting to JSON Schema for the Anthropic SDK is mechanical.

A minimal example

The Mneva side is plain HTTP — one POST per tool call your agent makes:

curl -X POST https://mneva.dev/v1/remember \
  -H "x-mneva-key: $MNEVA_KEY" \
  -H "content-type: application/json" \
  -d '{"text":"<what to remember>"}'
curl -X POST https://mneva.dev/v1/recall \
  -H "x-mneva-key: $MNEVA_KEY" \
  -H "content-type: application/json" \
  -d '{"query":"<what to recall about>"}'

The Anthropic loop is the standard tool-use shape — see the Anthropic tool-use docs for the canonical pattern. In short:

  1. Declare a tool schema per Mneva endpoint you want to expose (JSON Schema shape).
  2. Pass tools=[...] to messages.create(...).
  3. When the response has stop_reason == "tool_use", walk resp.content. For each tool_use block, POST to https://mneva.dev/v1/ + the tool name, with the block's input as the JSON body, and append a tool_result content block back.
  4. Continue the loop until stop_reason != "tool_use".

Each tool schema lines up with one /v1/* endpoint documented under REST API. The pattern works for any LLM SDK that supports tool use — the schema shape and loop are SDK-specific; the Mneva side is HTTP regardless.

Was this page helpful?