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

# MCP Server

> Add a RAIL safety layer to any agent in one URL, over the Model Context Protocol.

The RAIL Score **MCP Server** exposes RAIL's evaluation, agent-guardrail, and
India DPDP compliance capabilities to any [Model Context Protocol](https://modelcontextprotocol.io)
client — Claude, ChatGPT, Cursor, GitHub Copilot, Replit Agent, LangGraph,
CrewAI, or a custom stack — with no SDK integration.

```
https://mcp.responsibleailabs.ai/mcp
```

It is a thin, hardened gateway in front of the same REST API documented under
**API Reference**. Credits, tenancy, and rate limits are identical whether you
call RAIL via MCP or REST.

## When to use MCP vs the SDK

<CardGroup cols={2}>
  <Card title="Use the MCP server" icon="robot">
    Inside an agent runtime that supports remote MCP. The agent discovers and
    calls RAIL tools automatically as part of its loop.
  </Card>

  <Card title="Use the SDK" icon="code">
    Inside your own application code. The
    [Python](/sdk/python/overview) and [JavaScript](/sdk/javascript/overview)
    SDKs remain the right tool for direct, programmatic calls.
  </Card>
</CardGroup>

## Authentication

Phase 1 uses your existing RAIL API key, sent as a header. Two equivalent forms
are accepted, so it works with clients and registry gateways alike:

```
Authorization: Bearer rail_your_key
```

```
X-API-Key: rail_your_key
```

Use whichever your client makes easiest — a "Bearer token" field, or a custom
header named `X-API-Key`. Get a key from the
[dashboard](https://responsibleailabs.ai/dashboard). OAuth 2.1 (one-click connect
in the Claude and ChatGPT connector directories) is on the roadmap.

## Tools and resources

Nine `rail_`-prefixed tools and three free, read-only resources. `rail_evaluate`
also accepts an optional per-dimension `policy` (enforced inline, or deferring to
your application's dashboard policy). See the full reference on
[Tools](/mcp/tools), connection guides on [Connect](/mcp/connect), and the safety
posture on [Security](/mcp/security).

## The guarded agent loop

1. `rail_detect_injection` on untrusted input before acting on it.
2. `rail_evaluate_tool_call` before executing a tool call — a `block` verdict is
   a hard stop.
3. `rail_scan_tool_result` on the tool's output, and prefer the redacted text.
4. `rail_evaluate` (deep) on the draft answer, or `rail_safe_regenerate` to fix
   it server-side.
5. `rail_dpdp_scan` (mask) on anything leaving your boundary, for India
   deployments.
