How trailblazelabs/fca-mcp works
Project Type and Purpose
• This is a backend-focused, AI-powered regulatory intelligence service (“FCA MCP Server”) that continuously ingests live FCA data, processes and embeds it for semantic search (via Azure OpenAI), indexes it into Elasticsearch, and exposes a conversational API (FastAPI) that AI assistants (e.g., Claude Desktop) call.
• It includes a CLI for data loading and infrastructure as code (Terraform) for deployment to AWS (ECS, Lambda, S3, IAM, Load Balancer).
File Structure Analysis
• Top level:
• fca_mcp/ → Python package with modules:
– cli.py (entry point for data loading & server serve)
– data_loaders.py (FCA API fetchers)
– elasticsearch_helpers.py (ES index utilities)
– lambda_handler.py (AWS Lambda ingestion entry)
– mcp_server/ (FastAPI application: main.py, api.py, handlers.py, utils.py)
– models.py, settings.py, shared_utils/ (auth, etc.)
• Dockerfile.mcp-server, Dockerfile.lambda → container definitions for server and Lambda ingestion
• docker-compose.yaml → local orchestration (MCP server + Elasticsearch)
• terraform/ → IaC for AWS: ECS cluster (ecs.tf), Lambda (lambda.tf), S3 (s3.tf), IAM (iam.tf), Load Balancer (load_balancer.tf), secrets, variables, plus a small diagram_script.py.
• tests/ → pytest suite for data loaders, server handlers, models.
• Key patterns:
• CLI + Lambda for batch/daily ingestion
• FastAPI microservice for real-time query
• Elasticsearch as search backend
• Terraform-managed AWS infra
• Dockerized components for local/dev and production
README Insights
• Architecture call-out: “FastMCP server → Elasticsearch with semantic search → Azure OpenAI embeddings → Live FCA APIs”
• Describes continuous ingestion, transformation, embedding, indexing, and conversational query.
Detail Level
• Essential components (CLI, Lambda, FastAPI, ES, embeddings, external APIs, infra)
• Drill into sub-components if needed (e.g., in FastAPI: api.py vs. handlers.py)