Spaces:
Paused
Paused
Commit
Β·
fc9de92
1
Parent(s):
9ea1761
refactor: remove mpc_info page
Browse files- src/app.py +0 -2
- src/ui/pages/mcp_info.py +0 -136
src/app.py
CHANGED
@@ -9,7 +9,6 @@ logger = get_logger(__name__)
|
|
9 |
|
10 |
from handlers.mcp_backend import process_message_and_attached_file
|
11 |
from ui.pages.chat import draw_chat_page
|
12 |
-
from ui.pages.mcp_info import draw_info_page
|
13 |
|
14 |
|
15 |
# Store last chat message and file in global variables (for demo purposes)
|
@@ -46,7 +45,6 @@ def app(debug: bool = False):
|
|
46 |
)
|
47 |
|
48 |
draw_chat_page(debug)
|
49 |
-
draw_info_page(debug)
|
50 |
|
51 |
# Register the MCP tool as an API endpoint
|
52 |
gr.api(process_message_and_attached_file)
|
|
|
9 |
|
10 |
from handlers.mcp_backend import process_message_and_attached_file
|
11 |
from ui.pages.chat import draw_chat_page
|
|
|
12 |
|
13 |
|
14 |
# Store last chat message and file in global variables (for demo purposes)
|
|
|
45 |
)
|
46 |
|
47 |
draw_chat_page(debug)
|
|
|
48 |
|
49 |
# Register the MCP tool as an API endpoint
|
50 |
gr.api(process_message_and_attached_file)
|
src/ui/pages/mcp_info.py
DELETED
@@ -1,136 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
from utils.logging_config import setup_logging, get_logger
|
4 |
-
|
5 |
-
# Initialize logging
|
6 |
-
setup_logging()
|
7 |
-
logger = get_logger(__name__)
|
8 |
-
|
9 |
-
|
10 |
-
def draw_info_page(debug: bool = False):
|
11 |
-
with gr.Tab("π Use as MCP Tool"):
|
12 |
-
|
13 |
-
gr.Markdown(
|
14 |
-
"""
|
15 |
-
## π **Using as MCP Tool**
|
16 |
-
|
17 |
-
You can use Yuga Planner as an MCP server to integrate scheduling into your AI workflows.
|
18 |
-
"""
|
19 |
-
)
|
20 |
-
|
21 |
-
gr.Textbox(
|
22 |
-
value=get_server_url(),
|
23 |
-
label="π MCP Server Endpoint",
|
24 |
-
interactive=False,
|
25 |
-
max_lines=1,
|
26 |
-
)
|
27 |
-
|
28 |
-
with gr.Accordion("π MCP Setup Instructions", open=True):
|
29 |
-
gr.Markdown(
|
30 |
-
"""
|
31 |
-
### 1. **Cursor Setup Instructions (should work from any MCP client!)**
|
32 |
-
|
33 |
-
**For Cursor AI Editor:**
|
34 |
-
1. Create or edit your MCP configuration file: `~/.cursor/mcp.json`
|
35 |
-
2. Add the yuga-planner server configuration:
|
36 |
-
```json
|
37 |
-
{
|
38 |
-
"mcpServers": {
|
39 |
-
"yuga-planner": {
|
40 |
-
"url": -> "Insert the above endpoint URL here"
|
41 |
-
}
|
42 |
-
}
|
43 |
-
}
|
44 |
-
```
|
45 |
-
3. If you already have other MCP servers, add `yuga-planner` to the existing `mcpServers` object
|
46 |
-
4. Restart Cursor to load the new configuration
|
47 |
-
5. The tool will be available in your chat
|
48 |
-
|
49 |
-
### 2. **Usage Example**
|
50 |
-
"""
|
51 |
-
)
|
52 |
-
|
53 |
-
gr.Textbox(
|
54 |
-
value="""use yuga-planner mcp tool
|
55 |
-
Task Description: Create a new EC2 instance on AWS
|
56 |
-
|
57 |
-
[Attach your calendar.ics file to provide existing commitments]
|
58 |
-
|
59 |
-
Tool Response: Optimized schedule created - EC2 setup task assigned to
|
60 |
-
available time slots around your existing meetings
|
61 |
-
[Returns JSON response with schedule data]
|
62 |
-
|
63 |
-
User: show all fields as a table, ordered by start date
|
64 |
-
|
65 |
-
[Displays formatted schedule table with all tasks and calendar events]""",
|
66 |
-
label="π¬ Cursor Chat Usage Example",
|
67 |
-
interactive=False,
|
68 |
-
lines=10,
|
69 |
-
)
|
70 |
-
|
71 |
-
gr.Markdown(
|
72 |
-
"""
|
73 |
-
### 3. **What it does**
|
74 |
-
|
75 |
-
**Personal Task Scheduling with Calendar Integration:**
|
76 |
-
|
77 |
-
1. π
**Parses your calendar** (.ics file) for existing commitments
|
78 |
-
2. π€ **AI breaks down your task** into actionable subtasks using LLamaIndex + Nebius AI
|
79 |
-
3. β‘ **Constraint-based optimization** finds optimal time slots around your existing schedule
|
80 |
-
4. π **Returns complete solved schedule** integrated with your personal calendar events
|
81 |
-
5. π **Respects business hours** (9:00-18:00) and excludes weekends automatically
|
82 |
-
6. π **JSON response format** - Ask to "show all fields as a table, ordered by start date" for readable formatting
|
83 |
-
|
84 |
-
**Designed for**: Personal productivity and task planning around existing appointments in Cursor.
|
85 |
-
"""
|
86 |
-
)
|
87 |
-
|
88 |
-
if debug:
|
89 |
-
with gr.Tab("π Debug Info"):
|
90 |
-
gr.Markdown(
|
91 |
-
"""
|
92 |
-
# π Debug Information
|
93 |
-
|
94 |
-
**Debug Mode Enabled** - Additional system information and controls available.
|
95 |
-
"""
|
96 |
-
)
|
97 |
-
|
98 |
-
with gr.Accordion("π§ **Environment Details**", open=True):
|
99 |
-
import os
|
100 |
-
|
101 |
-
env_info = f"""
|
102 |
-
**π Python Environment**
|
103 |
-
- Debug Mode: {debug}
|
104 |
-
- YUGA_DEBUG: {os.getenv('YUGA_DEBUG', 'Not Set')}
|
105 |
-
- Nebius API Key: {'β
Set' if os.getenv('NEBIUS_API_KEY') else 'β Not Set'}
|
106 |
-
- Nebius Model: {os.getenv('NEBIUS_MODEL', 'Not Set')}
|
107 |
-
|
108 |
-
**π Server Information**
|
109 |
-
- MCP Endpoint: {get_server_url()}
|
110 |
-
- Current Working Directory: {os.getcwd()}
|
111 |
-
"""
|
112 |
-
gr.Markdown(env_info)
|
113 |
-
|
114 |
-
with gr.Accordion("π **System Status**", open=False):
|
115 |
-
gr.Markdown(
|
116 |
-
"""
|
117 |
-
**π Service Status**
|
118 |
-
- DataService: β
Active
|
119 |
-
- ScheduleService: β
Active
|
120 |
-
- StateService: β
Active
|
121 |
-
- LoggingService: β
Active
|
122 |
-
- MockProjectService: β
Active
|
123 |
-
|
124 |
-
**π Integration Status**
|
125 |
-
- MCP Server: β
Enabled
|
126 |
-
- Gradio API: β
Active
|
127 |
-
- Real-time Logs: β
Streaming
|
128 |
-
"""
|
129 |
-
)
|
130 |
-
|
131 |
-
|
132 |
-
def get_server_url():
|
133 |
-
try:
|
134 |
-
return gr.get_state().server_url + "/gradio_api/mcp/sse"
|
135 |
-
except:
|
136 |
-
return "https://blackopsrepl-yuga-planner.hf.space/gradio_api/mcp/sse"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|