@ythalorossy/openfda 1.0.19 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +101 -94
  3. package/dist/index.js +404 -311
  4. package/package.json +5 -4
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Ythalo Saldanha
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ythalo Saldanha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,95 +1,102 @@
1
- # OpenFDA MCP Server
2
-
3
- A Model Context Protocol (MCP) server for querying drug information from the OpenFDA API.
4
-
5
- <a href="https://glama.ai/mcp/servers/@ythalorossy/openfda">
6
- <img width="380" height="200" src="https://glama.ai/mcp/servers/@ythalorossy/openfda/badge" alt="OpenFDA MCP server" />
7
- </a>
8
-
9
- ## Features
10
-
11
- - Retrieve drug label information by brand name
12
- - Retrieve drug information by generic (active ingredient) name
13
- - Get all brand versions of a generic drug
14
- - Get adverse event (side effect) reports for a drug (by brand or generic name)
15
- - Retrieve all drugs manufactured by a specific company
16
- - Get comprehensive drug safety information (warnings, contraindications, interactions, precautions, etc.)
17
- - Normalize and validate NDC (National Drug Code) formats
18
- - Helpful error messages and suggestions for failed queries
19
-
20
- 1. **Set up your OpenFDA API Key**
21
-
22
- The MCP server requires an OpenFDA API key to access the OpenFDA API.
23
- Create a `.env` file in the root of your project and add the following line:
24
-
25
- ```env
26
- OPENFDA_API_KEY=your_openfda_api_key_here
27
- ```
28
-
29
- > **Note:** Never commit your real API key to version control.
30
- > You can obtain an API key from [OpenFDA API Key Registration](https://open.fda.gov/apis/authentication/).
31
-
32
- 2. **Example MCP Server Configuration**
33
-
34
- If you are integrating this server with a larger MCP system, your configuration might look like:
35
-
36
- ```json
37
- {
38
- "mcpServers": {
39
- "openfda": {
40
- "command": "npx",
41
- "args": [
42
- "@ythalorossy/openfda"
43
- ],
44
- "env": {
45
- "OPENFDA_API_KEY": "*****************************************"
46
- },
47
- "timeout": 60000,
48
- "autoApprove": [
49
- "get-drug-by-name",
50
- "get-drug-by-generic-name",
51
- "get-drug-adverse-events",
52
- "get-drugs-by-manufacturer",
53
- "get-drug-safety-info",
54
- "get-drug-by-ndc",
55
- "get-drug-by-product-ndc"
56
- ]
57
- }
58
- }
59
- }
60
- ```
61
-
62
- Replace the asterisks with your actual API key, or ensure it is loaded from your `.env` file.
63
-
64
- ## Want to run it locally?
65
-
66
- ```bash
67
- git clone https://github.com/ythalorossy/openfda.git
68
- cd openfda
69
- npm install
70
- npm run build
71
- ```
72
-
73
- Then start the server:
74
-
75
- ```bash
76
- node bin/index.js
77
- ```
78
-
79
- Or use it directly with npx:
80
-
81
- ```bash
82
- npx @ythalorossy/openfda
83
- ```
84
-
85
- ## Configuration
86
-
87
- Create a `.env` file for any required environment variables.
88
-
89
- ## License
90
-
91
- MIT
92
-
93
- [Buy me a Coffee](https://buymeacoffee.com/ythalorossy)
94
-
1
+ # OpenFDA MCP Server
2
+
3
+ A Model Context Protocol (MCP) server for querying drug information from the OpenFDA API.
4
+
5
+ <a href="https://glama.ai/mcp/servers/@ythalorossy/openfda">
6
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@ythalorossy/openfda/badge" alt="OpenFDA MCP server" />
7
+ </a>
8
+
9
+ ## Features
10
+
11
+ - Retrieve drug label information by brand name
12
+ - Retrieve drug information by generic (active ingredient) name
13
+ - Get all brand versions of a generic drug
14
+ - Get adverse event (side effect) reports for a drug (by brand or generic name)
15
+ - Retrieve all drugs manufactured by a specific company
16
+ - Get comprehensive drug safety information (warnings, contraindications, interactions, precautions, etc.)
17
+ - Retrieve full Drugs@FDA application data for a given section and field
18
+ - Normalize and validate NDC (National Drug Code) formats
19
+ - Helpful error messages and suggestions for failed queries
20
+
21
+ 1. **Set up your OpenFDA API Key**
22
+
23
+ The server reads `OPENFDA_API_KEY` from its process environment. It is
24
+ launched by your MCP client, so the key belongs in the `env` block of your
25
+ client configuration (shown below) — **a `.env` file is not read.**
26
+
27
+ Get a key from [OpenFDA API Key Registration](https://open.fda.gov/apis/authentication/).
28
+ A key raises your limit from 40 to 240 requests per minute.
29
+
30
+ Without a key, every tool call returns a configuration error rather than
31
+ failing confusingly upstream. To run on the unauthenticated tier anyway,
32
+ set `OPENFDA_ALLOW_KEYLESS=1` note that tier reports no rate-limit
33
+ headers, so exhausting it surfaces as slow, intermittent failures.
34
+
35
+ > **Note:** Never commit your real API key to version control.
36
+
37
+ 2. **Example MCP Server Configuration**
38
+
39
+ If you are integrating this server with a larger MCP system, your configuration might look like:
40
+
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "openfda": {
45
+ "command": "npx",
46
+ "args": [
47
+ "-y",
48
+ "@ythalorossy/openfda"
49
+ ],
50
+ "env": {
51
+ "OPENFDA_API_KEY": "*****************************************"
52
+ },
53
+ "timeout": 60000,
54
+ "autoApprove": [
55
+ "get-drug-by-name",
56
+ "get-drug-by-generic-name",
57
+ "get-drug-adverse-events",
58
+ "get-drugs-by-manufacturer",
59
+ "get-drug-safety-info",
60
+ "get-drug-by-ndc",
61
+ "get-drug-by-product-ndc",
62
+ "get-drugsfda"
63
+ ]
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ Replace the asterisks with your actual API key.
70
+
71
+ ## Want to run it locally?
72
+
73
+ ```bash
74
+ git clone https://github.com/ythalorossy/openfda.git
75
+ cd openfda
76
+ npm install
77
+ npm run build
78
+ ```
79
+
80
+ Then start the server:
81
+
82
+ ```bash
83
+ node dist/index.js
84
+ ```
85
+
86
+ Or use it directly with npx:
87
+
88
+ ```bash
89
+ npx @ythalorossy/openfda
90
+ ```
91
+
92
+ ## Configuration
93
+
94
+ Export `OPENFDA_API_KEY` in your shell before running locally: `export OPENFDA_API_KEY=your_key`.
95
+
96
+ ## License
97
+
98
+ MIT
99
+
100
+ [Buy me a Coffee](https://buymeacoffee.com/ythalorossy)
101
+
95
102
  ![coff.ee/ythalorossy](https://raw.githubusercontent.com/ythalorossy/openfda/refs/heads/main/bmc_qr.png "Buy me a Coffee")