A Model Context Protocol (MCP) server with integrated medical and healthcare API access through MedixHub.
- Pure JavaScript implementation
- Exposes functions with standardized MCP metadata
- Executes functions with parameter validation
- Seamlessly integrates with LLMs like Ollama
- Secure API endpoints with authentication
- Supports streaming responses
The server includes JavaScript implementations of these functions:
- executeOpenTargetQuery - Executes GraphQL queries against the OpenTarget API
- FDADrugLabelSearch - Retrieves drug information from the FDA database
- get_drug_generic_name - Maps between generic and brand drug names
- MonarchSearch - Searches the Monarch database for genes, diseases, or phenotypes
- MonarchDiseasesForMultiplePhenotypes - Finds diseases matching multiple phenotypes
- Disease information lookup
- Drug details and associations
- Target (gene/protein) information
- Disease-target associations
- Drug-disease relationships
- Drug information search
- Generic and brand name mapping
- Adverse reactions lookup
- Drug interactions search
- Biomedical entity search
- Disease-phenotype associations
- Gene-phenotype relationships
- Multi-phenotype disease finder
- Node.js 14 or later
- npm or yarn
- Clone the repository
git clone https://github.com/yourusername/medixhub-mcp-server.git
cd medixhub-mcp-server- Install dependencies
npm install- Configure environment variables
cp .env.example .env
# Edit .env with your settings- Start the server
npm startFor development with auto-reload:
npm run devUse the /execute endpoint to run any registered MedixHub function:
POST /execute
Content-Type: application/json
{
"name": "queryFDADrugLabel",
"parameters": {
"searchFields": {
"drug_name": ["openfda.brand_name", "openfda.generic_name"]
},
"returnFields": ["openfda.generic_name", "warnings"],
"arguments": {
"drug_name": "ibuprofen",
"limit": 1
}
}
}Use the /medixhub endpoints for direct API access:
/medixhub/opentargets/medixhub/opentargets-genetics/medixhub/drug-by-name/medixhub/fda-drug-label/medixhub/drug-generic-name/medixhub/monarch/medixhub/diseases-for-phenotypes
Get information about available functions:
/functions- All available functions/functions/medixhub- MedixHub-specific functions/functions/category/:category- Functions by category
Full API documentation is available at /functions/medixhub
medixhub-mcp-server/
├── server.js # Main server file
├── src/
│ ├── medixhub/ # MedixHub integration
│ ├── middleware/ # Middleware
│ ├── routes/ # Route handlers
│ └── services/ # Services
├── examples/ # Usage examples
└── tests/ # Test suite
To add a new function to the registry:
const { registerFunction } = require('./src/services/functionRegistry');
registerFunction('myNewFunction', {
name: 'myNewFunction',
description: 'Description of what this function does',
parameters: {
// Parameter schema
},
function: async (params) => {
// Implementation
return result;
}
});npm testThe server supports two authentication methods:
- API Keys: Simple key-based authentication
- JWT Tokens: More granular access control
In production mode, authentication is required for all endpoints except function discovery.
Configure the server through the following environment variables:
PORT: Server port (default: 3000)NODE_ENV: Environment ('development' or 'production')OLLAMA_API_URL: URL for Ollama APIAPI_KEYS: Comma-separated list of valid API keysFDA_API_KEY: API key for FDA drug database
See .env.example for all available options.
- The server uses asynchronous processing for all API calls
- Rate limiting is enabled to prevent abuse
- Timeout handling prevents hanging requests
- Memory usage is optimized by processing streams efficiently
This project is licensed under the MIT License - see the LICENSE file for details.