Zfinix

CBN MCP Server ๐Ÿฆ

Community Zfinix
Updated

A Model Context Protocol (MCP) server for accessing Central Bank of Nigeria (CBN) data and circulars. Connect this server to Cursor, Claude Desktop, or any MCP-compatible application to access CBN regulatory information directly in your AI conversations. ๐Ÿš€

CBN MCP Server ๐Ÿฆ

CBN MCP Server

A Model Context Protocol (MCP) server for accessing Central Bank of Nigeria (CBN) data and circulars. Connect this server to Cursor, Claude Desktop, or any MCP-compatible application to access CBN regulatory information directly in your AI conversations. ๐Ÿš€

Built with mcp_server_dart - A developer-friendly MCP framework for Dart with annotations and code generation that I created. ๐Ÿ’ช

Features โœจ

MCP Tools ๐Ÿ› ๏ธ

Circulars Tools ๐Ÿ“‹
  • getAllCirculars: Fetch all CBN circulars with optional filtering by date range and category ๐Ÿ“‹
  • getCircularById: Get a specific CBN circular by its ID ๐Ÿ”
  • searchCirculars: Search CBN circulars by title or description keywords ๐Ÿ”Ž
  • fetchCircularPdf: Download and read PDF content of CBN circulars ๐Ÿ“„
  • fetchCircularPdfById: Download PDF content by circular ID ๐Ÿ“ฅ
  • getCircularPdfUrl: Get the direct download URL for a CBN circular PDF by its ID ๐Ÿ”—
  • getCircularsForLLMAnalysis: Get recent CBN circulars with PDF URLs formatted for LLM analysis ๐Ÿค–
Exchange Rates Tools ๐Ÿ’ฑ
  • getAllExchangeRates: Fetch all CBN exchange rates with optional filtering by date range and currency ๐Ÿ’ฑ
  • getExchangeRateById: Get a specific CBN exchange rate by its ID ๐Ÿ”
Financial Data Tools ๐Ÿ“Š
  • getAllFinancialData: Fetch all CBN financial data with optional filtering by date range and financial metrics ๐Ÿ“Š
  • getFinancialDataById: Get a specific CBN financial data by its ID ๐Ÿ”

MCP Resources ๐Ÿ“š

  • cbnApiStatus: Current status and health of the CBN API connection ๐Ÿ’š
  • serverInfo: Information about this CBN MCP server โ„น๏ธ
  • availableCircularPdfs: List of available circular PDFs with their URIs ๐Ÿ“„
  • randomFact: A random fact about the CBN ๐ŸŽฒ

MCP Prompts ๐Ÿ’ฌ

  • circularSummary: Generate a summary prompt for CBN circulars analysis ๐Ÿ“Š
  • regulatoryAnalysis: Generate prompts for regulatory compliance analysis of CBN circulars โš–๏ธ

Quick Start ๐Ÿš€

Option 1: Download Pre-built Binary (Easiest) โšก

  1. Go to Releases ๐Ÿ“ฆ
  2. Download the cbn_mcp executable โฌ‡๏ธ
  3. Make it executable: chmod +x cbn_mcp ๐Ÿ”ง
  4. Use path: /path/to/cbn_mcp ๐Ÿ“

Option 2: Run with Dart (If you have Dart installed) ๐ŸŽฏ

  1. Clone this repository: git clone https://github.com/chiziaruhoma/cbn_mcp.git ๐Ÿ“‚
  2. Navigate to directory: cd cbn_mcp ๐Ÿ“
  3. Install dependencies: dart pub get ๐Ÿ“ฆ
  4. Use command: dart run bin/main.dart โ–ถ๏ธ

Option 3: Build from Source ๐Ÿ”จ

  1. Follow Option 2 steps 1-3 โฌ†๏ธ
  2. Build executable: dart compile exe bin/main.dart -o cbn_mcp ๐Ÿ—๏ธ
  3. Use path: /path/to/cbn_mcp ๐Ÿ“

Integration with AI Applications ๐Ÿค–

Cursor IDE ๐Ÿ’ป

  1. Open Cursor settings (Cmd/Ctrl + ,) โš™๏ธ

  2. Go to "Features" โ†’ "Model Context Protocol" ๐Ÿ”ง

  3. Add a new MCP server with one of these configurations: ๐Ÿ“

    Using pre-built binary: โšก

    {
      "name": "cbn-mcp",
      "command": "/path/to/cbn_mcp"
    }
    

    Using Dart (if you have Dart installed): ๐ŸŽฏ

    {
      "name": "cbn-mcp",
      "command": "dart",
      "args": ["run", "bin/main.dart"],
      "cwd": "/path/to/cbn_mcp"
    }
    
  4. Restart Cursor ๐Ÿ”„

  5. Now you can ask questions like: "What are the latest CBN circulars?" or "Find CBN regulations about forex trading" ๐Ÿ’ฌ

Claude Desktop ๐Ÿ–ฅ๏ธ

  1. Open Claude Desktop settings โš™๏ธ

  2. Navigate to the MCP servers configuration ๐Ÿ”ง

  3. Add the CBN MCP server with one of these configurations: ๐Ÿ“

    Using pre-built binary: โšก

    {
      "mcpServers": {
        "cbn-mcp": {
          "command": "/path/to/cbn_mcp"
        }
      }
    }
    

    Using Dart (if you have Dart installed): ๐ŸŽฏ

    {
      "mcpServers": {
        "cbn-mcp": {
          "command": "dart",
          "args": ["run", "bin/main.dart"],
          "cwd": "/path/to/cbn_mcp"
        }
      }
    }
    
  4. Restart Claude Desktop ๐Ÿ”„

  5. The CBN tools will be available in your conversations ๐ŸŽ‰

Other MCP-Compatible Applications ๐ŸŒ

For any application that supports MCP: ๐Ÿ”Œ

  1. Add the server configuration pointing to the cbn_mcp executable ๐Ÿ“
  2. The server will expose CBN data access tools to your AI assistant ๐Ÿค–

Usage Examples ๐Ÿ’ก

Once integrated, you can ask your AI assistant: ๐Ÿ—ฃ๏ธ

Circulars Examples ๐Ÿ“‹

  • "What are the latest CBN circulars from this month?" ๐Ÿ“…
  • "Find all CBN regulations related to cryptocurrency" ๐Ÿ’ฐ
  • "Get me the details of CBN circular BSD/DIR/GEN/LAB/11/020" ๐Ÿ”
  • "Summarize the key points from recent CBN monetary policy circulars" ๐Ÿ“Š
  • "What are the compliance requirements for banks based on recent CBN circulars?" โš–๏ธ

Exchange Rates Examples ๐Ÿ’ฑ

  • "What is the current USD/NGN exchange rate?" ๐Ÿ’ต
  • "Show me the exchange rates for the past week" ๐Ÿ“ˆ
  • "Get the official CBN rate for EUR to NGN" ๐Ÿ’ถ

Financial Data Examples ๐Ÿ“Š

  • "What are the current CBN monetary policy parameters?" ๐Ÿ›๏ธ
  • "Show me the repo rates for the last month" ๐Ÿ“Š
  • "What is the current cash reserve ratio?" ๐Ÿ’ฐ
  • "Get the opening balance data for this quarter" ๐Ÿ“…

Development ๐Ÿ‘จโ€๐Ÿ’ป

Prerequisites ๐Ÿ“‹

  • Dart SDK ^3.9.2
  • Git

Setup ๐Ÿ› ๏ธ

  1. Clone the repository:

    git clone https://github.com/chiziaruhoma/cbn_mcp.git
    cd cbn_mcp
    
  2. Install dependencies:

    dart pub get
    
  3. Generate mappable classes (if needed):

    dart run build_runner build
    

Running the Server โ–ถ๏ธ

# Run directly with Dart
dart run bin/main.dart

# Or build and run executable
dart compile exe bin/main.dart -o cbn_mcp
./cbn_mcp

Testing ๐Ÿงช

dart test

Building for Distribution ๐Ÿ“ฆ

# Build executable
dart compile exe bin/main.dart -o cbn_mcp

# The executable can be distributed and run on any compatible system

Project Structure ๐Ÿ“

lib/
โ”œโ”€โ”€ cbn.dart              # Main MCP server class
โ”œโ”€โ”€ cbn.mcp.dart          # Generated MCP annotations
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ””โ”€โ”€ api_client.dart    # HTTP client for CBN API
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ logger.dart        # Logging utilities
โ”œโ”€โ”€ models/               # Data models with mappable annotations
โ”‚   โ”œโ”€โ”€ circular.dart     # Circular data models
โ”‚   โ”œโ”€โ”€ financials.dart   # Financial data models
โ”‚   โ”œโ”€โ”€ rates.dart        # Exchange rates models
โ”‚   โ”œโ”€โ”€ random.dart       # Random fact models
โ”‚   โ””โ”€โ”€ models.dart       # Base model classes
โ””โ”€โ”€ services/             # Business logic services
    โ”œโ”€โ”€ circulars.dart    # Circulars API service
    โ”œโ”€โ”€ financials.dart   # Financial data service
    โ”œโ”€โ”€ rates.dart        # Exchange rates service
    โ”œโ”€โ”€ prompt.dart       # MCP prompt service
    โ”œโ”€โ”€ status.dart       # Status and info service
    โ””โ”€โ”€ services.dart     # Base service classes

Contributing ๐Ÿค

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

API Documentation ๐Ÿ“–

This project integrates with the Central Bank of Nigeria's public API. For more information about the available endpoints, visit the CBN Developer Portal.

License ๐Ÿ“„

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

Acknowledgments ๐Ÿ™

  • Central Bank of Nigeria for providing the public API
  • The MCP community for the protocol specification
  • mcp_server_dart for the Dart MCP framework

MCP Server ยท Populars

MCP Server ยท New