CLI and MCP server for Pretorin Compliance API
Project description
Compliance tools for developers. Integrate with AI agents or your CI pipeline.
Pretorin brings compliance into your development workflow. Use the MCP server to give AI agents direct access to authoritative control data, not hallucinated requirements. Use the CLI to query frameworks, controls, and document requirements from your terminal or CI pipeline. Both connect to the same API with enriched data for NIST 800-53, NIST 800-171, FedRAMP, CMMC, and more.
Quick Start
Get your API key from platform.pretorin.com, then:
uv tool install pretorin
pretorin login
That's it. Now add Pretorin to your AI tool below.
Add to Your AI Tool
Claude Code
claude mcp add --transport stdio pretorin -- pretorin mcp-serve
This registers the server for your current project. To make it available across all your projects, add --scope user.
Team setup - add a .mcp.json file to your project root so every team member gets the server automatically:
{
"mcpServers": {
"pretorin": {
"type": "stdio",
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"pretorin": {
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
Restart Claude Desktop after saving.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"pretorin": {
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
Restart Cursor after saving.
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"pretorin": {
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
Restart Windsurf after saving.
OpenAI Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.pretorin]
command = "pretorin"
args = ["mcp-serve"]
Available Tools
| Tool | Description |
|---|---|
pretorin_list_frameworks |
List all compliance frameworks with tier and category info |
pretorin_get_framework |
Get framework metadata including AI context (purpose, target audience, regulatory context, scope, key concepts) |
pretorin_list_control_families |
List control families with AI context (domain summary, risk context, implementation priority) |
pretorin_list_controls |
List controls with optional family filter |
pretorin_get_control |
Get detailed control info including AI guidance (summary, intent, evidence expectations, implementation considerations, common failures) |
pretorin_get_control_references |
Get control statement, guidance, objectives, parameters, and related controls |
pretorin_get_document_requirements |
Get explicit and implicit document requirements for a framework |
Resources
| Resource URI | Description |
|---|---|
analysis://schema |
Compliance artifact JSON schema |
analysis://guide/{framework_id} |
Framework analysis guide |
analysis://control/{control_id} |
Control analysis guidance |
Example Prompts
Try asking your AI assistant:
- "What compliance frameworks are available for government systems?"
- "What are the Account Management requirements for FedRAMP Moderate?"
- "What documents do I need for NIST 800-171 compliance?"
- "Show me all Audit controls in NIST 800-53"
For comprehensive MCP documentation, see docs/MCP.md.
Supported Frameworks
The initial public release includes these Government Core frameworks:
- NIST SP 800-53 Rev 5
- NIST SP 800-171 Rev 2
- FedRAMP (Low, Moderate, High)
- CMMC Level 1, 2, and 3
Additional frameworks are available on the platform. See platform.pretorin.com/api/docs for the full list.
CLI Reference
Pretorin also includes a full CLI for working with compliance data directly in the terminal. For comprehensive documentation with real terminal output examples, see docs/CLI.md.
Quick Examples
# List all frameworks
pretorin frameworks list
# Get framework details
pretorin frameworks get fedramp-moderate
# List control families (IDs are slugs like "access-control", not "ac")
pretorin frameworks families nist-800-53-r5
# List controls filtered by family
pretorin frameworks controls nist-800-53-r5 --family access-control --limit 10
# Get control details (IDs are zero-padded: "ac-01", not "ac-1")
pretorin frameworks control nist-800-53-r5 ac-02
# Get full control details with statement, guidance, and related controls
pretorin frameworks control nist-800-53-r5 ac-02 --references
All Commands
| Command | Description |
|---|---|
pretorin login |
Authenticate with the Pretorin API |
pretorin logout |
Clear stored credentials |
pretorin whoami |
Display current authentication status |
pretorin frameworks list |
List all compliance frameworks |
pretorin frameworks get <id> |
Get framework details |
pretorin frameworks families <id> |
List control families |
pretorin frameworks controls <id> |
List controls (--family, --limit) |
pretorin frameworks control <framework> <control> |
Get control details (--references) |
pretorin frameworks documents <id> |
Get document requirements |
pretorin config list |
List all configuration |
pretorin config get <key> |
Get a config value |
pretorin config set <key> <value> |
Set a config value |
pretorin config path |
Show config file path |
pretorin version |
Show CLI version |
pretorin update |
Update to latest version |
pretorin mcp-serve |
Start the MCP server |
Installation
Stable (PyPI)
We recommend using uv or pipx for isolated installation:
uv tool install pretorin
pipx install pretorin
Or with pip:
pip install pretorin
Latest (GitHub)
Install the latest development version directly from GitHub:
uv tool install git+https://github.com/pretorin-ai/pretorin-cli.git
Updating
pretorin update
Configuration
Credentials are stored in ~/.pretorin/config.json.
Environment Variables
| Variable | Description |
|---|---|
PRETORIN_API_KEY |
API key (overrides stored config) |
PRETORIN_API_BASE_URL |
Custom API URL (default: https://platform.pretorin.com/api/v1) |
Development
Setup
git clone https://github.com/pretorin-ai/pretorin-cli.git
cd pretorin-cli
uv pip install -e ".[dev]"
Or with pip:
pip install -e ".[dev]"
Running Tests
pytest
With coverage:
pytest --cov=pretorin --cov-report=term-missing
Docker Testing
# Run all tests
docker-compose run --rm test
# Run linter
docker-compose run --rm lint
# Run type checker
docker-compose run --rm typecheck
# Or use the convenience script
./scripts/docker-test.sh all
Type Checking
mypy src/pretorin
Linting
ruff check src/pretorin
ruff format --check src/pretorin
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
MCP Registry
This server is listed on the official MCP Registry.
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pretorin-0.3.1.tar.gz.
File metadata
- Download URL: pretorin-0.3.1.tar.gz
- Upload date:
- Size: 295.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84734d2c34b1eae99df83faa7eafb0a041b2c45a66cd586d6989fd87cc3290a6
|
|
| MD5 |
9681b795af364f25a8fdb09d85bb9e91
|
|
| BLAKE2b-256 |
81ad013c076cef8e2f2d67904fbc4ea79f4d5bd7ba6de1f07167088a5ff2e769
|
Provenance
The following attestation bundles were made for pretorin-0.3.1.tar.gz:
Publisher:
publish.yml on pretorin-ai/pretorin-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretorin-0.3.1.tar.gz -
Subject digest:
84734d2c34b1eae99df83faa7eafb0a041b2c45a66cd586d6989fd87cc3290a6 - Sigstore transparency entry: 951570824
- Sigstore integration time:
-
Permalink:
pretorin-ai/pretorin-cli@9745ae4989289219abd92a37f1e34aced5a29f4d -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/pretorin-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9745ae4989289219abd92a37f1e34aced5a29f4d -
Trigger Event:
release
-
Statement type:
File details
Details for the file pretorin-0.3.1-py3-none-any.whl.
File metadata
- Download URL: pretorin-0.3.1-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02c07ef974b909cb24a0b709cc68bd5662baddba2feb98a97b28ac094992bcba
|
|
| MD5 |
1423f0e865c0e95a6bc09c4de6f85a77
|
|
| BLAKE2b-256 |
45ea0b988298a02bae85df1fbdaf84baa707d6d177d133d4baf608512a7f68e6
|
Provenance
The following attestation bundles were made for pretorin-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on pretorin-ai/pretorin-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretorin-0.3.1-py3-none-any.whl -
Subject digest:
02c07ef974b909cb24a0b709cc68bd5662baddba2feb98a97b28ac094992bcba - Sigstore transparency entry: 951570907
- Sigstore integration time:
-
Permalink:
pretorin-ai/pretorin-cli@9745ae4989289219abd92a37f1e34aced5a29f4d -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/pretorin-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9745ae4989289219abd92a37f1e34aced5a29f4d -
Trigger Event:
release
-
Statement type: