Labsco
Elnino0009 logo

RegGuard

โ˜… 3

from Elnino0009

AI-powered regulatory compliance checking for financial marketing content across multiple jurisdictions.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

RegGuard MCP Server ๐Ÿ›ก๏ธ

AI-Enhanced Financial Marketing Compliance Server using Model Context Protocol (MCP)

RegGuard is a sophisticated MCP (Model Context Protocol) server that provides AI-powered regulatory compliance checking for financial marketing content. It leverages OpenAI's GPT-4o-mini model combined with jurisdiction-specific regulatory knowledge to detect violations across multiple financial markets.

Python OpenAI MCP License

๐ŸŽฏ What Does RegGuard Do?

RegGuard acts as an intelligent compliance assistant that:

  • ๐Ÿ” Analyzes Marketing Content: Uses AI to scan financial marketing materials for regulatory violations
  • ๐ŸŒ Multi-Jurisdiction Support: Covers Singapore (SG), Hong Kong (HK), UAE (AE), and India (IN) regulations
  • โšก Real-time Compliance Checking: Integrates seamlessly with AI assistants like Claude and Cursor
  • ๐Ÿ“‹ Automatic Disclaimer Insertion: Intelligently places required regulatory disclaimers
  • ๐Ÿ“Š Audit Trail Generation: Maintains tamper-proof logs of all compliance checks
  • ๐ŸŽฏ Contextual AI Analysis: Goes beyond pattern matching to understand regulatory nuances

๐Ÿง  Key Concepts & Educational Resources

Understanding MCP (Model Context Protocol)

Financial Regulatory Compliance Basics

AI-Powered Compliance Technology

๐Ÿ› ๏ธ Available Tools & Features

1. check_rule_violation - AI Compliance Analysis

Analyzes marketing content for regulatory violations across multiple jurisdictions.

Example Usage:

@regguard Check this content for Singapore violations:
"Join our exclusive investment club! Guaranteed profits of 25% annually with zero risk to your capital. Limited time offer - only 48 hours remaining!"

Response Includes:

  • Detailed violation descriptions
  • Severity levels (Critical, High, Medium, Low)
  • Matched content highlights
  • Regulatory references
  • Actionable recommendations

2. auto_insert_disclaimer - Smart Disclaimer Placement

Automatically inserts jurisdiction-appropriate disclaimers in optimal locations.

Example:

@regguard Add appropriate disclaimers for this Singapore investment ad:
<div>
  <h2>Investment Opportunity</h2>
  <p>High potential returns available.</p>
  <button>Invest Now</button>
</div>

3. export_audit_trail - Compliance Audit Logs

Generates comprehensive audit reports for compliance teams.

4. health - System Status

Checks server health and AI capability status.

5. list_supported_markets - Available Jurisdictions

Returns: ["sg", "hk", "ae", "in"]

๐Ÿ“ Project Structure

regguard-mcp/
โ”œโ”€โ”€ src/regguard/           # Core server code
โ”‚   โ”œโ”€โ”€ server.py          # Main MCP server
โ”‚   โ”œโ”€โ”€ rules_engine.py    # AI compliance engine
โ”‚   โ””โ”€โ”€ audit_writer.py    # Audit trail management
โ”œโ”€โ”€ rules/                 # Jurisdiction-specific rules
โ”‚   โ”œโ”€โ”€ sg.yml            # Singapore (MAS)
โ”‚   โ”œโ”€โ”€ hk.yml            # Hong Kong (SFC)
โ”‚   โ”œโ”€โ”€ ae.yml            # UAE (DFSA)
โ”‚   โ””โ”€โ”€ in.yml            # India (SEBI)
โ”œโ”€โ”€ audits/               # Compliance audit logs
โ”œโ”€โ”€ tests/                # Test files
โ”œโ”€โ”€ example_usage.py      # Usage examples
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ””โ”€โ”€ README.md            # This file

๐ŸŒ Supported Jurisdictions

MarketRegulatorKey FeaturesSpecial Requirements
Singapore (SG)MASGuaranteed returns detection, Risk disclosure checksEnglish language, Clear risk warnings
Hong Kong (HK)SFCSFC authorization checks, Complex product warningsTraditional/Simplified Chinese support
UAE (AE)DFSA/SCADFSA licensing validation, Risk rating requirementsArabic/English bilingual compliance
India (IN)SEBIRisk-o-meter requirements, Celebrity endorsement rulesLocal language disclosures

๐Ÿ”ง Implementation Steps for Your Project

Step 1: Environment Setup

# 1. Clone this repository
git clone https://github.com/your-username/regguard-mcp.git

# 2. Navigate to project directory
cd regguard-mcp

# 3. Create Python virtual environment
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# 4. Install dependencies
pip install -r requirements.txt

Step 2: Configuration

# 1. Get OpenAI API key from https://platform.openai.com/api-keys
# 2. Create .env file
echo 'OPENAI_API_KEY="your-actual-api-key"' > .env

# 3. Test configuration
python test_server.py

Step 3: Integration

Choose your preferred integration method:

For Claude Desktop Users:

  • Configure MCP settings as shown above
  • Restart Claude Desktop
  • Use @regguard commands

For Cursor IDE Users:

  • Add MCP configuration to workspace
  • Restart Cursor
  • Use @regguard in your code

For Custom Integration:

  • Use the provided example scripts
  • Implement JSON-RPC communication
  • Follow MCP protocol specification

Step 4: Customization

# 1. Modify jurisdiction rules in rules/ directory
# 2. Add custom compliance patterns
# 3. Extend supported markets if needed
# 4. Customize disclaimer templates

๐Ÿ“Š Understanding Results

Violation Severity Levels

  • CRITICAL: Serious regulatory breaches requiring immediate attention
  • HIGH: Important compliance issues that should be addressed
  • MEDIUM: Moderate concerns that may need review
  • LOW: Minor issues or best practice recommendations

AI Analysis Features

  • Contextual Understanding: Goes beyond keyword matching
  • Regulatory Knowledge: Trained on jurisdiction-specific rules
  • Confidence Scoring: AI confidence in each violation detection
  • Actionable Recommendations: Specific suggestions for fixes

๐Ÿค Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿš€ What's Next?

  • Additional jurisdiction support (EU, US, Canada)
  • Real-time compliance monitoring dashboard
  • Integration with more AI assistants
  • Enhanced multilingual support
  • Advanced analytics and reporting

Built with โค๏ธ for the financial compliance community

RegGuard helps ensure your financial marketing content meets regulatory standards across global markets. Stay compliant, stay confident.