Trade Surveillance Support MCP Server
An MCP (Model Context Protocol) server designed to automate trade surveillance support workflows by integrating with your existing SQL configs and Java code repositories.
Overview
This MCP server enables you to:
Parse user inquiry emails - Extract key information from support emails automatically
Search SQL config files - Find relevant database queries and configurations
Search Java code - Locate report generation classes and methods
Execute Java reports - Run Java processes to generate data and reports
Generate response summaries - Create comprehensive responses for user inquiries
Installation
Prerequisites
Python 3.10 or higher
uvpackage manager (recommended) orpip
Install with uv (recommended)
Install with pip
Configuration
Setting up with VS Code
Open VS Code Settings
Search for "MCP"
Add a new MCP server configuration:
Setting up with Claude Desktop
Add to your claude_desktop_config.json:
macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
šÆ Keyword-Based Search (No File Paths!)
Instead of searching by file paths, this MCP server uses metadata annotations so Copilot can find files by what they do:
Example SQL annotation:
Example Java annotation:
Result: Copilot searches by keywords like "settlement report" instead of file paths!
š Documentation:
QUICKSTART.md - Get started in 5 minutes
METADATA_GUIDE.md - Complete annotation guide
examples/- Annotated SQL and Java examples
Usage
With GitHub Copilot in VS Code
Open a chat with Copilot
Paste a user inquiry email
Copilot will automatically use the MCP tools to:
Parse the email
Search for relevant configs by keywords (not file paths!)
Search for Java code by keywords
Execute reports
Generate a response
Example prompt:
Available Tools
1. parse_email_inquiry
Extracts key information from user inquiry emails including inquiry type, trade IDs, time periods, and priority.
2. search_sql_configs ā Metadata-based search
Searches through your SQL configuration files by keywords instead of file paths. Files are searched using metadata annotations (see METADATA_GUIDE.md).
3. search_java_code ā Metadata-based search
Locates Java classes and methods by keywords instead of file paths. Classes are found using javadoc annotations (see METADATA_GUIDE.md).
4. execute_java_report
Runs Java processes with the appropriate config files to generate reports.
5. rebuild_metadata_index
Rebuilds the search index by scanning all annotated SQL configs and Java files. Run this after adding new files or updating annotations.
6. generate_response_summary
Creates a comprehensive summary response for the user.
Project Structure
Development
Running Locally
Customization
You'll need to customize the server to work with your specific repository structure:
Update search paths - Modify
config_directoryandcode_directoryparametersImplement email parsing - Add your email parsing logic in
parse_email_inquiryAdd file search - Implement actual file searching in
search_sql_configsandsearch_java_codeConfigure Java execution - Add your Java classpath and execution logic in
execute_java_report
Connecting to Your Repository
Point the MCP server to your actual config and code repositories:
Next Steps
ā MCP server is ready! - Restart VS Code to load it
š Annotate your files - Add metadata keywords to your SQL configs and Java code (QUICKSTART.md)
š Build the index - Use
rebuild_metadata_indextool in Copilotāļø Customize paths - Update default directories in
server.pyto your reposšÆ Test with Copilot - Paste a user email and let Copilot search by keywords!
Key Innovation: No More File Path Search! š
Your SQL configs and Java files are now searchable by keywords:
Copilot finds files by what they do, not where they are
Search "settlement report" instead of remembering
configs/reports/daily/settlement_v2.sqlSee examples in
examples/configs/andexamples/src/
Troubleshooting
Server not appearing in VS Code
Check the MCP server logs in VS Code Output panel
Verify the absolute path in configuration is correct
Ensure
uvis installed and in PATH
Python version issues
Ensure Python 3.10+ is installed:
python --versionUse
uvfor better environment management
Java execution errors
Verify Java is installed:
java -versionCheck classpath configuration
Ensure config files are accessible
Resources
License
MIT