@ythalorossy/openfda 1.0.0 → 1.0.1
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.
- package/LICENSE +21 -0
- package/README.md +76 -0
- package/package.json +12 -6
package/LICENSE
ADDED
|
@@ -0,0 +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
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# OpenFDA MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server for querying drug information from the OpenFDA API.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Retrieve drug label information by brand name
|
|
8
|
+
- Returns key drug information fields (brand name, generic name, manufacturer, NDC, etc.)
|
|
9
|
+
|
|
10
|
+
1. **Set up your OpenFDA API Key**
|
|
11
|
+
|
|
12
|
+
The MCP server requires an OpenFDA API key to access the OpenFDA API.
|
|
13
|
+
Create a `.env` file in the root of your project and add the following line:
|
|
14
|
+
|
|
15
|
+
```env
|
|
16
|
+
OPENFDA_API_KEY=your_openfda_api_key_here
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> **Note:** Never commit your real API key to version control.
|
|
20
|
+
> You can obtain an API key from [OpenFDA API Key Registration](https://open.fda.gov/apis/authentication/).
|
|
21
|
+
|
|
22
|
+
2. **Example MCP Server Configuration**
|
|
23
|
+
|
|
24
|
+
If you are integrating this server with a larger MCP system, your configuration might look like:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"openfda": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["@ythalorossy/openfda"],
|
|
32
|
+
"env": {
|
|
33
|
+
"OPENFDA_API_KEY": "************"
|
|
34
|
+
},
|
|
35
|
+
"timeout": 60000
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Replace the asterisks with your actual API key, or ensure it is loaded from your `.env` file.
|
|
42
|
+
|
|
43
|
+
## Want to run it local?
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
git clone https://github.com/ythalorossy/openfda.git
|
|
47
|
+
cd openfda
|
|
48
|
+
npm install
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
First, build the project:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm run build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then, start the server from the build folder:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
node build/index.js
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Key Points:**
|
|
66
|
+
- The build step (`npm run build`) compiles your source files into the build/ directory.
|
|
67
|
+
- 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.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
Create a `.env` file for any required environment variables.
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ythalorossy/openfda",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "OpenFDA Model Context Protocol",
|
|
5
5
|
"bin": {
|
|
6
6
|
"openfda": "./bin/index.js"
|
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
"build:cli": "npm run build && node scripts/add-shebang.cjs && shx cp -r build/* bin/",
|
|
12
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
13
|
},
|
|
14
|
-
"keywords": [
|
|
14
|
+
"keywords": [
|
|
15
|
+
"openfda",
|
|
16
|
+
"drugs",
|
|
17
|
+
"mcp",
|
|
18
|
+
"server"
|
|
19
|
+
],
|
|
15
20
|
"author": "Ythalo Saldanha",
|
|
16
|
-
"license": "
|
|
21
|
+
"license": "MIT",
|
|
17
22
|
"type": "module",
|
|
18
23
|
"files": [
|
|
19
24
|
"build",
|
|
@@ -21,12 +26,13 @@
|
|
|
21
26
|
],
|
|
22
27
|
"dependencies": {
|
|
23
28
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
29
|
+
"@ythalorossy/openfda": "^1.0.0",
|
|
24
30
|
"dotenv": "^17.2.0",
|
|
25
31
|
"zod": "^3.25.76"
|
|
26
32
|
},
|
|
27
33
|
"devDependencies": {
|
|
28
34
|
"@types/node": "^24.0.14",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
35
|
+
"shx": "^0.3.4",
|
|
36
|
+
"typescript": "^5.8.3"
|
|
31
37
|
}
|
|
32
|
-
}
|
|
38
|
+
}
|