crcdng
commited on
Commit
·
e58684e
1
Parent(s):
d2ff44f
update api key
Browse files- doomsweek_mcp_server.py +5 -2
- requirements.txt +1 -0
doomsweek_mcp_server.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
# -*- coding: utf-8 -*-
|
| 2 |
|
| 3 |
from mcp.server.fastmcp import FastMCP
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import io
|
| 6 |
import json
|
|
@@ -10,6 +11,8 @@ import sys
|
|
| 10 |
|
| 11 |
import requests
|
| 12 |
|
|
|
|
|
|
|
| 13 |
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
|
| 14 |
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
|
| 15 |
|
|
@@ -66,9 +69,9 @@ def calc_doom_probability():
|
|
| 66 |
The overall doom probability for the next seven days.
|
| 67 |
"""
|
| 68 |
|
| 69 |
-
nasa_url = "https://api.nasa.gov/neo/rest/v1/feed"
|
| 70 |
-
nasa_api_key = os.getenv("NASA_API_KEY")
|
| 71 |
|
|
|
|
| 72 |
if not nasa_api_key:
|
| 73 |
return "ERROR: NASA_API_KEY not set."
|
| 74 |
else:
|
|
|
|
| 1 |
# -*- coding: utf-8 -*-
|
| 2 |
|
| 3 |
from mcp.server.fastmcp import FastMCP
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
import gradio as gr
|
| 6 |
import io
|
| 7 |
import json
|
|
|
|
| 11 |
|
| 12 |
import requests
|
| 13 |
|
| 14 |
+
load_dotenv()
|
| 15 |
+
|
| 16 |
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
|
| 17 |
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
|
| 18 |
|
|
|
|
| 69 |
The overall doom probability for the next seven days.
|
| 70 |
"""
|
| 71 |
|
| 72 |
+
nasa_url = "https://api.nasa.gov/neo/rest/v1/feed"
|
|
|
|
| 73 |
|
| 74 |
+
nasa_api_key = os.getenv("NASA_API_KEY")
|
| 75 |
if not nasa_api_key:
|
| 76 |
return "ERROR: NASA_API_KEY not set."
|
| 77 |
else:
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
gradio[mcp]
|
| 2 |
anthropic
|
| 3 |
mcp
|
|
|
|
| 1 |
+
dotenv
|
| 2 |
gradio[mcp]
|
| 3 |
anthropic
|
| 4 |
mcp
|