MCP Server & History Recall

Stravia serves a Streamable HTTP Model Context Protocol (MCP) endpoint at /mcp and supports read-only History recall (stravia://history/) via transparent API key injection.

Prerequisites

  • Active API key:
    • Enable MCP access (mcp_access_enabled) to authorize /mcp connections.
    • Enable Transparent tool injection with history_recall selected to let inference turns query past interactions.
  • Configured capability backends: Tools appear in tools/list only when both the platform capability and key permission are enabled.

Steps

  1. Connect an MCP client to /mcp

    Open Setup → Connect clients and switch to the MCP tab to copy the endpoint URL (http://127.0.0.1:23471/mcp or your public HTTPS reverse proxy URL), check whether your selected API key has MCP access enabled, and copy ready-to-use mcpServers JSON or cURL snippets with Authorization: Bearer <your-api-key>. Stravia validates the key's spend limit and RPM before serving tools/list and tools/call.

  2. Use the StraviaRead body input format

    StraviaRead takes only two top-level keys: required path and an optional body object (question, attachments, allowed_domains, wait). Legacy flat arguments (allowed_domains or wait at the top level) are rejected:

    {
      "path": "stravia://search",
      "body": {
        "question": "Stravia v0.7.8 release notes",
        "allowed_domains": ["github.com"]
      }
    }
    json

    For slow tool executions that return stravia://tool-executions/<id> after the 60-second synchronous wait window, poll the execution handle with StraviaRead and body.wait (canceling the read request stops waiting without canceling the running tool execution).

  3. Enable History Recall (stravia://history/)

    When history_recall is enabled under an API key's Transparent tool injection settings, models can search and inspect prior interactions belonging to that same API key:

    URI patternContents
    stravia://history/Conversation threads for the caller's API key, newest activity first
    stravia://history/<root-id>/Individual turns inside a thread, ordered chronologically
    stravia://history/<root-id>/<interaction-id>Full transcript for a single turn
    stravia://history/<root-id>/<interaction-id>/tools/<n>1-indexed arguments and output for tool call n (as retained)
    • Directories and transcripts support body.question search; tool files can be read directly by range/cursor (:raw and :download are not supported on history paths), and tool outputs are excluded from the search index.
    • History recall is read-only and never exposed over /mcp or explicit StraviaRead calls outside transparent injection.
    Retention, gaps, and shared-key privacy

    History recall reads from Request history (Interaction Observation), so entries obey log_retention_days (default 7 days) and manual clears. Anyone sharing the same API key can inspect prior prompts and tool results recorded under that key, and recalled web/tool text remains untrusted input.

Verify

Send an MCP tools/list request with your API key and confirm only enabled capabilities appear; for history_recall, run two turns under the same API key and ask the model to look up a detail from the earlier turn.

Troubleshooting

  • MCP returns 401 or empty tools/list: Confirm mcp_access_enabled is checked on the API key and the underlying capability (e.g., Web search or Media generation) is enabled and valid.
  • StraviaRead rejects allowed_domains or wait: Move question, attachments, allowed_domains, and wait inside the nested body object.

Next