Provides a way for users to support the developer through the Buy Me A Coffee platform, with both a link and QR code included in the README.
Used for loading environment variables from a .env file, specifically for storing and accessing the OpenFDA API key securely.
The repository is hosted on GitHub, allowing users to clone the source code for local development and modification.
The MCP server is distributed as an npm package that can be installed and run using npx.
OpenFDA MCP Server
A Model Context Protocol (MCP) server for querying drug information from the OpenFDA API.
Features
Retrieve drug label information by brand name
Retrieve drug information by generic (active ingredient) name
Get all brand versions of a generic drug
Get adverse event (side effect) reports for a drug (by brand or generic name)
Retrieve all drugs manufactured by a specific company
Get comprehensive drug safety information (warnings, contraindications, interactions, precautions, etc.)
Normalize and validate NDC (National Drug Code) formats
Helpful error messages and suggestions for failed queries
Set up your OpenFDA API Key
The MCP server requires an OpenFDA API key to access the OpenFDA API.
Create a.envfile in the root of your project and add the following line:OPENFDA_API_KEY=your_openfda_api_key_hereNote: Never commit your real API key to version control.
You can obtain an API key from OpenFDA API Key Registration.Example MCP Server Configuration
If you are integrating this server with a larger MCP system, your configuration might look like:
{ "mcpServers": { "openfda": { "command": "npx", "args": ["@ythalorossy/openfda"], "env": { "OPENFDA_API_KEY": "************" }, "timeout": 60000 } } }Replace the asterisks with your actual API key, or ensure it is loaded from your
.envfile.
Related MCP server: Healthcare MCP Server
Want to run it local?
Usage
First, build the project:
Then, start the server from the build folder:
Key Points:
The build step (
npm run build) compiles your source files into the build/ directory.You should run the compiled output (e.g.,
build/bin/index.js), not the source file (bin/index.js), unless your project is set up to run directly from source.
Configuration
Create a .env file for any required environment variables.
License
MIT
