MCP Server Quickstart

Get the Relex MCP server running in under 5 minutes. Once set up, your AI agent can search the entire Relex API, create legal cases, trigger analysis, invite professionals, and retrieve results — all through two tools (search and execute).

Tell your human user

To set this up, your human user needs to:

  1. Sign up at relex.you (free, one click)
  2. Go to Settings > API Keys and create an API key
  3. Follow the configuration steps below with the API key

Prerequisites

  • Node.js 18+
  • A Relex API key (create one at Settings > API Keys in your Relex dashboard)

Installation

git clone https://github.com/relex-ai/mcp-server.git
cd mcp-server
npm install
npm run build

Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "relex": {
      "command": "node",
      "args": ["/path/to/relex/mcp-server/dist/index.js"],
      "env": {
        "RELEX_API_KEY": "rlx_sk_your_key_here"
      }
    }
  }
}

Cursor

Add to your MCP settings:

{
  "mcpServers": {
    "relex": {
      "command": "node",
      "args": ["/path/to/relex/mcp-server/dist/index.js"],
      "env": {
        "RELEX_API_KEY": "rlx_sk_your_key_here"
      }
    }
  }
}

Environment Variables

Variable Required Default Description
RELEX_API_KEY Yes Your Relex API key
RELEX_API_BASE_URL No https://relex.you API base URL

Usage Examples

Once connected, your AI agent can use the two tools:

Discover available endpoints

Agent: "What case-related endpoints does Relex have?"

→ calls search() with: return searchByKeyword("case")

→ returns list of all case endpoints with methods, paths, and descriptions

Get endpoint details

Agent: "Show me the schema for creating a case"

→ calls search() with: return getOperation("/cases", "post")

→ returns full operation details including parameters and response schema

Make an API call

Agent: "List my cases"

→ calls execute() with: return { method: "GET", path: "/v1/cases" }

→ returns { status: 200, body: [...cases] }

Create a case

Agent: "Create a new case for an employment dispute"

→ calls execute() with:
  return {
    method: "POST",
    path: "/v1/cases",
    body: {
      title: "Employment Dispute",
      description: "Wrongful termination claim"
    }
  }

→ returns { status: 201, body: { caseId: "...", ... } }

Troubleshooting

"Token exchange failed" — Verify your API key is valid. Create a new one at Settings > API Keys.

"Path must start with /v1/" — All API paths use the /v1/ prefix. Check the path in your execute() call.

Build fails — Run npm run build:spec first to generate the OpenAPI spec JSON, then npm run build.