Skip to main content

CBUAE MCP Server

A Model Context Protocol (MCP) server for querying and analyzing Central Bank of UAE (CBUAE) policies and regulations.

Features

  • Policy Search: Search through CBUAE policies using fuzzy matching
  • Web Integration: Query the live CBUAE website (https://rulebook.centralbank.ae/) directly
  • Hybrid Search: Search both local database and live website for comprehensive results
  • Gap Analysis: Analyze gaps between bank policies and CBUAE regulations
  • Policy Listing: List all available policies in the database
  • Caching: Intelligent caching of web requests to improve performance

Installation

pip install cbuae-mcp

From Source

git clone https://github.com/your-repo/cbuae-mcp.git
cd cbuae-mcp
pip install -e .

Development Installation

git clone https://github.com/your-repo/cbuae-mcp.git
cd cbuae-mcp
./scripts/install-dev.sh

Quick Start

Command Line Usage

# Start the MCP server
cbuae-mcp

# With debug logging
cbuae-mcp --debug

Programmatic Usage

from cbuae_mcp import create_server

# Create and run the server
server = create_server()
server.run()

Available Tools

Local Database Tools

1. query_cbuae_policy

Search CBUAE policies using fuzzy matching in the local database.

Parameters:

  • query (string): The search query to find relevant policies

Returns:

  • Dictionary containing query results with matching policies

2. analyze_policy_gaps

Analyze gaps between bank policies and CBUAE regulations.

Parameters:

  • bank_policy (string): The bank's policy text to analyze
  • reg_id (string): The CBUAE regulation ID to compare against

Returns:

  • Dictionary containing identified gaps and recommendations

3. list_available_policies

List all available CBUAE policies in the database.

Returns:

  • Dictionary containing all available policies with their IDs, titles, and categories

Web Integration Tools

4. search_cbuae_website

Search for policies directly on the CBUAE website.

Parameters:

  • query (string): The search query to find policies on the website

Returns:

  • Dictionary containing search results from the CBUAE website

5. fetch_policy_from_website

Fetch the full content of a specific policy from the CBUAE website.

Parameters:

  • policy_url (string): The URL of the policy to fetch

Returns:

  • Dictionary containing the policy content and metadata

6. get_cbuae_policy_categories

Get available policy categories from the CBUAE website.

Returns:

  • Dictionary containing available policy categories

Search both local policy database and CBUAE website for comprehensive results.

Parameters:

  • query (string): The search query to find policies

Returns:

  • Dictionary containing combined search results from both sources

Usage with MCP Clients

After installing with pip install cbuae-mcp, add this to your MCP client configuration:

{
  "mcpServers": {
    "cbuae": {
      "command": "cbuae-mcp",
      "args": [],
      "description": "CBUAE Policy Agent - Search and analyze Central Bank of UAE policies and regulations"
    }
  }
}

Method 2: Using Python module

{
  "mcpServers": {
    "cbuae": {
      "command": "python",
      "args": ["-m", "cbuae_mcp.server"],
      "description": "CBUAE Policy Agent - Search and analyze Central Bank of UAE policies and regulations"
    }
  }
}

Method 3: Development setup

{
  "mcpServers": {
    "cbuae": {
      "command": "python",
      "args": ["-m", "cbuae_mcp.cli"],
      "cwd": "/path/to/cbuae-mcp",
      "description": "CBUAE Policy Agent - Search and analyze Central Bank of UAE policies and regulations"
    }
  }
}

Testing

Run the test scripts to verify functionality:

Local functionality:

python test_mcp.py

Web integration:

python test_web_integration.py

Complete test suite:

python test_web_scraper.py

Troubleshooting

Common Issues

1. "can't open file 'main.py': No such file or directory"

  • Solution: Use the provided start-server.sh script or ensure cwd is set correctly in your MCP configuration
  • Check: Verify the working directory path in your configuration

2. "Module 'cbuae' not found"

  • Solution: Ensure PYTHONPATH includes the server directory
  • Check: Use the startup script which sets the Python path automatically

3. Server disconnects immediately

  • Debug: Check the MCP client logs for stderr output
  • Verify: Run ./start-server.sh manually to test server startup

4. Web scraping returns no results

  • Note: The CBUAE website may have access restrictions
  • Fallback: The server automatically falls back to local database queries
  • Check: Verify internet connection and website accessibility

Debug Mode

Run the server manually to see debug output:

./start-server.sh

This will show:

  • Python executable path
  • Working directory
  • Python path
  • Import status
  • Startup messages

Log Output

The server outputs debugging information to stderr, which appears in MCP client logs:

  • Import success/failure
  • Server startup status
  • Error messages with details

Policy Database

The server loads policies from policy_db.json or falls back to mock data. To add real policies:

  1. Place PDF files in the docs/ directory
  2. Update the mappings in extract.py
  3. Run python extract.py to extract and store policy text

Available Policies

Local Database

  • AML_2018: Anti-Money Laundering regulations
  • CAPITAL_2023: Capital Adequacy Regulation
  • PTS_2024: Payment Token Services Regulation
  • CBUAE_EN_1691_VER2: Standards re Capital Adequacy of Banks in the UAE
  • CBUAE_EN_3934_VER1: Regulations Re Capital Adequacy

Web Integration

Web Integration Features

  • Real-time Access: Query the live CBUAE website for the most current policies
  • Intelligent Caching: Automatic caching of web requests with configurable duration
  • Error Handling: Robust error handling for network issues and access restrictions
  • Hybrid Search: Combine local database and web results for comprehensive coverage
  • Content Extraction: Extract structured policy content from web pages

Example Usage

# Search locally
result = query_cbuae_policy("capital adequacy")

# Search website
web_result = search_cbuae_website("banking regulation")

# Fetch specific policy
policy = fetch_policy_from_website("https://rulebook.centralbank.ae/en/rulebook/capital-adequacy")

# Hybrid search (both local and web)
hybrid_result = hybrid_policy_search("anti-money laundering")

License

This project is designed for compliance and regulatory analysis purposes.

Metadata

Release files for cbuae-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cbuae-mcp 1.0.0
File Size Uploaded Provenance
cbuae_mcp-1.0.0.tar.gz 20.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cbuae-mcp 1.0.0
File Interpreter ABI Platform
cbuae_mcp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.1 kB

Release files / cbuae_mcp-1.0.0.tar.gz

Download URL cbuae_mcp-1.0.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0ea31966386a6eecb2bdcebdc441e21a6880386b8acb74bc9eb71ffd80bdd2d6
BLAKE2b-256 checksum
How to use checksums
2e130213b8d8f29c29755e1b17eda815732928f389ddffcb705d20a66e517afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.3

Release files / cbuae_mcp-1.0.0-py3-none-any.whl

Download URL cbuae_mcp-1.0.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69f68bd623b5d1c6027f58e9a630ee1fed72c4e05ebf610f95fb6cb0d9f222f8
BLAKE2b-256 checksum
How to use checksums
fa85dbbcf4acd96f22333de9b4d74f29386ffc0091a409b5112cf4451cf0e3c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.3

Security for cbuae-mcp 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page