RegGuard MCP Server

RegGuard MCP Server

An AI-powered compliance assistant that analyzes financial marketing content for regulatory violations across multiple jurisdictions including Singapore, Hong Kong, UAE, and India. It enables real-time compliance checking, automatic disclaimer insertion, and audit trail generation within MCP-compatible environments like Claude and Cursor.

Category
访问服务器

README

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

🚀 Quick Start Guide

Prerequisites

1. Clone and Setup

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

# Create virtual environment (recommended)
python -m venv regguard-env
source regguard-env/bin/activate  # On Windows: regguard-env\Scripts\activate

# Install dependencies
pip install -r requirements.txt

2. Configure API Key

Create a .env file in the project root:

# Create .env file
echo 'OPENAI_API_KEY="your-openai-api-key-here"' > .env

Important: Never commit your actual API key to GitHub!

3. Test the Server

# Test server functionality
python test_server.py

# Test AI integration
python test_ai_client.py

# Run example usage
python example_usage.py

🔌 How to Use RegGuard MCP Server

Option 1: Claude Desktop Integration (Recommended)

  1. Install Claude Desktop (Download here)

  2. Configure MCP Settings:

    • Open Claude Desktop settings
    • Navigate to "Developer" > "MCP Servers"
    • Add the following configuration:
{
  "mcpServers": {
    "regguard": {
      "command": "python",
      "args": ["-m", "src.regguard.server"],
      "cwd": "/full/path/to/regguard-mcp",
      "env": {
        "OPENAI_API_KEY": "your-openai-api-key-here"
      }
    }
  }
}
  1. Start Using:
    @regguard Please check this marketing copy for Singapore compliance:
    "Our investment product guarantees 15% annual returns with zero risk!"
    

Option 2: Cursor IDE Integration

  1. Install Cursor (Download here)

  2. Configure MCP in Workspace: Add to your Cursor workspace settings:

{
  "mcp.servers": [
    {
      "name": "regguard",
      "command": ["python", "-m", "src.regguard.server"],
      "cwd": "./regguard-mcp"
    }
  ]
}
  1. Use in Cursor:
    @regguard Analyze this financial ad for Hong Kong compliance violations
    

Option 3: Direct Python Integration

from regguard_client import RegGuardClient

# Initialize client
client = RegGuardClient()
client.start_server()

# Check compliance
result = client.check_compliance(
    html_content="<p>Guaranteed 20% returns!</p>",
    jurisdiction="sg"
)

print(f"Violations found: {len(result['violations'])}")

🛠️ 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

Market Regulator Key Features Special Requirements
Singapore (SG) MAS Guaranteed returns detection, Risk disclosure checks English language, Clear risk warnings
Hong Kong (HK) SFC SFC authorization checks, Complex product warnings Traditional/Simplified Chinese support
UAE (AE) DFSA/SCA DFSA licensing validation, Risk rating requirements Arabic/English bilingual compliance
India (IN) SEBI Risk-o-meter requirements, Celebrity endorsement rules Local 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

🧪 Testing Your Setup

Basic Functionality Test

python test_server.py

AI Integration Test

python test_ai_client.py

Full Feature Demo

python example_usage.py

Manual Testing Examples

  1. Critical Violation Test:

    Content: "Guaranteed 25% returns with zero risk!"
    Expected: Multiple critical violations detected
    
  2. Compliant Content Test:

    Content: "Investment involves risk. Past performance is not indicative of future results."
    Expected: No violations, compliance status PASS
    

📊 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.

🆘 Support & Troubleshooting

Common Issues

"OpenAI API key not found"

  • Ensure .env file exists with correct OPENAI_API_KEY
  • Check that your API key is valid and has credits

"Server not responding"

  • Verify Python dependencies are installed
  • Check that port is not in use by another process
  • Review error logs in terminal

"AI analysis failed"

  • Confirm OpenAI API key has sufficient credits
  • Check internet connection
  • Verify OpenAI service status

Getting Help

  • 📚 Documentation: Review the detailed guides in /docs
  • 🐛 Issues: Report bugs via GitHub Issues
  • 💬 Discussions: Join our GitHub Discussions for questions
  • 📧 Contact: Reach out for enterprise support

🚀 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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选