A step-by-step guide to building a privacy-preserving AI agent that orchestrates medical image de-identification without ever exposing patient data to the model. Using FastMCP and the MCP Python SDK, you expose six tools from the Aegis DICOM de-identification pipeline (built on MONAI/PyTorch) to Claude Desktop. The agent can warm up models, process single files or entire directories in background threads, poll job status, and summarize audit reports — all through natural language conversation. Key design principles include returning only summary statistics (never pixels or PHI text), using async background jobs for long-running tasks, and maintaining a verifiable on-disk audit trail. The tutorial also covers testing with MCP Inspector, configuring Claude Desktop via JSON, and security considerations like restricting file access and avoiding PHI in file names.

15m read timeFrom freecodecamp.org
Post cover image
Table of contents
Table of ContentsWhat You'll BuildPrerequisitesWhat Aegis DoesHow to Set Up AegisWhat Is MCP, and Why Use It?How the Architecture WorksStep 1: Design the Tool SurfaceStep 2: Build the MCP Server with FastMCPStep 3: Test with MCP Inspector — Before Any AI Is InvolvedStep 4: Connect Claude DesktopStep 5: Talk to Your AgentVerificationDoes the AI Ever See Patient Data?Security ConsiderationsA Note on the Word "De-identification"Where This Fits, and What's NextConclusionReferences
181 Impressions