{"id":"c69f6c7d-dd8a-4d4b-9ad0-fbccc332f58f","slug":"healthcare-ai-bedrock-mcp","kind":"mcp","name":"healthcare-ai-bedrock-mcp","summary":"MCP AI HEATHCARE PROJECT","owner":"agstya","repoUrl":"https://github.com/agstya/healthcare-ai-bedrock-mcp","license":"MIT-0","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2025-04-25T21:25:16.000Z","addedAt":"2026-10-21T15:08:04.940Z","logoUrl":"https://avatars.githubusercontent.com/u/202434683?u=940edb157d46922acac90968ca3b40044aa1293e&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["utilities"],"tags":[],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T20:33:06.472Z","sample":false,"url":"https://conduits.dev/tools/healthcare-ai-bedrock-mcp","language":"Python","transports":["stdio"],"install":{"pypi":"sample-bedrock-chainlit-mcp"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# Conext Aware Healthcare AI system with MCP \n\nThis project demonstrates how to integrate foundation models on Amazon Bedrock with Chainlit and MCP (Model Context Protocol) servers to create an interactive chat interface with tool-enhanced capabilities.\n\n## Project Overview\n\nThis sample application showcases:\n\n- Integration with Amazon Bedrock using Anthropic Claude 3.7 Sonnet\n- A Chainlit web interface for conversational AI interactions\n- A custom Model Context Protocol (MCP) server that performs basic math operations\n- Streaming responses for a smooth user experience\n- LangChain integration with MCP adapters to connect external tools\n- LangGraph for creating a ReAct (Reasoning and Acting) agent that orchestrates tool use\n\n## Prerequisites\n\nBefore getting started, ensure you have:\n\n- **AWS Account**: You'll need an AWS account with Bedrock access\n- **Bedrock Access**: Ensure your AWS account has access to the Anthropic Claude 3.7 Sonnet model\n- **AWS CLI**: Configured with appropriate credentials and permissions\n- **Python 3.13+**: This project requires Python 3.13 or newer\n- **UV**: For dependency management and building (install with `pip install uv`)\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/agstya/healthcare-ai-bedrock-mcp.git\n   cd healthcare-ai-bedrock-mcp\n   ```\n\n2. Create a virtual environment and install dependencies using UV:\n\n   ```bash\n   uv sync --all-groups\n   ```\n\n3. Configure AWS credentials (if not already done):\n\n   ```bash\n   aws configure\n   ```\n\n## Building from Source\n\nTo build the project from source using UV:\n\n1. Build the package:\n\n   ```bash\n   uv build\n   ```\n\nThis will create distribution files in the `dist/` directory, including the wheel file `dist/sample_bedrock_chainlit_mcp-0.1.0-py3-none-any.whl` that can be installed or used directly as the MCP server.\n\n## Usage Guide\n\n### Starting the Chainlit Application\n\nTo start the Chainlit application:\n\n```bash\nchainlit run src/ui/app.py\n```\n\nThis will launch a web server (typically at <http://localhost:8000>) with the chat interface.\n\n### Setting up the MCP Server\n\nThe Math MCP server needs to be connected to provide calculation capabilities:\n\n1. In the Chainlit web interface, look for the small plug icon under the chat text input element\n2. Click on it to open the MCP connection dialog\n3. Enter the following details:\n   - **Name**: `math`\n   - **Command**: `uvx dist/sample_bedrock_chainlit_mcp-0.1.0-py3-none-any.whl`\n   - **Type**: default (stdio)\n4. Click \"Confirm\"\n\nA successful connection will be indicated in the interface, and the math tools will become available to the Claude model.\n\n## Technical Implementation\n\n### LangGraph Integration\n\nThis project uses LangGraph to create a ReAct agent that follows this workflow:\n\n1. The agent receives user input via the Chainlit interface\n2. It analyzes the input to determine if mathematical operations are needed\n3. When math is required, it uses the MCP tools to perform calculations\n4. Results are returned to the user with a detailed explanation\n\nThe ReAct agent is created using `langgraph.prebuilt.create_react_agent()`, which orchestrates the reasoning and tool-use process.\n\n### LangChain MCP Adapters\n\nThe `langchain-mcp-adapters` package serves as a bridge between LangChain and MCP:\n\n- `load_mcp_tools()` converts MCP tools into LangChain-compatible tools\n- These tools are then provided to the LangGraph agent for use in the ReAct loop\n- This enables seamless integration between the Claude model on Amazon Bedrock and the custom math tools\n\nThis adapter pattern allows the application to easily incorporate additional MCP servers with different capabilities in the future.\n\nThese operations are exposed as tools that the Claude model can use when prompted with mathematical questions.\n\n## Development\n\nThe project structure includes:\n\n- `src/mcp/server.py`: The MCP server implementation with math operations\n- `src/ui/app.py`: The Chainlit application setup with LangGraph and MCP integration\n- `src/utils/`: Utility modules for Bedrock integration and streaming\n\nTo modify the MCP server or add new capabilities, edit the `src/mcp/server.py` file and rebuild using `uv build`.\n\n## Troubleshooting\n\n- If you encounter issues connecting to Bedrock, check your AWS credentials and ensure you have the necessary permissions.\n- For MCP connection issues, verify that the wheel file exists in the dist directory and that you're using the correct command in the Chainlit interface.\n- Check the logs in the terminal running the Chainlit application for detailed error messages. You can set the `LOG_LEVEL` environment variable to `DEBUG` to get more detailed logs.\n"}