> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thrindex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Overview

> Connect any MCP-compatible AI client to Thrindex using the Model Context Protocol Streamable HTTP transport.

## What is MCP?

The [Model Context Protocol](https://spec.modelcontextprotocol.io/specification/2025-03-26/) (MCP) is an open standard that lets AI clients — editors, assistants, and agent frameworks — talk to external tools and services over a uniform JSON-RPC 2.0 interface.

Thrindex implements MCP's **Streamable HTTP transport**, which means any MCP-compatible client can connect to a single HTTPS endpoint. No local processes, no npm packages, no binary to install.

***

## Endpoint

```
POST https://api.thrindex.com/mcp
```

All JSON-RPC 2.0 messages — `initialize`, `tools/list`, and `tools/call` — are sent to this single endpoint. The server is stateless; each request is independently authenticated.

***

## Authentication

Use any API key with the following scopes:

| Scope           | Required for                                           |
| --------------- | ------------------------------------------------------ |
| `memory:write`  | `store_memory` tool                                    |
| `memory:read`   | `search_memories`, `list_memories`, `get_memory` tools |
| `memory:delete` | `delete_memory` tool                                   |

Pass the key as a Bearer token in every request:

```
Authorization: Bearer th_live_...
```

Create and manage API keys in the [dashboard](https://app.thrindex.com). Selecting all three scopes when creating a key for an MCP client is recommended.

<Note>
  `org_id` is derived from your API key. It is never sent in the request body. Memory isolation is enforced at the API level — one key can never read another organization's data.
</Note>

***

## Client setup

<Tabs>
  <Tab title="Claude Desktop">
    Add the following to `claude_desktop_config.json`.

    **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\
    **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

    ```json theme={null}
    {
      "mcpServers": {
        "thrindex": {
          "type": "http",
          "url": "https://api.thrindex.com/mcp",
          "headers": {
            "Authorization": "Bearer th_live_..."
          }
        }
      }
    }
    ```

    Open **Settings → Developer → Edit Config** inside Claude Desktop to locate the file. Save and restart Claude Desktop after editing.
  </Tab>

  <Tab title="Claude Code">
    Run the following command once in your terminal:

    ```bash theme={null}
    claude mcp add thrindex \
      --transport http \
      https://api.thrindex.com/mcp \
      --header "Authorization: Bearer th_live_..."
    ```

    Verify the server registered correctly:

    ```bash theme={null}
    claude mcp list
    ```

    Thrindex memory tools are available in every Claude Code session after this.
  </Tab>

  <Tab title="Cursor">
    Open or create `~/.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "thrindex": {
          "url": "https://api.thrindex.com/mcp",
          "headers": {
            "Authorization": "Bearer th_live_..."
          }
        }
      }
    }
    ```

    Restart Cursor. The Thrindex tools appear in the agent tool list automatically.
  </Tab>

  <Tab title="GitHub Copilot">
    Create `.vscode/mcp.json` in your project root:

    ```json theme={null}
    {
      "servers": {
        "thrindex": {
          "type": "http",
          "url": "https://api.thrindex.com/mcp",
          "headers": {
            "Authorization": "Bearer th_live_..."
          }
        }
      }
    }
    ```

    Open **Copilot Chat**, switch to **Agent** mode, and Thrindex tools appear automatically. This configuration is workspace-scoped; add it to `.gitignore` if you don't want to commit your API key.

    <Note>
      Requires VS Code 1.99+ and the GitHub Copilot extension in Agent mode.
    </Note>
  </Tab>

  <Tab title="OpenAI Agents SDK">
    Install the SDK:

    ```bash theme={null}
    pip install openai-agents
    ```

    Instantiate `MCPServerStreamableHttp` and pass it to your agent:

    ```python theme={null}
    from agents import Agent, Runner
    from agents.mcp import MCPServerStreamableHttp

    thrindex = MCPServerStreamableHttp(
        name="thrindex",
        url="https://api.thrindex.com/mcp",
        headers={"Authorization": "Bearer th_live_..."},
    )

    agent = Agent(
        name="my-agent",
        instructions="Use Thrindex to store and recall memories for each user.",
        mcp_servers=[thrindex],
    )

    async with Runner() as runner:
        result = await runner.run(agent, "What do you know about me?")
    ```

    All five memory tools are available to the agent on every run. No custom tool definitions required.
  </Tab>

  <Tab title="Windsurf">
    Open or create `~/.codeium/windsurf/mcp_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "thrindex": {
          "serverUrl": "https://api.thrindex.com/mcp",
          "headers": {
            "Authorization": "Bearer th_live_..."
          }
        }
      }
    }
    ```

    In Windsurf, open **Cascade → hammer icon → Refresh** to load the new server.
  </Tab>

  <Tab title="Cline">
    Open **VS Code → Cline sidebar → MCP Servers → Configure MCP Servers** to open `cline_mcp_settings.json`. Add the following inside the `"mcpServers"` object:

    ```json theme={null}
    {
      "mcpServers": {
        "thrindex": {
          "type": "streamableHttp",
          "url": "https://api.thrindex.com/mcp",
          "headers": {
            "Authorization": "Bearer th_live_..."
          },
          "disabled": false
        }
      }
    }
    ```

    Save the file. Cline connects automatically.
  </Tab>

  <Tab title="Continue">
    Open or create `~/.continue/config.yaml` and add an `mcpServers` block:

    ```yaml theme={null}
    mcpServers:
      - name: thrindex
        type: streamable-http
        url: https://api.thrindex.com/mcp
        headers:
          Authorization: "Bearer th_live_..."
    ```

    Reload VS Code and switch Continue to **Agent** mode to activate MCP tools.
  </Tab>

  <Tab title="n8n">
    Install the [n8n-nodes-mcp](https://github.com/nerding-io/n8n-nodes-mcp) community package in your n8n instance, then set the environment variable:

    ```
    N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
    ```

    Restart n8n, then add an **MCP Client** node to an AI Agent workflow and configure it as follows:

    ```
    Connection Type : HTTP Streamable
    URL             : https://api.thrindex.com/mcp
    Additional Headers:
      Authorization : Bearer th_live_...
    ```

    All five Thrindex memory tools are available as AI Agent tools.
  </Tab>
</Tabs>

***

## Available tools

Once connected, your AI client has access to five tools:

| Tool              | Scope           | Description                                        |
| ----------------- | --------------- | -------------------------------------------------- |
| `store_memory`    | `memory:write`  | Persist a fact, preference, or piece of context    |
| `search_memories` | `memory:read`   | Semantic search over stored memories               |
| `list_memories`   | `memory:read`   | Browse memories in reverse-chronological order     |
| `get_memory`      | `memory:read`   | Retrieve the full content of a single memory by ID |
| `delete_memory`   | `memory:delete` | Soft-delete a memory by ID                         |

See the [Tool Reference](/mcp/tools) for the full parameter documentation and example tool calls for each.

***

## How memory is scoped

Every memory stored through MCP is scoped to three levels:

| Scope        | Source                                                   |
| ------------ | -------------------------------------------------------- |
| Organization | From your API key — automatic, never sent in the request |
| `agent_id`   | Passed as a tool argument (defaults to `"mcp-client"`)   |
| `user_id`    | Passed as a tool argument (defaults to `"default"`)      |

Use consistent, stable identifiers so memories accumulate correctly across sessions. For example, pass `agent_id="claude-desktop"` and `user_id="alice"` to isolate Alice's memories from other users' memories.

***

## Any MCP-compatible client

The endpoint follows the [MCP 2025-03-26 Streamable HTTP specification](https://spec.modelcontextprotocol.io/specification/2025-03-26/) exactly. Any client that implements this spec can connect using:

* **Transport:** Streamable HTTP (single POST endpoint)
* **Auth:** `Authorization: Bearer <api_key>` header
* **Protocol:** JSON-RPC 2.0

If your client is not listed above, use the configuration format it expects for a remote HTTP MCP server and point it at `https://api.thrindex.com/mcp`.
