Rival Regulatory Toolkit
LocalAbout Rival Regulatory Toolkit
Rival Regulatory Toolkit is an open-source SDK, CLI, and MCP server for developers and agents retrieving regulatory sources through Rival's API. Its read-only scope covers search, source text, citation tracing, authorities, and recent filings; fixture mode supports evaluation without an API key.
Key features
- 01Search regulatory sources
- 02Retrieve source text
- 03Trace citations
- 04List authorities and recent filings
- 05Fixture mode for evaluation
Use cases
- 01Find regulatory material for an agent
- 02Check the text behind a source
- 03Trace citations in regulatory research
- 04Evaluate the integration without an API key
MCP support
The MCP server exposes tools for regulatory corpus search, source retrieval, citation tracing, authority listing, and recent filings. Operations are read-only.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y @tryrival/regulatory-toolkitRIVAL_API_KEYSecretManaged Rival API key. Required for production API access.RIVAL_API_BASE_URLRival API base URL. Defaults to https://api.tryrival.ai.RIVAL_FIXTURE_MODESet to true to run against the bundled sample corpus without API access.Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
5Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | |
| query | string | Yes | Natural language query or citation. |
| authority | string | No | Optional authority slug, such as phmsa or epa. |
| sourceType | string | No | Optional source type filter, such as cfr, fr, tac, or sibr. |
| jurisdiction | string | No | Optional jurisdiction filter, such as federal or texas. |
Details
From the project READMERival Regulatory Toolkit
Open-source SDK, CLI, MCP server, and schemas for connecting AI agents to Rival's source-grounded regulatory retrieval API.
- Public site: https://tryrival.ai
- Agent access: https://tryrival.ai/for-agents
- Managed API default:
https://api.tryrival.ai
This repository is the developer and agent connectivity layer for Rival. It is intentionally read-only in its first release: agents can search, retrieve source text, trace citations, list authorities, and inspect recent filings. Workspace actions, document review, evidence requests, filings, and task creation remain behind managed Rival access and human review gates.
What Is Included
- OpenAPI contract for Rival's read-only regulatory retrieval API.
- JSON Schemas for source documents, search results, citations, authorities, and recent filings.
- TypeScript client for server-side applications and internal tools.
- CLI for shell usage and automation.
- MCP server for agent clients that support Model Context Protocol.
- Fixture mode so teams can evaluate the integration without a Rival API key.
- Dockerfile for running the MCP server in controlled team environments.
Install
npm install @rival-intelligence/regulatory-toolkit
For local development from source:
npm install
npm run build
Environment
export RIVAL_API_KEY="rv_live_..."
export RIVAL_API_BASE_URL="https://api.tryrival.ai"
For local evaluation without API access:
export RIVAL_FIXTURE_MODE=true
TypeScript Client
import { RivalRegulatoryClient } from '@rival-intelligence/regulatory-toolkit';
const rival = new RivalRegulatoryClient({
apiKey: process.env.RIVAL_API_KEY,
});
const results = await rival.searchRegulatoryCorpus({
query: '49 CFR 195.573',
limit: 5,
});
console.log(results.results[0]?.source.citation);
CLI
rival-regulatory search "49 CFR 195.573"
rival-regulatory source "cfr-49-195-573"
rival-regulatory trace "49 CFR 195.573"
rival-regulatory authorities
Fixture mode:
rival-regulatory search "pipeline corrosion" --fixture
MCP Server
Run directly:
npx @rival-intelligence/regulatory-toolkit mcp
MCP client example:
{
"mcpServers": {
"rival-regulatory": {
"command": "npx",
"args": ["-y", "@rival-intelligence/regulatory-toolkit", "mcp"],
"env": {
"RIVAL_API_KEY": "rv_live_...",
"RIVAL_API_BASE_URL": "https://api.tryrival.ai"
}
}
}
}
Available MCP tools:
search_regulatory_corpusretrieve_source_texttrace_citationlist_authoritiesget_recent_filings
Docker
Docker belongs in this repository because many compliance, legal, consulting, energy, and infrastructure teams will run agent tools inside controlled environments. The image runs the MCP server and reads credentials from environment variables.
docker build -t rival-regulatory-toolkit .
docker run --rm -i \
-e RIVAL_API_KEY="$RIVAL_API_KEY" \
-e RIVAL_API_BASE_URL="https://api.tryrival.ai" \
rival-regulatory-toolkit
Fixture mode:
docker run --rm -i -e RIVAL_FIXTURE_MODE=true rival-regulatory-toolkit
See docs/self-hosting.md for deployment notes.
API Contract
The API contract starts with five read-only endpoints:
GET /api/v1/searchGET /api/v1/sources/{source_id}GET /api/v1/citations/traceGET /api/v1/authoritiesGET /api/v1/filings/recent
The contract lives in openapi/rival-regulatory-api.yaml.
Safety Boundary
This toolkit does not submit filings, alter compliance records, close corrective actions, delete evidence, or take workspace actions. It is a source retrieval and citation layer for agents and developer systems. Regulated work still requires qualified human review.
This toolkit is not legal, engineering, environmental, safety, or compliance advice. Teams are responsible for validating applicability, obligations, filings, and operational decisions with qualified professionals.
Development
npm install
npm run build
npm test
License
Apache-2.0
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.