Humanlearning commited on
Commit
a7f6295
·
1 Parent(s): 86ef758

feat: Add Gradio application entry point with MCP client and Hugging Face Spaces configuration.

Browse files
Files changed (2) hide show
  1. README.md +11 -0
  2. app.py +24 -0
README.md CHANGED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: CredentialWatch
3
+ emoji: 🛡️
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: gradio
7
+ sdk_version: 4.0.0
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ import os
3
+ import asyncio
4
+
5
+ # Add src to path so we can import the package
6
+ sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
7
+
8
+ from credentialwatch_agent.main import demo, mcp_client
9
+
10
+ if __name__ == "__main__":
11
+ # Simple async wrapper to run the app
12
+ loop = asyncio.new_event_loop()
13
+ asyncio.set_event_loop(loop)
14
+
15
+ try:
16
+ print("Connecting to MCP servers...")
17
+ loop.run_until_complete(mcp_client.connect())
18
+ print("Starting Gradio app...")
19
+ demo.launch()
20
+ except KeyboardInterrupt:
21
+ pass
22
+ finally:
23
+ print("Closing MCP connections...")
24
+ loop.run_until_complete(mcp_client.close())