google-labs-jules[bot] commited on
Commit
8eb0138
·
1 Parent(s): e1659de

Make alert_mcp_server compatible with Hugging Face Spaces

Browse files

- Rename main.py to app.py
- Update imports to be absolute for script execution
- Add requirements.txt with gradio[mcp]
- Add README.md with Space metadata

src/alert_mcp_server/README.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: CredentialWatch Alert MCP
3
+ emoji: 🚨
4
+ colorFrom: red
5
+ colorTo: yellow
6
+ sdk: gradio
7
+ sdk_version: 5.9.1
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ # CredentialWatch Alert MCP Server
13
+
14
+ This is a Gradio-based MCP server for managing alerts in CredentialWatch.
15
+
16
+ ## Features
17
+
18
+ - Log new alerts
19
+ - View open alerts
20
+ - Resolve alerts
21
+ - Summarize alerts
22
+
23
+ ## Usage
24
+
25
+ This Space is MCP-compatible. You can add it to your MCP client (like Cursor or Claude) by using the URL of this Space.
src/alert_mcp_server/{main.py → app.py} RENAMED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from .tools import log_alert, get_open_alerts, mark_alert_resolved, summarize_alerts
3
 
4
  # Define the Gradio interface
5
  # We can use a TabbedInterface to organize the tools for the UI,
 
1
  import gradio as gr
2
+ from tools import log_alert, get_open_alerts, mark_alert_resolved, summarize_alerts
3
 
4
  # Define the Gradio interface
5
  # We can use a TabbedInterface to organize the tools for the UI,
src/alert_mcp_server/requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ gradio[mcp]
2
+ httpx
3
+ pydantic
4
+ python-dotenv
5
+ mcp
src/alert_mcp_server/tools.py CHANGED
@@ -1,7 +1,7 @@
1
  import httpx
2
  from typing import List, Optional, Dict, Any
3
- from .config import ALERT_API_BASE_URL
4
- from .schemas import AlertCreate, AlertRead, AlertResolution
5
 
6
  # We'll use a synchronous client for simplicity in Gradio functions,
7
  # but Gradio supports async too. Let's use synchronous for now as it's often easier with Gradio tools.
 
1
  import httpx
2
  from typing import List, Optional, Dict, Any
3
+ from config import ALERT_API_BASE_URL
4
+ from schemas import AlertCreate, AlertRead, AlertResolution
5
 
6
  # We'll use a synchronous client for simplicity in Gradio functions,
7
  # but Gradio supports async too. Let's use synchronous for now as it's often easier with Gradio tools.