CleverCase

MCP Tools

Platform Rakontevr MCP catalog and CleverCase cc_* legal workflow tools

MCP Tools

CleverCase agents route stories, inference, docs, and domain search through the rakontevr MCP server (tenant-scoped). The tenant plugin (@clevercase/rak-plugin) registers 12 CleverCase-specific cc_* tools alongside the platform catalog.

Setup

clevercase setup
# writes .cursor/mcp.json with RAK_TENANT_ID=00000000-0000-4000-a000-000000000003

Tenant preset: RAK_MCP_PRESET=client (reduced catalog — no fleet/deploy tools).

Platform MCP tools (tenant-allowed)

IntentToolNotes
Backlogrsp_storiesSource of truth when DATABASE_URL set
Tasksrsp_tasksTaskStore-backed dispatch
Create storyrsp_story_create → rsp_stories_pushPush to Postgres
Pipeline (tenant)rsp_execute_tenantNot platform rsp_execute
Phase gatersp_checkRun before phase-7 code drops
Run auditrsp_run_status, rsp_auditVerify phase evidence
AI queryai_query, ai_statusGateway-routed inference
Legal Q&Arsp_ask_iorekIorek with persona/domain
Domain rulesbusiness_rules_search, workflow_searchDistilled legal rules
Tenant RAGrak_extension_rag_queryExtension-scoped retrieval
Docsdocs_index, docs_validateFilesystem canonical
Healthcursor_doctor, cursor_team_contextSession bootstrap
Gatewaygateway_statusHosted gateway reachability
Secrets metadatasecrets_list, secrets_auditNo secret values

Blocked for client org

rsp_execute, rsp_plan_and_dispatch, dgx_fleet_status, fleet_*, deploy/rollback tools, rsp_security_scan.

CleverCase cc_* tools

Defined in packages/rak-plugin-clevercase/src/mcp-tools.ts. Twelve tools cover case management, compliance, trust accounting, billing, documents, conflicts, and legal research.

Case management

ToolDescriptionRequired params
cc_case_searchSearch cases by term and statusterm
cc_case_statusCase status and timelinecaseId
cc_matter_createCreate a new matterclientId, title, practiceArea, leadAttorney

Compliance

ToolDescriptionRequired params
cc_compliance_checkSOC 2 / HIPAA / ABA check for an actionaction, userId, targetType, targetId
cc_compliance_reportPeriod compliance reportstartDate, endDate

Trust accounting (IOLTA)

ToolDescriptionRequired params
cc_trust_balanceCurrent trust account balanceaccountId
cc_trust_transaction_logTrust transaction historyaccountId, startDate, endDate

Billing

ToolDescriptionRequired params
cc_time_entry_createCreate billable time entrymatterId, userId, hours, description, billable
cc_invoice_generateGenerate matter invoicematterId, billingPeriod

Documents & conflicts

ToolDescriptionRequired params
cc_document_searchSearch matter documentsquery
cc_conflict_checkConflict-of-interest screeningclientName
ToolDescriptionRequired params
cc_legal_researchIntegrated legal researchquery

Agent discipline

  1. One MCP call per tool per turn — reuse JSON; do not re-call to confirm.
  2. Session start: cursor_doctor once, then rsp_stories for backlog.
  3. Legal domain: call business_rules_search + workflow_search before rsp_ask_iorek with personaId: "gladys", domain: "legal".
  4. Watch _rakMcpBudget — stop new calls when usedPct is high.
rsp_ask_iorek({
  question: "What are IOLTA trust posting rules?",
  personaId: "gladys",
  tenantId: "00000000-0000-4000-a000-000000000003",
  domain: "legal",
  model: "iorek"
})

Audit correlation

MCP audit log: .rakontevr/logs/mcp-tool-audit.jsonl

FieldSource
sessionIdRAK_CURSOR_SESSION_ID
tenantIdMCP server env
rspRunId, storyIdOptional MCP env
traceIdGateway X-Trace-Id

MCP scaling architecture

Failover order: local stdio → cluster nodes → hosted cloud gateway. All connections require RAKONTEVR_SERVICE_KEY + X-Tenant-Id header.

On this page