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

# Use with AI

> Let AI tools like Cursor and Claude Code search Sentrial docs to instrument your agents automatically.

Sentrial provides an MCP (Model Context Protocol) server that lets AI coding tools search our documentation directly. Ask your AI to "instrument my agent with Sentrial" and it will pull the right docs, code examples, and API references automatically.

## Install with Claude Code

Run this in your terminal:

```bash theme={null}
claude mcp add --transport http Sentrial https://www.sentrial.com/docs/mcp
```

That's it. The `SearchSentrial` tool is now available in all your Claude Code sessions.

<Tip>
  To share this with your whole team, add `--scope project` to write it to `.mcp.json` in your repo root. Anyone who clones the repo gets the tool automatically.
</Tip>

## Install with Cursor

1. Open Cursor Settings (`Cmd + ,` / `Ctrl + ,`)
2. Go to the **MCP** section
3. Click **Add new MCP server**
4. Set the type to **SSE** and the URL to:

```
https://www.sentrial.com/docs/mcp
```

Or add it directly to `.cursor/mcp.json` in your project:

```json theme={null}
{
  "mcpServers": {
    "sentrial": {
      "type": "sse",
      "url": "https://www.sentrial.com/docs/mcp"
    }
  }
}
```

## What You Can Do

Once connected, just ask your AI assistant naturally:

* *"Instrument my agent with Sentrial"*
* *"Add Sentrial tracking to my LangChain agent"*
* *"How do I track tool calls with the Python SDK?"*
* *"Set up Sentrial with the Vercel AI SDK"*

The AI will search our docs and write the integration code for you.

## MCP Prompt Tips

For Claude Agent SDK integrations, include your language and runtime behavior in the prompt so the
assistant returns the correct pattern:

* *"Set up Claude Code Python tracking with `wrap_claude_agent` (for `query()`) or `wrap_claude_client` (for `ClaudeSDKClient`), and make sure sessions finalize with tokens/cost."*
* *"For Claude Code TypeScript, ensure early stream exits are handled so sessions don't stay `running`."*
* *"Show me the error-handling pattern for Claude Code wrappers, including generator-close behavior."*
* *"I'm using `ClaudeSDKClient` for multi-turn conversations — show me how to track each turn as a Sentrial session with `wrap_claude_client`."*

## How It Works

The MCP server exposes a single `SearchSentrial` tool. When your AI assistant needs information about Sentrial, it calls this tool with a search query and gets back relevant documentation with code examples, API references, and direct links.

No API key is needed — the docs MCP is public and read-only.
