Sponsored by Deepsite.site

Patient Search & Create Tasks MCP Server

Created By
Flight-Health7 months ago
MCP server for searching patients and creating tasks in Flight Health Atlas system.
Content

Patient Search & Create Tasks MCP Server

This project provides a Model Context Protocol (MCP) server for searching patients in the Flight Health Atlas system and creating a new task.

Features

  • V2 Server (server-v2.ts): Uses Puppeteer for advanced web automation and more reliable login handling

Prerequisites

  • Node.js 18 or higher
  • npm or yarn package manager

Installation

  1. Clone the repository:
git clone <repository-url>
cd patient-search-mcp
  1. Install dependencies:
npm install
  1. Update Credentials Go to auth.ts and replace the email and password in LOGIN_CREDENTIALS with your credentials. For demo purposes these are hardcoded since by default Cursor AI cannot access a .env file (possible to work around this by creating a .cursorignore file and adding !.env to it).

  2. Build the servers:

npm build:v2      # only build the V2 server
npm run start     # Build and start V2 server

Configuration

For Cursor MCP

Add the following to your Cursor mcp.json file (found through Cursor Settings):

V2 Server (Recommended):

{
  "mcpServers": {
    "patient-search-v2": {
      "command": "node",
      "args": ["/path/to/mcp-search-and-create-task/dist/server-v2.js"]
    }
  }
}

Usage

Available Tools

Both servers provide the following tools:

hello_world

  • Description: Test MCP connection
  • Parameters:
    • name (optional): Name to greet

search_patient_v2 (V2 Server)

  • Description: Search for patients using Puppeteer web automation
  • Parameters:
    • patient_name (required): Name of the patient to search for
    • detailed (optional): Whether to return detailed information

create_new_task (V2 Server)

  • Description: Create a new task
  • Parameters:
    • task_type (required): Type of the task to create
    • task_name (required): Name of the task to create
    • description (optional): Any description you want to add to the task

Example Usage

// Test connection
await callTool("hello_world", { name: "Aakarsh" });

// Search for a patient (V2 server)
await callTool("search_patient_v2", { 
  patient_name: "John Smith",
  detailed: true 
});

Development

Running in Development Mode

npm run dev

### Starting the Server

```bash
# Latest server
npm start

### Testing

You can test the servers directly using JSON-RPC messages:

```bash
# Test V2 server initialization
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0.0"}}}' | node dist/server-v2.js

I have also created a sample test file to test task creation called test-task-creation. You can run the test through the command node dist/test-task-creation.js once you have built the server.

Troubleshooting

Common Issues

  1. Browser launch fails (V2 server):

    • Ensure you have sufficient system resources
    • Try running with --no-sandbox flag (already included)
  2. Login fails:

    • Verify credentials are correct
    • Check if the Atlas staging site is accessible
    • Ensure network connectivity
  3. Patient search returns no results:

    • Verify the patient name spelling
    • Check if you're logged into the correct environment
    • Try with a partial name match

Debug Mode

Both servers log debug information to stderr. Monitor the console output for detailed error messages. Additionally if you need to clear the /dist folder you can run npm run clean.

Dependencies

  • @modelcontextprotocol/sdk: MCP TypeScript SDK
  • puppeteer: Web automation (V2 server)
  • dotenv: Environment variable management
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Tavily Mcp