-
Notifications
You must be signed in to change notification settings - Fork 134
New example MCP App: DICOM Viewer #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
New example MCP App: DICOM Viewer #405
Conversation
Introduces a new example app 'dicom-viewer-mcp-app' for viewing DICOM medical images in Claude Desktop using the MCP Apps SDK. Includes server-side DICOM parsing and PNG conversion, a React-based client with navigation and zoom controls, project configuration, and end-to-end test integration.
Reformatted the font-family property in global.css and mcp-app.module.css for improved readability by placing each font on a separate line.
Added two sample DICOM files and a .gitkeep file to the dicom directory. Updated .gitignore to allow tracking of the gitkeep file while still ignoring other DICOM files.
Reworked the DICOM viewer MCP app to fetch and render DICOM slice images on demand via a new 'get-dicom-slice' server tool, instead of embedding all images in the initial HTML. Updated the server, client logic, and UI to support this, improved error handling and fallback UI, and removed sample DICOM files from the repo. Also updated documentation and package metadata.
Refactored several long lines in server.ts, mcp-app.tsx, and servers.spec.ts to improve readability and maintain consistent code style. No functional changes were made.
Eliminated extensive debug and console logging from both the server and client code in the DICOM viewer MCP app for cleaner output and improved performance. Also updated the DICOM viewer E2E test snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new DICOM Viewer MCP App example that demonstrates server-side medical image processing with interactive client-side viewing capabilities. The implementation includes DICOM file parsing, windowing/leveling, and on-demand slice loading via MCP tools.
Changes:
- Adds complete DICOM Viewer MCP App with React-based client and Node.js server
- Integrates with e2e test suite with golden screenshot comparison
- Implements on-demand slice loading to handle large medical imaging series efficiently
Reviewed changes
Copilot reviewed 14 out of 19 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/servers.spec.ts | Adds DICOM viewer to the test server list for e2e testing |
| examples/dicom-viewer-mcp-app/vite.config.ts | Standard Vite configuration for React app bundling |
| examples/dicom-viewer-mcp-app/tsconfig.server.json | TypeScript configuration for server-side code compilation |
| examples/dicom-viewer-mcp-app/tsconfig.json | TypeScript configuration for client-side React code |
| examples/dicom-viewer-mcp-app/src/vite-env.d.ts | Vite type definitions reference |
| examples/dicom-viewer-mcp-app/src/mcp-app.tsx | React client implementing DICOM viewer UI with zoom, pan, and slice navigation |
| examples/dicom-viewer-mcp-app/src/mcp-app.module.css | Styles for the DICOM viewer interface |
| examples/dicom-viewer-mcp-app/src/global.css | Global CSS reset and base styles |
| examples/dicom-viewer-mcp-app/server.ts | MCP server with DICOM parsing and JPEG conversion using dicom-parser and sharp |
| examples/dicom-viewer-mcp-app/package.json | Dependencies and build scripts for the DICOM viewer server |
| examples/dicom-viewer-mcp-app/mcp-app.html | HTML template for the viewer app |
| examples/dicom-viewer-mcp-app/main.ts | Entry point supporting stdio and HTTP transports |
| examples/dicom-viewer-mcp-app/README.md | Documentation with features, installation, and usage instructions |
| examples/dicom-viewer-mcp-app/LICENSE | MIT license for the DICOM viewer example |
| examples/dicom-viewer-mcp-app/.gitignore | Ignores build artifacts and local files |
| .gitignore | Excludes the dicom folder containing test images from version control |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Update README to include MCP client stdio configuration and a local development example, clarify server-side rendering wording, and simplify the Claude Desktop setup instructions. Tidy up package.json: bump zod to ^4.1.13, remove the author field, and relocate types/exports/bin blocks; no functional script or dependency changes aside from the zod version.
|
Thank you for your contribution @ThalesMMS. You're using a medical image example in one of your screenshots. Can you please provide some context on the source of the image and any permission you've obtained to redistribute it? Given the sensitive nature of medical content, I want to make sure that we're only merging examples that have gone through proper vetting. |
You're welcome!! About the two X-Ray dcm files (included in commits), which are properly anonymized (through both RSNA anonymizer https://github.com/RSNA/Anonymizer + manual anonymization of additional metadata I did myself): I have authorization of redistribution which I can provide privately over NDA to any reviewer or comitee. About the CT screenshot, it's better to change it to a screenshot of the X-Ray, because although it is properly anonymized and from a public library, I have just checked that in theory I do not have authorization of redistribution. Wait for a commit... |
Replace examples/dicom-viewer-mcp-app/screenshot.png with an updated image. This updates the example app's visual asset to reflect recent UI or demo changes.
|
I just changed the screenshot. If you prefer, I can also squash the commits in this PR to remove the previous screenshot from the git history, and/or remove the screenshot and the two sample DICOM files altogether (and squash) if you want. I've also shared additional context about the X-Ray images privately via LinkedIn. |
Adds a new example simple MCP App for viewing DICOM medical images, with server-side parsing/conversion and a React-based interactive viewer.
Motivation and Context
Medical imaging (DICOM) is a common use case that demonstrates the MCP Apps SDK's ability to provide complex real-time UI interactions. This example shows how to build a prototype MCP App with image processing capabilities.
How Has This Been Tested?
npm test,npm run test:e2e -- --grep "DICOM"Breaking Changes
None.
Types of changes
Checklist
Additional context
dicom-parserand PNG conversion withsharp