mcp-local-server-hackathon

michu-dunat/mcp-local-server-hackathon

3.2

If you are the rightful owner of mcp-local-server-hackathon and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Fraud Case Management MCP Server connects to the CDQ Bankaccount Data API to provide access to fraud case information, enabling search, filtering, and analysis of fraud cases.

Tools
2
Resources
0
Prompts
0

Fraud Case Management MCP Server

A Model Context Protocol (MCP) server that connects to the CDQ Bankaccount Data API to provide access to fraud case information:

  • 🔧 2 Tools/Actions: Search, filter, and analyze fraud cases by various criteria including date ranges
  • 📚 1 Resource: cdq://fraudcases/all - Live fraud cases data from CDQ API
  • 💬 4 Prompt Templates: Fraud analyst, investigator, pattern detector, and report generator

Features

Tools

1. search_fraud_cases

Search and filter fraud cases from the CDQ API with flexible parameters.

Parameters:

  • search (optional): Search phrase to filter fraud cases
  • page (optional): Page index (0-based, default: 0)
  • pageSize (optional): Number of records per page (max 200, default: 20)
  • sort (optional): Sort field (prefix with - for descending, default: "-creationTimestamp")
  • classification (optional): Classification filter (DEMO, TEST, CATENAX, STANDARD - default: STANDARD)
2. get_fraud_cases_by_date

Get fraud cases that occurred on a specific date or within a date range. Fetches all cases and filters by Unix timestamp in Python.

Parameters:

  • start_date (required): Start date in YYYY-MM-DD format (e.g., 2015-12-30)
  • end_date (optional): End date in YYYY-MM-DD format (for date range filtering)
  • classification (optional): Classification filter (DEMO, TEST, CATENAX, STANDARD - default: STANDARD)

Resource: cdq://fraudcases/all

Live fraud cases data fetched from the CDQ Bankaccount Data API with metadata including pagination info, sort order, and the complete list of fraud cases.

Prompt Templates

1. fraud_analyst

Creates a fraud analyst assistant prompt with real-time fraud case context (20 samples).

Parameters:

  • analysis_type (optional): Type of analysis - summary, trends, or risk_assessment

Features:

  • Displays 20 recent fraud cases
  • Parses Unix timestamps (milliseconds) to human-readable dates
  • Shows full fraud descriptions
  • Includes business partner details, fraudster information, and bank account data
2. fraud_investigator

Deep-dive investigation of a specific fraud case with detailed context sections.

Parameters:

  • case_id (required): The CDL ID of the fraud case to investigate

Features:

  • Structured investigation report with incident details
  • Complete target and fraudster information
  • Banking details and alternative payee info
  • Recommendations for next steps and similar case patterns
3. fraud_pattern_detector

Analyzes patterns and similarities across fraud cases with different focus areas.

Parameters:

  • focus_area (optional): Area to focus on - geographical, temporal, modus_operandi, or target_profile

Features:

  • Geographical distribution analysis
  • Temporal pattern detection (trends over time)
  • Fraud technique categorization
  • Target profile analysis
4. fraud_report_generator

Generates comprehensive fraud reports with various report types and time periods.

Parameters:

  • report_type (optional): Type of report - executive_summary, detailed_analysis, incident_response, or prevention_recommendations
  • time_period (optional): Time period - last_week, last_month, last_quarter, last_year, or all_time

Features:

  • Statistical breakdowns and metrics
  • Geographic and type-based analysis
  • Customized report formats for different audiences
  • Strategic recommendations

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Create your credentials file:
cp credentials.json.example credentials.json

Then edit credentials.json and add your CDQ username and password:

{
  "username": "your-cdq-username",
  "password": "your-cdq-password"
}

Note: The credentials.json file is gitignored for security.

Usage

MCP Inspector (Recommended! 🌟)

The easiest way to explore and test the server with a web UI:

./run_inspector.sh

Or manually:

npx @modelcontextprotocol/inspector /Users/michal/Repositories/mcp-local-server/.venv/bin/python server.py

This will:

  1. Start the MCP Inspector web interface
  2. Automatically launch your server
  3. Open a browser with an interactive UI
  4. Allow you to test all resources, tools, and prompts

Features in the Inspector:

  • � Browse and read resources
  • 🔧 Execute tools with custom parameters
  • 💬 Test prompt templates
  • � View real-time request/response logs
  • 🐛 Debug server behavior

Alternative: Command-Line Demo Client

Run the Python demo client (currently has connection issues):

python client_demo.py

Interactive Jupyter Notebook Demo

Explore features step-by-step in a notebook:

  1. Open demo.ipynb in VS Code or Jupyter
  2. Run the cells to see each feature in action

Note: The notebook currently has connection issues and needs debugging.

Run the Server Standalone

To run just the server (for integration with MCP clients):

python server.py

The server communicates via stdio and follows the MCP protocol.

Authentication

This server uses OAuth2 password grant flow for authentication with the CDQ API:

  1. Token Endpoint: https://id.cdq.com/auth/realms/cs/protocol/openid-connect/token
  2. Client ID: cloud-apps
  3. Grant Type: password
  4. Headers:
    • X-Credential-Username: Your CDQ username
    • Authorization: Bearer token obtained from OAuth2

API Integration

This server integrates with the CDQ Bankaccount Data API:

Fraud Case Data Structure

Each fraud case includes:

  • cdlId: Unique identifier
  • type: Fraud type (FAKE_DOCUMENT, FAKE_EMAIL, FALSIFIED_INVOICE, etc.)
  • dateOfAttack: When the attack occurred
  • description: Description of the fraud case
  • confirmationState: CONFIRMED or SUSPECTED
  • businessPartnerName: Name of affected business partner
  • fraudsterEmail: Email address of the fraudster
  • bankAccount: Bank account details including IBAN, BIC, etc.
  • And many more fields...

Project Structure

mcp-local-server/
├── server.py                  # MCP server implementation
├── credentials.json.example   # Example credentials file
├── credentials.json          # Your credentials (gitignored)
├── run_inspector.sh          # 🌟 Launch MCP Inspector (recommended)
├── requirements.txt          # Python dependencies
└── README.md                 # This file

Next Steps

Once you have this running, you can:

  1. Search fraud cases with different filters and parameters
  2. Add more sophisticated analysis tools (statistics, pattern detection)
  3. Create more specialized prompt templates (risk scoring, reporting)
  4. Add more resources (fraud statistics, trend analysis)
  5. Integrate with AI/LLM applications like Claude Desktop for fraud analysis assistance

MCP Protocol

This server implements the Model Context Protocol, which allows AI applications to:

  • Access resources (fraud case databases via APIs)
  • Execute tools/actions (search and filter fraud cases)
  • Use prompt templates (fraud analyst assistance)

Learn more: https://modelcontextprotocol.io/