Skip to main content

MCP Server

Releval ships with a built-in Model Context Protocol (MCP) server that exposes a curated subset of the API as tools an AI assistant can call. Point Claude Code or another MCP-compatible client at it and you can ask, in natural language, to "list my evaluations", "create a run for evaluation X", or "show me the judgments I've made for this query" — without writing curl commands by hand.

The MCP server lives at /mcp on the same host as your Releval REST API.

Authentication

The MCP server uses the same OAuth 2.0 client-credentials flow as the rest of the API. You authenticate by:

  1. Creating an App Client for the MCP integration.
  2. Exchanging the client credentials for a JWT bearer token at /api/v1/oauth2/token.
  3. Sending the token in the Authorization: Bearer … header on MCP requests.

Most MCP clients (including Claude Code) handle the OAuth flow automatically once you tell them the server URL — they discover the authorisation server from the protected-resource metadata Releval exposes.

Available tools

Tools are grouped by domain. Each tool maps onto a REST endpoint with the same semantics — license limits, role checks, validation, and audit logging all apply to MCP calls just as they do to API calls.

Search endpoints

ToolWhat it does
list_search_endpointsLists all configured search endpoints.
get_search_endpointGets a single endpoint by ID.
create_search_endpointCreates a new endpoint and (optionally) attaches it to an existing corpus.
update_search_endpointUpdates an endpoint's name, URL, method, or candidates mapping.
delete_search_endpointsDeletes one or more endpoints.
test_search_endpointTests an unsaved endpoint configuration with a live request.
test_existing_search_endpointTests a saved endpoint, optionally overriding fields for the test only.

Query sets and templates

ToolWhat it does
list_query_setsLists query sets, optionally including each set's queries.
get_query_setGets a query set with its queries.
create_query_setCreates a new query set from inline queries.
delete_query_setsDeletes one or more query sets.
list_query_templatesLists all query templates.
get_query_templateGets a single query template.
create_query_templateCreates a new Handlebars query template.
update_query_templateUpdates an existing query template.
delete_query_templatesDeletes one or more query templates.
test_query_templateRenders a query template against sample queries.

Evaluations and runs

ToolWhat it does
create_evaluationCreates a new evaluation linking an endpoint, query set, and query template.
list_evaluationsLists all evaluations.
get_evaluationGets a single evaluation.
update_evaluationUpdates an evaluation.
delete_evaluationsDeletes one or more evaluations.
create_evaluation_runCreates a run for an evaluation, choosing a scale and metrics.
list_evaluation_runsLists runs for an evaluation, most recent first.
get_evaluation_runGets a run with status, metrics, and config.
start_evaluation_runStarts a Pending run.
clone_evaluation_runClones a run with the same configuration.
lock_evaluation_runLocks a run, freezing its judgments.
update_evaluation_run_tagsSets tags on a run.
compare_evaluation_runsCompares a run against a baseline.
delete_evaluation_runsDeletes one or more runs.
list_evaluation_queriesLists the queries on a run, paginated.
list_evaluation_query_resultsLists the candidates returned for a specific query.
list_metricsLists the available metrics that can be computed.

Judgments

ToolWhat it does
list_judgmentsLists your judgments for a query within a corpus.
upsert_judgmentsCreates or updates judgments.

Configuring an MCP client

Claude Code

Add Releval as an MCP server in Claude Code's settings. The exact UI depends on your version, but the configuration looks like:

{
"mcpServers": {
"releval": {
"url": "https://${RELEVAL_HOST}/mcp"
}
}
}

Claude Code will prompt you to authenticate the first time it connects, and will perform the OAuth client-credentials exchange against /api/v1/oauth2/token using credentials you supply.

Generic MCP clients

Any MCP client supporting OAuth-protected resources can connect:

  • Resource URL: https://${RELEVAL_HOST}/mcp
  • Authorisation server: https://${RELEVAL_HOST}/api/v1/oauth2/token
  • Grant type: client_credentials

The client should fetch protected-resource metadata at the resource URL to discover the authorisation server automatically.

Permissions

MCP calls inherit the role and license limits of the App Client whose token is presented:

  • A client without Admin role cannot perform admin-only operations (e.g. creating shared resources on behalf of others).
  • License limits apply identically — create_evaluation returns a license-limit error if the workspace is at its evaluation cap.
  • All MCP tool invocations are logged with the calling member, the same as REST API calls.

When to use MCP vs. the REST API

Use MCP when an AI assistant is the natural driver — exploration ("what evaluations have I run this week?"), conversational construction ("create a run for the latest production endpoint, NDCG@10 and MAP, tag it experiment-rerank-v2"), or pulling Releval data into an LLM workflow.

Use the REST API for everything else: programmatic integration, CI pipelines, scheduled jobs, anything that benefits from explicit, replayable requests.