-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstatus.html
More file actions
235 lines (218 loc) · 8.81 KB
/
status.html
File metadata and controls
235 lines (218 loc) · 8.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Adaptive Graph of Thoughts MCP Server Status</title>
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 20px;
color: #333;
}
h1 {
color: #2c3e50;
border-bottom: 2px solid #3498db;
padding-bottom: 10px;
}
.status-card {
background-color: #f8f9fa;
border-left: 4px solid #3498db;
padding: 15px;
margin-bottom: 20px;
border-radius: 4px;
}
.endpoint-box {
background-color: #edf2f7;
padding: 10px;
border-radius: 4px;
font-family: monospace;
margin: 10px 0;
}
.status-indicator {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 8px;
}
.status-good {
background-color: #2ecc71;
}
.status-warning {
background-color: #f39c12;
}
.status-error {
background-color: #e74c3c;
}
button {
background-color: #3498db;
color: white;
border: none;
padding: 8px 15px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
button:hover {
background-color: #2980b9;
}
pre {
background-color: #f8f9fa;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}
.test-area {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #ddd;
}
</style>
</head>
<body>
<h1>Adaptive Graph of Thoughts MCP Server Status</h1>
<div class="status-card">
<h2><span class="status-indicator status-good" id="health-indicator"></span> Server Health</h2>
<p>Current status: <span id="health-status">Checking...</span></p>
<p>Version: <span id="health-version">Checking...</span></p>
<button onclick="checkHealth()">Check Health</button>
</div>
<div class="status-card">
<h2><span class="status-indicator status-warning" id="mcp-indicator"></span> MCP Endpoint</h2>
<p>Status: <span id="mcp-status">Checking...</span></p>
<div class="endpoint-box">
http://localhost:8000/mcp
</div>
<button onclick="testMCPEndpoint()">Test MCP Connection</button>
<div id="mcp-result" style="margin-top: 10px;"></div>
</div>
<div class="status-card">
<h2>Available Tools</h2>
<p>List of exposed MCP methods.</p>
<div class="endpoint-box">
<a href="/tools">/tools</a>
</div>
</div>
<div class="status-card">
<h2>Claude Desktop Integration</h2>
<p>Integration file: <code>config/claude_mcp_config.json</code></p>
<p>To integrate with Claude Desktop:</p>
<ol>
<li>Ensure the Adaptive Graph of Thoughts server is running</li>
<li>Open Claude Desktop settings</li>
<li>Add a new Tool/Integration</li>
<li>Import the MCP configuration file</li>
</ol>
<p>See the <a href="claude_desktop_integration.md">integration guide</a> for complete instructions.</p>
</div>
<div class="test-area">
<h2>Test Query</h2>
<textarea id="test-query" rows="4" style="width: 100%">What is the relationship between climate change and ocean acidification?</textarea>
<button onclick="sendTestQuery()" style="margin-top: 10px;">Send Test Query</button>
<h3>Response:</h3>
<pre id="query-response">No query sent yet.</pre>
</div>
<script>
// Check server health
async function checkHealth() {
try {
const response = await fetch('http://localhost:8000/health');
const data = await response.json();
document.getElementById('health-status').textContent = data.status;
document.getElementById('health-version').textContent = data.version;
if (data.status === 'healthy') {
document.getElementById('health-indicator').className = 'status-indicator status-good';
} else {
document.getElementById('health-indicator').className = 'status-indicator status-warning';
}
} catch (error) {
document.getElementById('health-status').textContent = 'Error connecting to server';
document.getElementById('health-version').textContent = 'N/A';
document.getElementById('health-indicator').className = 'status-indicator status-error';
}
}
// Test MCP endpoint with initialize request
async function testMCPEndpoint() {
try {
const initializeRequest = {
jsonrpc: '2.0',
id: 'status-page-init-1',
method: 'initialize',
params: {
client_info: {
client_name: 'Adaptive Graph of Thoughts Status Page'
},
process_id: 12345
}
};
const response = await fetch('http://localhost:8000/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(initializeRequest)
});
const data = await response.json();
document.getElementById('mcp-result').innerHTML = '<pre>' + JSON.stringify(data, null, 2) + '</pre>';
if (response.ok && data.result) {
document.getElementById('mcp-status').textContent = 'Connected';
document.getElementById('mcp-indicator').className = 'status-indicator status-good';
} else {
document.getElementById('mcp-status').textContent = 'Error in response';
document.getElementById('mcp-indicator').className = 'status-indicator status-warning';
}
} catch (error) {
document.getElementById('mcp-status').textContent = 'Connection failed';
document.getElementById('mcp-indicator').className = 'status-indicator status-error';
document.getElementById('mcp-result').innerHTML = '<pre>Error: ' + error.message + '</pre>';
}
}
// Send test query
async function sendTestQuery() {
try {
const queryText = document.getElementById('test-query').value;
const queryRequest = {
jsonrpc: '2.0',
id: 'status-page-query-1',
method: 'asr_got.query',
params: {
query: queryText,
session_id: 'test-session-' + Date.now(),
context: {
conversation_id: 'status-page-convo',
history: []
},
parameters: {
include_reasoning_trace: true,
include_graph_state: true,
max_nodes_in_response_graph: 50,
output_detail_level: 'summary'
}
}
};
document.getElementById('query-response').textContent = 'Sending query...';
const response = await fetch('http://localhost:8000/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(queryRequest)
});
const data = await response.json();
document.getElementById('query-response').textContent = JSON.stringify(data, null, 2);
} catch (error) {
document.getElementById('query-response').textContent = 'Error: ' + error.message;
}
}
// Initial check when page loads
window.onload = function() {
checkHealth();
// Don't auto-run MCP test to avoid unnecessary calls
}
</script>
</body>
</html>