Trade Surveillance Support MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Trade Surveillance Support MCP Server I got an email about a settlement discrepancy for trade ID 789012 - can you help investigate?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: UnityBridge-MCP
Installation
Prerequisites
Python 3.10 or higher
uvpackage manager (recommended) orpip
Install with uv (recommended)
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the MCP server
uv pip install -e .Install with pip
pip install -e .Configuration
Setting up with VS Code
Open VS Code Settings
Search for "MCP"
Add a new MCP server configuration:
{
"mcp.servers": {
"trade-surveillance": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp_test_2",
"run",
"trade-surveillance-mcp"
]
}
}
}Setting up with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"trade-surveillance": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp_test_2",
"run",
"trade-surveillance-mcp"
]
}
}
}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:
-- @keywords: trade, settlement, daily, reconciliation
-- @type: compliance_report
-- @description: Daily trade settlement reconciliation reportExample Java annotation:
/**
* @keywords settlement, report, generator
* @type report_generator
* @description Generates daily settlement reports
*/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:
I received this email from a user:
[Paste email content here]
Can you help me investigate and generate the necessary reports?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
mcp_test_2/
βββ trade_surveillance_mcp/
β βββ __init__.py
β βββ server.py # Main MCP server implementation
βββ pyproject.toml # Project dependencies
βββ README.md
βββ .github/
βββ copilot-instructions.mdDevelopment
Running Locally
# Run the server directly
uv run trade-surveillance-mcp
# Or with Python
python -m trade_surveillance_mcp.serverCustomization
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:
# Example: Update default directories
@mcp.tool()
async def search_sql_configs(
search_term: str,
config_directory: str = "/path/to/your/sql/configs"
):
# Your implementationNext 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
Available Tools
6 toolsexecute_java_reportA
Execute a Java unit test to generate a trade surveillance report.
This tool runs the unit test for the specified Java class with the given
config file to generate the required report or data extract. Running tests
ensures the report generation is validated during execution.
Args:
java_class: The fully qualified Java class name (e.g., "com.trade.SettlementReportGenerator")
config_file: Path to the SQL config file to use
output_directory: Directory where the report should be saved
Returns:
A dictionary containing execution status, report path, and any errors
Inputs: java_class (required), config_file (required), output_directory. Returns: object
generate_response_summaryB
Generate a summary response for the user inquiry with all relevant information.
This tool combines all the gathered information into a clear, actionable
response that can be sent back to the user.
Args:
parsed_email: The parsed email inquiry data
config_files: List of config files that were used
report_path: Path to the generated report file
Returns:
A formatted summary string ready to send to the user
Inputs: parsed_email (required), config_files (required), report_path (required). Returns: result
parse_email_inquiryA
Parse a user inquiry email to extract key information for investigation.
This tool analyzes email content and extracts:
- Inquiry type (trade issue, report request, data verification, etc.)
- Related trade IDs or account numbers
- Time period of interest
- Priority level
- Required actions
Args:
email_content: The full text content of the user's inquiry email
Returns:
A dictionary containing parsed information including inquiry_type,
trade_ids, time_period, priority, and suggested_actions
Inputs: email_content (required). Returns: object
rebuild_metadata_indexA
Rebuild the metadata index by scanning all SQL configs and Java files.
Use this tool when you've added new files or updated metadata annotations.
The index is automatically built on first search, but you can manually rebuild
it with this tool.
Args:
config_directory: Path to the directory containing SQL config files
code_directory: Path to the directory containing Java source files
Returns:
A summary of the indexing operation
Inputs: config_directory, code_directory. Returns: object
search_java_codeA
Search for Java classes using metadata keywords instead of file paths.
This tool searches through indexed Java files by their javadoc metadata annotations.
Java classes should include metadata in javadoc comments like:
/**
* @keywords trade, settlement, report_generator
* @type report_engine
* @description Generates daily settlement reports
*/
Args:
search_keywords: Keywords to search for (e.g., "report generator", "trade processor")
code_directory: Path to the directory containing Java source files (used for initial scan)
Returns:
A dictionary containing matching Java files with their metadata and methods
Inputs: search_keywords (required), code_directory. Returns: object
search_sql_configsA
Search for SQL configuration files using metadata keywords instead of file paths.
This tool searches through indexed SQL config files by their metadata annotations.
Files should include metadata comments like:
-- @keywords: trade, transaction, daily_report
-- @type: compliance_check
-- @description: Daily trade reconciliation report
Args:
search_keywords: Keywords to search for (e.g., "trade settlement", "compliance", "daily report")
config_directory: Path to the directory containing SQL config files (used for initial scan)
Returns:
A dictionary containing matching config files with their metadata
Inputs: search_keywords (required), config_directory. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap. The tools cover different stages of a workflow: parse_email_inquiry for input analysis, search_sql_configs/search_java_code for resource discovery, execute_java_report for execution, generate_response_summary for output formatting, and rebuild_metadata_index for maintenance. An agent can easily distinguish between them based on their specific functions.
All tools follow a consistent verb_noun pattern with snake_case naming. The verbs are clear and descriptive (execute, generate, parse, rebuild, search), and the nouns precisely indicate the target resource or action. There are no deviations in naming conventions across the six tools.
Six tools is well-scoped for a trade surveillance support server. Each tool serves a distinct purpose in the workflow, from inquiry parsing to report generation and response formatting. The count is neither too thin nor bloated, providing comprehensive coverage without redundancy.
The toolset covers the core trade surveillance workflow effectively: parsing inquiries, searching for relevant configurations and code, executing reports, and generating responses. A minor gap exists in direct data manipulation or validation tools (e.g., validate_trade_data, update_config), but agents can work around this using the existing search and execution tools. The surface supports end-to-end processing without dead ends.
Maintenance
Related MCP Connectors
Trading tools for agents: AI trade brief, pre-trade check, event gate, insider buys. Remote or x402
Source-cited SEC filing search and retrieval with provenance and verification states.
Receipt ingestion, Gmail capture, expense analysis, and reviewed reports for AI-agent workflows.
PII/secret redaction, email checks, sanctions screening, OSV lookups and an MCP server pre-check.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables semantic search over Turkish legal contracts and emails via an MCP server integrated with Claude Desktop and Claude Code, providing tools for document ingestion, hybrid vector search, and full-text retrieval.-
- FlicenseNot gradedqualityDmaintenanceNormalizes heterogeneous trade data (FIX, JSON, CSV) into a unified schema and exposes query tools via MCP for natural language access.-
- FlicenseNot gradedqualityDmaintenanceAnalyzes Java codebases using an internal Knowledge Graph stored in SQLite, enabling symbol search, endpoint tracing, and impact analysis without requiring AI APIs.-
- FlicenseNot gradedqualityBmaintenanceEnables agents and MCP clients to look up shipment tracking status, SAP order sync errors, ServiceNow incident tickets, and internal SOP runbooks through natural-language tool calls, with every execution written to a SQLite audit trail.-