MCP server
The Inntrig API exposes a Model Context Protocol (MCP) endpoint so that AI agents — Claude Code, Claude.ai, or any MCP-compatible client — can query audit data directly.
Endpoint
Section titled “Endpoint”| Environment | URL |
|---|---|
| Production | https://api-production-02d9.up.railway.app/mcp |
| Local | http://localhost:3001/mcp |
The server uses the Streamable HTTP transport (POST /mcp, GET /mcp).
Authentication
Section titled “Authentication”The MCP endpoint uses the same session cookie auth as the rest of the API. There is no separate API key.
To authenticate, your MCP client must send the better-auth.session_token cookie that is set when you sign in through the web app. In Claude Code you pass this as a header:
{ "headers": { "Cookie": "better-auth.session_token=<your-token>" }}Getting your session token
Section titled “Getting your session token”- Sign in at the web app
- Open DevTools → Application → Cookies
- Copy the value of
better-auth.session_token
Configuring Claude Code
Section titled “Configuring Claude Code”Add the server to .mcp.json in your project root (or ~/.claude/mcp.json for global use):
{ "mcpServers": { "inntrig": { "type": "http", "url": "https://api-production-02d9.up.railway.app/mcp", "headers": { "Cookie": "better-auth.session_token=<your-token>" } } }}For local development:
{ "mcpServers": { "inntrig-local": { "type": "http", "url": "http://localhost:3001/mcp", "headers": { "Cookie": "better-auth.session_token=<your-token>" } } }}Available tools
Section titled “Available tools”All tools are scoped to the authenticated user — they only return data the signed-in account owns.
list_projects
Section titled “list_projects”Returns all projects for the authenticated user.
No inputs required.list_audits
Section titled “list_audits”Returns all audits for a given project.
| Input | Type | Description |
|---|---|---|
projectId | string | ID of the project |
get_report
Section titled “get_report”Returns report metadata plus conformance summary counts (pass / fail / na / todo).
| Input | Type | Description |
|---|---|---|
reportId | string | ID of the report |
list_results
Section titled “list_results”Returns all criterion results for a report, including status and notes.
| Input | Type | Description |
|---|---|---|
reportId | string | ID of the report |
get_criterion
Section titled “get_criterion”Returns full details for a single WCAG criterion (ref, name, level, summary, guidance).
| Input | Type | Description |
|---|---|---|
criterionId | string | ID of the criterion |
Implementation
Section titled “Implementation”The MCP server is implemented in apps/api/src/routes/mcp.ts using @hono/mcp and @modelcontextprotocol/sdk. Each request creates a fresh server instance (stateless) so there are no session management concerns on the server side.