MCP Tools
Learn how to use Juro's Model Context Protocol (MCP) tools for AI-powered compliance analysis and GitHub Actions integration.
Overview
Juro v2.0.0 provides a comprehensive set of MCP tools that allow AI assistants to interact with your codebase, perform compliance analysis, and manage GitHub Actions workflows. These tools enable natural language queries about your code's compliance status and automated CI/CD integration.
Available Tools
Compliance Scanning Tools
scan_codebase
Scans your entire codebase for compliance violations.
{
"name": "scan_codebase",
"description": "Scan codebase for compliance violations",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path to the codebase to scan"
},
"rules": {
"type": "array",
"items": {"type": "string"},
"description": "Compliance rules to check (e.g., 'gdpr', 'soc2', 'owasp')"
},
"format": {
"type": "string",
"enum": ["json", "sarif", "text"],
"description": "Output format for scan results"
}
},
"required": ["path"]
}
}
Example Usage:
# Scan for GDPR compliance
juro scan --path ./my-project --rules gdpr --format json
# Scan for multiple compliance standards
juro scan --path ./my-project --rules gdpr,soc2,owasp --format sarif
analyze_file
Analyzes a specific file for compliance issues.
{
"name": "analyze_file",
"description": "Analyze a specific file for compliance violations",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string",
"description": "Path to the file to analyze"
},
"rules": {
"type": "array",
"items": {"type": "string"},
"description": "Compliance rules to check"
}
},
"required": ["file_path"]
}
}
Example Usage:
# Analyze a specific file
juro analyze --file ./src/auth.js --rules gdpr,owasp
ask_question
Ask natural language questions about your code's compliance.
{
"name": "ask_question",
"description": "Ask questions about code compliance in natural language",
"parameters": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "Natural language question about compliance"
},
"context": {
"type": "string",
"description": "Additional context or file paths to consider"
}
},
"required": ["question"]
}
}
Example Usage:
# Ask about GDPR compliance
juro ask "Does my authentication system comply with GDPR requirements?"
# Ask about specific code patterns
juro ask "Are there any SQL injection vulnerabilities in my database queries?"
GitHub Actions Tools (v2.0.0)
add_github_workflow
Adds a compliance workflow to your GitHub repository.
{
"name": "add_github_workflow",
"description": "Add a compliance workflow to GitHub repository",
"parameters": {
"type": "object",
"properties": {
"repo_path": {
"type": "string",
"description": "Path to the local repository"
},
"workflow_config": {
"type": "object",
"properties": {
"name": {"type": "string"},
"trigger": {"type": "string", "enum": ["push", "pull_request", "schedule"]},
"regulations": {"type": "array", "items": {"type": "string"}},
"fail_on_violations": {"type": "boolean"},
"fail_on_critical": {"type": "boolean"},
"min_score": {"type": "number"}
}
}
},
"required": ["repo_path", "workflow_config"]
}
}
Example Usage:
# Add GDPR compliance workflow
juro add-workflow --repo ./my-project --config gdpr-workflow.json
create_pr_workflow
Creates a PR-specific compliance workflow with automatic commenting.
{
"name": "create_pr_workflow",
"description": "Create a PR-specific compliance workflow",
"parameters": {
"type": "object",
"properties": {
"repo_path": {"type": "string"},
"pr_config": {
"type": "object",
"properties": {
"comment_on_violations": {"type": "boolean"},
"fail_on_critical": {"type": "boolean"},
"notify_channels": {"type": "array", "items": {"type": "string"}}
}
}
},
"required": ["repo_path", "pr_config"]
}
}
run_pr_compliance_check
Runs compliance check on a specific pull request.
{
"name": "run_pr_compliance_check",
"description": "Run compliance check on a pull request",
"parameters": {
"type": "object",
"properties": {
"pr_data": {
"type": "object",
"properties": {
"number": {"type": "number"},
"base_branch": {"type": "string"},
"head_branch": {"type": "string"},
"changed_files": {"type": "array", "items": {"type": "string"}}
}
},
"options": {
"type": "object",
"properties": {
"regulations": {"type": "array", "items": {"type": "string"}},
"severity_threshold": {"type": "string", "enum": ["LOW", "MEDIUM", "HIGH", "CRITICAL"]}
}
}
},
"required": ["pr_data"]
}
}
generate_compliance_report
Generates detailed compliance reports in multiple formats.
{
"name": "generate_compliance_report",
"description": "Generate compliance report from scan results",
"parameters": {
"type": "object",
"properties": {
"scan_results": {"type": "object"},
"report_options": {
"type": "object",
"properties": {
"format": {"type": "string", "enum": ["markdown", "html", "json", "sarif"]},
"include_details": {"type": "boolean"},
"include_trends": {"type": "boolean"},
"group_by": {"type": "array", "items": {"type": "string"}}
}
}
},
"required": ["scan_results"]
}
}
send_compliance_notifications
Sends compliance notifications to team channels.
{
"name": "send_compliance_notifications",
"description": "Send compliance notifications to team channels",
"parameters": {
"type": "object",
"properties": {
"compliance_data": {"type": "object"},
"notification_config": {
"type": "object",
"properties": {
"slack": {"type": "object", "properties": {"webhook": {"type": "string"}}},
"email": {"type": "object", "properties": {"recipients": {"type": "array", "items": {"type": "string"}}}},
"teams": {"type": "object", "properties": {"webhook": {"type": "string"}}}
}
}
},
"required": ["compliance_data", "notification_config"]
}
}
Integration Examples
With Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"juro": {
"command": "npx",
"args": ["@juro/mcp-server"],
"env": {
"JURO_API_KEY": "your-api-key-here"
}
}
}
}
With Cursor
Add to your Cursor settings:
{
"mcp": {
"servers": {
"juro": {
"command": "npx",
"args": ["@juro/mcp-server"],
"env": {
"JURO_API_KEY": "your-api-key-here"
}
}
}
}
}
Error Handling
All MCP tools return structured error responses:
{
"error": {
"code": "INVALID_PATH",
"message": "The specified path does not exist",
"details": {
"path": "/nonexistent/path"
}
}
}
Common Error Codes
Compliance Scanning Errors
INVALID_PATH- The specified path does not existINVALID_RULES- One or more specified rules are not supportedAPI_KEY_MISSING- API key is not configuredRATE_LIMIT_EXCEEDED- Too many requests in a short timeSCAN_FAILED- The scan operation failed
GitHub Actions Errors (v2.0.0)
GITHUB_TOKEN_MISSING- GitHub token is not configuredREPO_NOT_FOUND- Repository not found or inaccessibleWORKFLOW_CREATION_FAILED- Failed to create GitHub workflowPR_CHECK_FAILED- Pull request compliance check failedNOTIFICATION_FAILED- Failed to send team notificationsREPORT_GENERATION_FAILED- Failed to generate compliance report
Best Practices
1. Use Specific Rules
Instead of scanning for all rules, specify only the ones you need:
# Good: Specific rules
juro scan --rules gdpr,owasp
# Avoid: All rules (slower)
juro scan --rules all
2. Batch Operations
For multiple files, use the codebase scan instead of individual file analysis:
# Good: Scan entire directory
juro scan --path ./src
# Avoid: Multiple individual scans
juro analyze --file ./src/auth.js
juro analyze --file ./src/user.js
juro analyze --file ./src/payment.js
3. Use Appropriate Output Formats
Choose the right format for your use case:
json- For programmatic processingsarif- For security tools integrationtext- For human-readable output
Troubleshooting
Common Issues
-
Tool Not Found
- Ensure Juro MCP server is properly installed
- Check your AI assistant's MCP configuration
-
Permission Denied
- Verify API key is correct
- Check file system permissions
-
Scan Timeout
- Reduce the scope of your scan
- Use more specific rules
Getting Help
- Check the FAQ for common questions
- Review Error Codes for detailed error information
- Contact support for additional assistance