CLI and MCP server for Pretorin Compliance API
Project description
AI Compliance tools for developers.
We believe that compliance should be easy for developers. We now have AI machines the can write the detailed security documents that used to rob developers of their time and focus. We are building the tool kit to make this a reality. To that end, this is a CLI and MCP server for the Pretorin Compliance Platform API. It makes it easy to bring high quality compliance context into your favorite AI tool. Access enriched compliance framework data, control families, and control details from NIST 800-53, NIST 800-171, FedRAMP, CMMC, and many more to come
Installation
Stable (PyPI)
pip install pretorin
We recommend using uv or pipx for isolated installation:
uv tool install pretorin
pipx install pretorin
Latest (GitHub)
Install the latest development version directly from GitHub:
pip install git+https://github.com/pretorin-ai/pretorin-cli.git
Or with uv:
uv tool install git+https://github.com/pretorin-ai/pretorin-cli.git
Updating
Check for updates and upgrade:
pretorin update
Quick Start
Get your API key from https://platform.pretorin.com/, then authenticate:
pretorin login
Verify your authentication:
pretorin whoami
MCP Integration
The Pretorin CLI includes an MCP (Model Context Protocol) server that enables AI assistants to access compliance framework data directly during conversations.
Why MCP?
- Real-time data — Query the latest compliance frameworks and controls
- Reduce hallucination — Work with authoritative compliance data instead of training knowledge
- Streamline workflows — No copy-pasting between tools
Setup
Install and authenticate first:
uv tool install pretorin
pretorin login
Then add Pretorin to your AI tool of choice:
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.
Claude Code
Quick setup — run a single command:
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 Code will detect the file automatically.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"pretorin": {
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
Restart Cursor after saving.
OpenAI Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.pretorin]
command = "pretorin"
args = ["mcp-serve"]
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"pretorin": {
"command": "pretorin",
"args": ["mcp-serve"]
}
}
}
Restart Windsurf after saving.
Available Tools
| Tool | Description |
|---|---|
pretorin_list_frameworks |
List all compliance frameworks |
pretorin_get_framework |
Get framework metadata |
pretorin_list_control_families |
List control families for a framework |
pretorin_list_controls |
List controls (with optional family filter) |
pretorin_get_control |
Get detailed control information |
pretorin_get_control_references |
Get control guidance and references |
pretorin_get_document_requirements |
Get 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.
CLI Reference
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 |
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) |
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.
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.2.1.tar.gz.
File metadata
- Download URL: pretorin-0.2.1.tar.gz
- Upload date:
- Size: 283.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b18060f607283ba040e1a70c73834ee7d14f2a8247a98be7e12685db12c5072b
|
|
| MD5 |
9f2e76c22bea836b77c46ad613e7b686
|
|
| BLAKE2b-256 |
bdb7b77efe42afb8ef19087428d277b6a26218bd60aff160f214f78bf9e025a0
|
Provenance
The following attestation bundles were made for pretorin-0.2.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.2.1.tar.gz -
Subject digest:
b18060f607283ba040e1a70c73834ee7d14f2a8247a98be7e12685db12c5072b - Sigstore transparency entry: 942065254
- Sigstore integration time:
-
Permalink:
pretorin-ai/pretorin-cli@5727e6c7d66fb0cf967e8791432393f1ca6acbb3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/pretorin-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5727e6c7d66fb0cf967e8791432393f1ca6acbb3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pretorin-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pretorin-0.2.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 |
5eb74e0d69390844127e2b179d82071022033994f78db948e1afc66114a9443b
|
|
| MD5 |
1986ef502aea4000591f9614219649dc
|
|
| BLAKE2b-256 |
b6fff9d4ffd3e130671ce85ba58d68a4445b7667f42590db217ca0a2400423fc
|
Provenance
The following attestation bundles were made for pretorin-0.2.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.2.1-py3-none-any.whl -
Subject digest:
5eb74e0d69390844127e2b179d82071022033994f78db948e1afc66114a9443b - Sigstore transparency entry: 942065282
- Sigstore integration time:
-
Permalink:
pretorin-ai/pretorin-cli@5727e6c7d66fb0cf967e8791432393f1ca6acbb3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/pretorin-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5727e6c7d66fb0cf967e8791432393f1ca6acbb3 -
Trigger Event:
release
-
Statement type: