fa-mcp-sdk 0.4.108 → 0.4.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-template/package.json +1 -1
- package/config/local.yaml +2 -2
- package/dist/core/agent-tester/agent-tester-router.d.ts.map +1 -1
- package/dist/core/agent-tester/agent-tester-router.js +30 -0
- package/dist/core/agent-tester/agent-tester-router.js.map +1 -1
- package/dist/core/web/static/agent-tester/index.html +84 -0
- package/dist/core/web/static/agent-tester/pretty-print-json.js +93 -0
- package/dist/core/web/static/agent-tester/script.js +574 -0
- package/dist/core/web/static/agent-tester/styles.css +335 -0
- package/package.json +1 -1
package/config/local.yaml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
agentTester:
|
|
3
3
|
enabled: true
|
|
4
4
|
showFooterLink: true # true (default) — show Agent Tester link in home page footer; false — hide link without disabling tester
|
|
5
|
-
useAuth:
|
|
5
|
+
useAuth: false
|
|
6
6
|
openAi:
|
|
7
7
|
# apiKeyName: TMP-jira-blue-agent-tester
|
|
8
8
|
# apiKey: sk-y-7WHjtIXDwDoXFaPUH-UA
|
|
@@ -97,7 +97,7 @@ webServer:
|
|
|
97
97
|
port: 9876
|
|
98
98
|
auth:
|
|
99
99
|
enabled: true
|
|
100
|
-
permanentServerTokens: [ 'test-
|
|
100
|
+
permanentServerTokens: [ 'test-token' ]
|
|
101
101
|
jwtToken:
|
|
102
102
|
encryptKey: '66666666-7777-8888-9999-000000000000'
|
|
103
103
|
checkMCPName: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tester-router.d.ts","sourceRoot":"","sources":["../../../src/core/agent-tester/agent-tester-router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAyBjC,wBAAgB,uBAAuB,CACrC,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C,GACL,MAAM,
|
|
1
|
+
{"version":3,"file":"agent-tester-router.d.ts","sourceRoot":"","sources":["../../../src/core/agent-tester/agent-tester-router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAyBjC,wBAAgB,uBAAuB,CACrC,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C,GACL,MAAM,CA8SR"}
|
|
@@ -238,6 +238,36 @@ export function createAgentTesterRouter(options = {}) {
|
|
|
238
238
|
router.get('/api/mcp/servers', (req, res) => {
|
|
239
239
|
res.json(mcpClientService.getAllServerConfigs());
|
|
240
240
|
});
|
|
241
|
+
// POST /api/mcp/call-tool — direct MCP tool invocation (no LLM involved)
|
|
242
|
+
router.post('/api/mcp/call-tool', async (req, res) => {
|
|
243
|
+
try {
|
|
244
|
+
const { serverName, toolName, parameters } = req.body || {};
|
|
245
|
+
if (!serverName || !toolName) {
|
|
246
|
+
res.status(400).json({ error: 'serverName and toolName are required' });
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const server = mcpClientService.getAllServerConfigs().find((s) => s.name === serverName);
|
|
250
|
+
if (!server || !server.isConnected) {
|
|
251
|
+
res.status(404).json({ error: `Server ${serverName} is not connected` });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
const mcpConfig = {
|
|
255
|
+
url: server.url,
|
|
256
|
+
transport: server.transport,
|
|
257
|
+
name: server.name,
|
|
258
|
+
};
|
|
259
|
+
if (server.headers) {
|
|
260
|
+
mcpConfig.headers = server.headers;
|
|
261
|
+
}
|
|
262
|
+
const startedAt = Date.now();
|
|
263
|
+
const result = await mcpClientService.callToolWithConfig(mcpConfig, toolName, parameters || {});
|
|
264
|
+
res.json({ success: true, result, durationMs: Date.now() - startedAt });
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
logger.error('MCP call-tool error:', error);
|
|
268
|
+
res.status(500).json({ success: false, error: error.message || 'Tool execution failed' });
|
|
269
|
+
}
|
|
270
|
+
});
|
|
241
271
|
// GET /api/mcp/used-headers
|
|
242
272
|
router.get('/api/mcp/used-headers', async (req, res) => {
|
|
243
273
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tester-router.js","sourceRoot":"","sources":["../../../src/core/agent-tester/agent-tester-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,MAAM,IAAI,GAAG,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,EA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,MAAM,CAAC;QACP,OAAO,UAAU,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -184,6 +184,20 @@
|
|
|
184
184
|
</div>
|
|
185
185
|
</header>
|
|
186
186
|
|
|
187
|
+
<!-- Tab Bar -->
|
|
188
|
+
<div class="tabs-bar" data-testid="at-tabs-bar">
|
|
189
|
+
<button type="button" class="tab-btn active" data-tab="chat" data-testid="at-tab-chat">
|
|
190
|
+
<span class="material-icons-round">chat</span>
|
|
191
|
+
Chat
|
|
192
|
+
</button>
|
|
193
|
+
<button type="button" class="tab-btn" data-tab="tool-tester" data-testid="at-tab-tool-tester">
|
|
194
|
+
<span class="material-icons-round">build</span>
|
|
195
|
+
Tool Tester
|
|
196
|
+
</button>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<!-- Tab: Chat -->
|
|
200
|
+
<div class="tab-pane active" id="tabPaneChat" data-testid="at-tab-pane-chat">
|
|
187
201
|
<!-- Chat Messages -->
|
|
188
202
|
<div class="chat-container">
|
|
189
203
|
<div id="chatMessages" class="chat-messages" data-testid="at-chat-messages">
|
|
@@ -229,6 +243,75 @@
|
|
|
229
243
|
</div>
|
|
230
244
|
</div>
|
|
231
245
|
</div>
|
|
246
|
+
</div><!-- /tabPaneChat -->
|
|
247
|
+
|
|
248
|
+
<!-- Tab: Tool Tester -->
|
|
249
|
+
<div class="tab-pane tool-tester-pane" id="tabPaneToolTester" style="display: none;" data-testid="at-tab-pane-tool-tester">
|
|
250
|
+
<div class="tt-layout" id="ttLayout" data-show-schema="false">
|
|
251
|
+
<!-- Schema Panel (hidden by default) -->
|
|
252
|
+
<section class="tt-panel tt-schema-panel" id="ttSchemaPanel" style="display: none;" data-testid="at-tt-schema-panel">
|
|
253
|
+
<header class="tt-panel-header">
|
|
254
|
+
<h3>Parameter Schema</h3>
|
|
255
|
+
<button type="button" class="btn-icon" id="ttSchemaClose" title="Hide schema" data-testid="at-tt-schema-close">
|
|
256
|
+
<span class="material-icons-round">close</span>
|
|
257
|
+
</button>
|
|
258
|
+
</header>
|
|
259
|
+
<pre class="tt-schema-content" id="ttSchemaContent" data-testid="at-tt-schema-content"></pre>
|
|
260
|
+
</section>
|
|
261
|
+
|
|
262
|
+
<!-- Request Panel -->
|
|
263
|
+
<section class="tt-panel tt-request-panel" data-testid="at-tt-request-panel">
|
|
264
|
+
<header class="tt-panel-header tt-request-header">
|
|
265
|
+
<div class="form-group tt-tool-group">
|
|
266
|
+
<label for="ttToolSelect">MCP Tool</label>
|
|
267
|
+
<select id="ttToolSelect" data-testid="at-tt-tool-select">
|
|
268
|
+
<option value="">— select a tool —</option>
|
|
269
|
+
</select>
|
|
270
|
+
</div>
|
|
271
|
+
<div class="tt-request-actions">
|
|
272
|
+
<button type="button" class="btn-icon" id="ttSchemaToggle" title="Show parameter schema" disabled data-testid="at-tt-schema-toggle">
|
|
273
|
+
<span class="material-icons-round">data_object</span>
|
|
274
|
+
</button>
|
|
275
|
+
<button type="button" class="btn btn-secondary" id="ttGenerateJson" title="Generate JSON skeleton from schema" disabled data-testid="at-tt-generate-json">
|
|
276
|
+
<span class="material-icons-round">auto_fix_high</span>
|
|
277
|
+
Generate JSON
|
|
278
|
+
</button>
|
|
279
|
+
<button type="button" class="btn btn-secondary" id="ttValidateJson" title="Validate request JSON against parameter schema" disabled data-testid="at-tt-validate-json">
|
|
280
|
+
<span class="material-icons-round">rule</span>
|
|
281
|
+
Validate
|
|
282
|
+
</button>
|
|
283
|
+
</div>
|
|
284
|
+
</header>
|
|
285
|
+
<div class="tt-tool-description" id="ttToolDescription" style="display: none;" data-testid="at-tt-tool-description"></div>
|
|
286
|
+
<div class="tt-panel-body">
|
|
287
|
+
<textarea id="ttRequestJson" class="tt-json-editor" placeholder='{ "param": "value" }' spellcheck="false" data-testid="at-tt-request-json">{}</textarea>
|
|
288
|
+
</div>
|
|
289
|
+
<footer class="tt-panel-footer">
|
|
290
|
+
<button type="button" class="btn btn-primary" id="ttSendBtn" disabled data-testid="at-tt-send-btn">
|
|
291
|
+
<span class="material-icons-round">send</span>
|
|
292
|
+
Send Request
|
|
293
|
+
</button>
|
|
294
|
+
<span id="ttRequestStatus" class="tt-status" data-testid="at-tt-request-status"></span>
|
|
295
|
+
</footer>
|
|
296
|
+
</section>
|
|
297
|
+
|
|
298
|
+
<!-- Response Panel -->
|
|
299
|
+
<section class="tt-panel tt-response-panel" data-testid="at-tt-response-panel">
|
|
300
|
+
<header class="tt-panel-header">
|
|
301
|
+
<h3>Response</h3>
|
|
302
|
+
<div class="tt-response-actions">
|
|
303
|
+
<button type="button" class="btn-icon" id="ttResponseTextView" title="Show first content[].text (parsed as JSON if possible)" data-testid="at-tt-response-text-view">
|
|
304
|
+
<span class="material-icons-round">subject</span>
|
|
305
|
+
</button>
|
|
306
|
+
<button type="button" class="btn-icon" id="ttResponseClear" title="Clear response" data-testid="at-tt-response-clear">
|
|
307
|
+
<span class="material-icons-round">delete_outline</span>
|
|
308
|
+
</button>
|
|
309
|
+
</div>
|
|
310
|
+
</header>
|
|
311
|
+
<pre class="tt-response-content" id="ttResponseContent" data-testid="at-tt-response-content"><span class="tt-placeholder">No response yet. Connect to a server, select a tool, and send a request.</span></pre>
|
|
312
|
+
</section>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
232
315
|
</main>
|
|
233
316
|
</div>
|
|
234
317
|
|
|
@@ -321,6 +404,7 @@
|
|
|
321
404
|
<!-- Toast Notifications -->
|
|
322
405
|
<div id="toastContainer" class="toast-container" data-testid="at-toast-container"></div>
|
|
323
406
|
|
|
407
|
+
<script src="/agent-tester/static/pretty-print-json.js"></script>
|
|
324
408
|
<script src="/agent-tester/static/script.js"></script>
|
|
325
409
|
</body>
|
|
326
410
|
</html>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Browser port of docs/pretty-print-json.ts (extended `prettyPrintJson` —
|
|
2
|
+
// deserializes escape sequences, wraps long strings in a scrollable container).
|
|
3
|
+
// noinspection UnnecessaryLocalVariableJS
|
|
4
|
+
|
|
5
|
+
(function (root) {
|
|
6
|
+
const prettyPrintJson = {
|
|
7
|
+
toHtml(thing, options) {
|
|
8
|
+
const settings = {
|
|
9
|
+
indent: 3,
|
|
10
|
+
lineNumbers: false,
|
|
11
|
+
linkUrls: true,
|
|
12
|
+
linksNewTab: true,
|
|
13
|
+
quoteKeys: false,
|
|
14
|
+
trailingComma: true,
|
|
15
|
+
maxTextLength: 100,
|
|
16
|
+
minTextContainerWidth: 300,
|
|
17
|
+
...options,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const htmlEntities = (text) => text.replace(/[<>&]/g, (c) => (c === '<' ? '<' : c === '>' ? '>' : '&'));
|
|
21
|
+
|
|
22
|
+
const deserializeString = (str) =>
|
|
23
|
+
str
|
|
24
|
+
.replace(/\\"/g, '"')
|
|
25
|
+
.replace(/\\n/g, '\n')
|
|
26
|
+
.replace(/\\r/g, '\r')
|
|
27
|
+
.replace(/\\t/g, '\t')
|
|
28
|
+
.replace(/\\b/g, '\b')
|
|
29
|
+
.replace(/\\f/g, '\f')
|
|
30
|
+
.replace(/\\v/g, '\v')
|
|
31
|
+
.replace(/\\0/g, '\0')
|
|
32
|
+
.replace(/\\'/g, "'")
|
|
33
|
+
.replace(/\\\\/g, '\\');
|
|
34
|
+
|
|
35
|
+
const spanTag = (type, display) => (display ? `<span class="json-${type}">${display}</span>` : '');
|
|
36
|
+
|
|
37
|
+
const buildValueHtml = (value) => {
|
|
38
|
+
const strType = value.startsWith('"') && 'string';
|
|
39
|
+
const boolType = ['true', 'false'].includes(value) && 'boolean';
|
|
40
|
+
const nullType = value === 'null' && 'null';
|
|
41
|
+
const type = boolType || nullType || strType || 'number';
|
|
42
|
+
|
|
43
|
+
if (strType) {
|
|
44
|
+
const stringContent = value.slice(1, -1);
|
|
45
|
+
if (stringContent.length > settings.maxTextLength) {
|
|
46
|
+
const deserialized = deserializeString(stringContent);
|
|
47
|
+
return `<span class="json-${type}"><span class="json-long-text-inline" style="--min-text-width: ${settings.minTextContainerWidth}px;"><div class="json-long-text-content">${htmlEntities(deserialized)}</div></span></span>`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const urlPattern = /https?:\/\/[^\s"]+?(?="|$)/g;
|
|
52
|
+
const target = settings.linksNewTab ? ' target="_blank"' : '';
|
|
53
|
+
const makeLink = (link) => `<a class="json-link" href="${link}"${target}>${link}</a>`;
|
|
54
|
+
const display = strType && settings.linkUrls ? value.replace(urlPattern, makeLink) : value;
|
|
55
|
+
return spanTag(type, display);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const replacer = (match, p1, p2, p3, p4) => {
|
|
59
|
+
const part = { indent: p1, key: p2, value: p3, end: p4 };
|
|
60
|
+
const findName = settings.quoteKeys ? /(.*)(): / : /"([\w$]+)": |(.*): /;
|
|
61
|
+
const indentHtml = part.indent || '';
|
|
62
|
+
const keyName = part.key && part.key.replace(findName, '$1$2');
|
|
63
|
+
const keyHtml = part.key ? spanTag('key', keyName) + spanTag('mark', ': ') : '';
|
|
64
|
+
const valueHtml = part.value ? buildValueHtml(part.value) : '';
|
|
65
|
+
const lastChar = (match && match[match.length - 1]) || '';
|
|
66
|
+
const noComma = !part.end || [']', '}'].includes(lastChar);
|
|
67
|
+
const addComma = settings.trailingComma && match[0] === ' ' && noComma;
|
|
68
|
+
const endHtml = spanTag('mark', addComma ? `${part.end || ''},` : part.end);
|
|
69
|
+
|
|
70
|
+
const hasLongText = valueHtml.includes('json-long-text-inline');
|
|
71
|
+
if (hasLongText && part.key) {
|
|
72
|
+
return `${indentHtml}<span class="json-key-container">${keyHtml}</span>${valueHtml}${endHtml}`;
|
|
73
|
+
}
|
|
74
|
+
return indentHtml + keyHtml + valueHtml + endHtml;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const jsonLine = /^( *)("[^"]+": )?((?:"(?:[^"\\]|\\.)*")|[\w.+-]*)?([{}[\],]*)?$/gm;
|
|
78
|
+
const json = JSON.stringify(thing, null, settings.indent) || 'undefined';
|
|
79
|
+
const html = htmlEntities(json).replace(jsonLine, replacer);
|
|
80
|
+
|
|
81
|
+
if (!settings.lineNumbers) {
|
|
82
|
+
return html;
|
|
83
|
+
}
|
|
84
|
+
const makeLine = (line) => {
|
|
85
|
+
const hasLongText = line.includes('json-long-text-inline');
|
|
86
|
+
const cls = hasLongText ? ' class="json-line-with-long-text"' : '';
|
|
87
|
+
return ` <li${cls}>${line}</li>`;
|
|
88
|
+
};
|
|
89
|
+
return ['<ol class="json-lines">', ...html.split('\n').map(makeLine), '</ol>'].join('\n');
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
root.prettyPrintJson = prettyPrintJson;
|
|
93
|
+
})(window);
|
|
@@ -453,6 +453,29 @@ class McpAgentTester {
|
|
|
453
453
|
|
|
454
454
|
this.themeToggle = document.getElementById('themeToggle');
|
|
455
455
|
this.defaultFormatSelect = document.getElementById('defaultDisplayFormat');
|
|
456
|
+
|
|
457
|
+
// Tool Tester tab elements
|
|
458
|
+
this.tabsBar = document.querySelector('.tabs-bar');
|
|
459
|
+
this.tabPaneChat = document.getElementById('tabPaneChat');
|
|
460
|
+
this.tabPaneToolTester = document.getElementById('tabPaneToolTester');
|
|
461
|
+
this.ttLayout = document.getElementById('ttLayout');
|
|
462
|
+
this.ttToolSelect = document.getElementById('ttToolSelect');
|
|
463
|
+
this.ttToolDescription = document.getElementById('ttToolDescription');
|
|
464
|
+
this.ttSchemaToggle = document.getElementById('ttSchemaToggle');
|
|
465
|
+
this.ttSchemaPanel = document.getElementById('ttSchemaPanel');
|
|
466
|
+
this.ttSchemaContent = document.getElementById('ttSchemaContent');
|
|
467
|
+
this.ttSchemaClose = document.getElementById('ttSchemaClose');
|
|
468
|
+
this.ttGenerateJson = document.getElementById('ttGenerateJson');
|
|
469
|
+
this.ttValidateJson = document.getElementById('ttValidateJson');
|
|
470
|
+
this.ttRequestJson = document.getElementById('ttRequestJson');
|
|
471
|
+
this.ttSendBtn = document.getElementById('ttSendBtn');
|
|
472
|
+
this.ttRequestStatus = document.getElementById('ttRequestStatus');
|
|
473
|
+
this.ttResponseContent = document.getElementById('ttResponseContent');
|
|
474
|
+
this.ttResponseClear = document.getElementById('ttResponseClear');
|
|
475
|
+
this.ttResponseTextView = document.getElementById('ttResponseTextView');
|
|
476
|
+
this.ttLastResult = null;
|
|
477
|
+
this.ttResponseTextMode = false;
|
|
478
|
+
this.activeTab = 'chat';
|
|
456
479
|
}
|
|
457
480
|
|
|
458
481
|
bindEvents() {
|
|
@@ -544,6 +567,40 @@ class McpAgentTester {
|
|
|
544
567
|
this.sidebar.classList.remove('open');
|
|
545
568
|
}
|
|
546
569
|
});
|
|
570
|
+
|
|
571
|
+
// --- Tool Tester tab events ---
|
|
572
|
+
if (this.tabsBar) {
|
|
573
|
+
this.tabsBar.querySelectorAll('.tab-btn').forEach((btn) => {
|
|
574
|
+
btn.addEventListener('click', () => this.switchTab(btn.dataset.tab));
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
if (this.ttToolSelect) {
|
|
578
|
+
this.ttToolSelect.addEventListener('change', () => this.handleToolSelectionChange());
|
|
579
|
+
}
|
|
580
|
+
if (this.ttSchemaToggle) {
|
|
581
|
+
this.ttSchemaToggle.addEventListener('click', () => this.toggleSchemaPanel());
|
|
582
|
+
}
|
|
583
|
+
if (this.ttSchemaClose) {
|
|
584
|
+
this.ttSchemaClose.addEventListener('click', () => this.toggleSchemaPanel(false));
|
|
585
|
+
}
|
|
586
|
+
if (this.ttGenerateJson) {
|
|
587
|
+
this.ttGenerateJson.addEventListener('click', () => this.generateJsonSkeleton());
|
|
588
|
+
}
|
|
589
|
+
if (this.ttValidateJson) {
|
|
590
|
+
this.ttValidateJson.addEventListener('click', () => this.validateRequestJson());
|
|
591
|
+
}
|
|
592
|
+
if (this.ttRequestJson) {
|
|
593
|
+
this.ttRequestJson.addEventListener('input', () => this.handleRequestJsonInput());
|
|
594
|
+
}
|
|
595
|
+
if (this.ttSendBtn) {
|
|
596
|
+
this.ttSendBtn.addEventListener('click', () => this.sendToolRequest());
|
|
597
|
+
}
|
|
598
|
+
if (this.ttResponseClear) {
|
|
599
|
+
this.ttResponseClear.addEventListener('click', () => this.clearToolResponse());
|
|
600
|
+
}
|
|
601
|
+
if (this.ttResponseTextView) {
|
|
602
|
+
this.ttResponseTextView.addEventListener('click', () => this.toggleResponseTextMode());
|
|
603
|
+
}
|
|
547
604
|
}
|
|
548
605
|
|
|
549
606
|
initTheme() {
|
|
@@ -1290,6 +1347,7 @@ class McpAgentTester {
|
|
|
1290
1347
|
}
|
|
1291
1348
|
|
|
1292
1349
|
renderServerInfo() {
|
|
1350
|
+
this.refreshToolList();
|
|
1293
1351
|
if (!this.currentServer) {
|
|
1294
1352
|
this.connectedServersContainer.innerHTML = '';
|
|
1295
1353
|
return;
|
|
@@ -2155,6 +2213,522 @@ class McpAgentTester {
|
|
|
2155
2213
|
this.closeUrlDropdown();
|
|
2156
2214
|
}
|
|
2157
2215
|
}
|
|
2216
|
+
|
|
2217
|
+
// ===== Tool Tester Tab =====
|
|
2218
|
+
|
|
2219
|
+
switchTab(tabName) {
|
|
2220
|
+
if (!tabName || tabName === this.activeTab) {
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
this.activeTab = tabName;
|
|
2224
|
+
|
|
2225
|
+
this.tabsBar.querySelectorAll('.tab-btn').forEach((btn) => {
|
|
2226
|
+
btn.classList.toggle('active', btn.dataset.tab === tabName);
|
|
2227
|
+
});
|
|
2228
|
+
|
|
2229
|
+
if (tabName === 'chat') {
|
|
2230
|
+
this.tabPaneChat.style.display = '';
|
|
2231
|
+
this.tabPaneChat.classList.add('active');
|
|
2232
|
+
this.tabPaneToolTester.style.display = 'none';
|
|
2233
|
+
this.tabPaneToolTester.classList.remove('active');
|
|
2234
|
+
} else if (tabName === 'tool-tester') {
|
|
2235
|
+
this.tabPaneChat.style.display = 'none';
|
|
2236
|
+
this.tabPaneChat.classList.remove('active');
|
|
2237
|
+
this.tabPaneToolTester.style.display = '';
|
|
2238
|
+
this.tabPaneToolTester.classList.add('active');
|
|
2239
|
+
this.refreshToolList();
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
refreshToolList() {
|
|
2244
|
+
if (!this.ttToolSelect) {
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
const tools =
|
|
2248
|
+
this.currentServer && this.currentServer.isConnected && Array.isArray(this.currentServer.tools)
|
|
2249
|
+
? this.currentServer.tools
|
|
2250
|
+
: [];
|
|
2251
|
+
this.ttTools = tools;
|
|
2252
|
+
|
|
2253
|
+
const previousValue = this.ttToolSelect.value;
|
|
2254
|
+
this.ttToolSelect.innerHTML = '<option value="">— select a tool —</option>';
|
|
2255
|
+
tools.forEach((tool) => {
|
|
2256
|
+
const opt = document.createElement('option');
|
|
2257
|
+
opt.value = tool.name;
|
|
2258
|
+
opt.textContent = tool.name;
|
|
2259
|
+
this.ttToolSelect.appendChild(opt);
|
|
2260
|
+
});
|
|
2261
|
+
|
|
2262
|
+
const stillExists = tools.some((t) => t.name === previousValue);
|
|
2263
|
+
this.ttToolSelect.value = stillExists ? previousValue : '';
|
|
2264
|
+
this.handleToolSelectionChange();
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
getSelectedTool() {
|
|
2268
|
+
const name = this.ttToolSelect?.value;
|
|
2269
|
+
if (!name || !Array.isArray(this.ttTools)) {
|
|
2270
|
+
return null;
|
|
2271
|
+
}
|
|
2272
|
+
return this.ttTools.find((t) => t.name === name) || null;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
handleToolSelectionChange() {
|
|
2276
|
+
const tool = this.getSelectedTool();
|
|
2277
|
+
const hasTool = !!tool;
|
|
2278
|
+
const connected = !!(this.currentServer && this.currentServer.isConnected);
|
|
2279
|
+
|
|
2280
|
+
this.ttSchemaToggle.disabled = !hasTool;
|
|
2281
|
+
this.ttGenerateJson.disabled = !hasTool;
|
|
2282
|
+
this.ttValidateJson.disabled = !hasTool;
|
|
2283
|
+
this.ttSendBtn.disabled = !hasTool || !connected;
|
|
2284
|
+
|
|
2285
|
+
if (tool && tool.description) {
|
|
2286
|
+
this.ttToolDescription.textContent = tool.description;
|
|
2287
|
+
this.ttToolDescription.style.display = '';
|
|
2288
|
+
} else {
|
|
2289
|
+
this.ttToolDescription.textContent = '';
|
|
2290
|
+
this.ttToolDescription.style.display = 'none';
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
if (this.ttSchemaPanel.style.display !== 'none') {
|
|
2294
|
+
this.renderSchema(tool);
|
|
2295
|
+
}
|
|
2296
|
+
this.loadRequestJsonForTool(tool);
|
|
2297
|
+
this.ttRequestStatus.textContent = '';
|
|
2298
|
+
this.ttRequestStatus.className = 'tt-status';
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
getToolJsonStorageKey(toolName) {
|
|
2302
|
+
return `mcpAgentTesterToolJson_${toolName}`;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
loadRequestJsonForTool(tool) {
|
|
2306
|
+
if (!tool) {
|
|
2307
|
+
return;
|
|
2308
|
+
}
|
|
2309
|
+
try {
|
|
2310
|
+
const saved = localStorage.getItem(this.getToolJsonStorageKey(tool.name));
|
|
2311
|
+
if (saved !== null) {
|
|
2312
|
+
this.ttRequestJson.value = saved;
|
|
2313
|
+
return;
|
|
2314
|
+
}
|
|
2315
|
+
} catch {
|
|
2316
|
+
/* ignore */
|
|
2317
|
+
}
|
|
2318
|
+
this.ttRequestJson.value = '{}';
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
saveRequestJsonForTool() {
|
|
2322
|
+
const tool = this.getSelectedTool();
|
|
2323
|
+
if (!tool) {
|
|
2324
|
+
return;
|
|
2325
|
+
}
|
|
2326
|
+
try {
|
|
2327
|
+
localStorage.setItem(this.getToolJsonStorageKey(tool.name), this.ttRequestJson.value);
|
|
2328
|
+
} catch {
|
|
2329
|
+
/* ignore */
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
handleRequestJsonInput() {
|
|
2334
|
+
if (this._ttJsonSaveTimer) {
|
|
2335
|
+
clearTimeout(this._ttJsonSaveTimer);
|
|
2336
|
+
}
|
|
2337
|
+
this._ttJsonSaveTimer = setTimeout(() => this.saveRequestJsonForTool(), 600);
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
toggleSchemaPanel(forceState) {
|
|
2341
|
+
const isOpen = this.ttSchemaPanel.style.display !== 'none';
|
|
2342
|
+
const next = typeof forceState === 'boolean' ? forceState : !isOpen;
|
|
2343
|
+
|
|
2344
|
+
this.ttSchemaPanel.style.display = next ? '' : 'none';
|
|
2345
|
+
this.ttLayout.dataset.showSchema = next ? 'true' : 'false';
|
|
2346
|
+
|
|
2347
|
+
if (next) {
|
|
2348
|
+
this.renderSchema(this.getSelectedTool());
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
renderSchema(tool) {
|
|
2353
|
+
if (!tool) {
|
|
2354
|
+
this.ttSchemaContent.innerHTML = '';
|
|
2355
|
+
return;
|
|
2356
|
+
}
|
|
2357
|
+
const schema = tool.inputSchema || {};
|
|
2358
|
+
if (window.prettyPrintJson && typeof window.prettyPrintJson.toHtml === 'function') {
|
|
2359
|
+
try {
|
|
2360
|
+
this.ttSchemaContent.innerHTML = window.prettyPrintJson.toHtml(schema, { indent: 2 });
|
|
2361
|
+
return;
|
|
2362
|
+
} catch {
|
|
2363
|
+
/* fall back to plain text */
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
try {
|
|
2367
|
+
this.ttSchemaContent.textContent = JSON.stringify(schema, null, 2);
|
|
2368
|
+
} catch {
|
|
2369
|
+
this.ttSchemaContent.textContent = String(schema);
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
generateJsonSkeleton() {
|
|
2374
|
+
const tool = this.getSelectedTool();
|
|
2375
|
+
if (!tool) {
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
const skeleton = this.buildSkeletonFromSchema(tool.inputSchema);
|
|
2379
|
+
try {
|
|
2380
|
+
this.ttRequestJson.value = JSON.stringify(skeleton, null, 2);
|
|
2381
|
+
} catch {
|
|
2382
|
+
this.ttRequestJson.value = '{}';
|
|
2383
|
+
}
|
|
2384
|
+
this.saveRequestJsonForTool();
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
validateRequestJson() {
|
|
2388
|
+
const tool = this.getSelectedTool();
|
|
2389
|
+
if (!tool) {
|
|
2390
|
+
return;
|
|
2391
|
+
}
|
|
2392
|
+
const raw = this.ttRequestJson.value.trim();
|
|
2393
|
+
let parsed;
|
|
2394
|
+
try {
|
|
2395
|
+
parsed = raw ? JSON.parse(raw) : {};
|
|
2396
|
+
} catch (e) {
|
|
2397
|
+
this.ttRequestStatus.textContent = 'Invalid JSON: ' + e.message;
|
|
2398
|
+
this.ttRequestStatus.className = 'tt-status tt-status-error';
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2401
|
+
const errors = this.validateAgainstSchema(parsed, tool.inputSchema || {}, '$');
|
|
2402
|
+
if (errors.length === 0) {
|
|
2403
|
+
this.ttRequestStatus.textContent = '✓ JSON matches schema';
|
|
2404
|
+
this.ttRequestStatus.className = 'tt-status tt-status-success';
|
|
2405
|
+
} else {
|
|
2406
|
+
const preview = errors.slice(0, 5).join('; ');
|
|
2407
|
+
const more = errors.length > 5 ? ` (+${errors.length - 5} more)` : '';
|
|
2408
|
+
this.ttRequestStatus.textContent = `${errors.length} validation error${errors.length === 1 ? '' : 's'}: ${preview}${more}`;
|
|
2409
|
+
this.ttRequestStatus.className = 'tt-status tt-status-error';
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
validateAgainstSchema(value, schema, path) {
|
|
2414
|
+
const errors = [];
|
|
2415
|
+
if (!schema || typeof schema !== 'object') {
|
|
2416
|
+
return errors;
|
|
2417
|
+
}
|
|
2418
|
+
if (schema.type) {
|
|
2419
|
+
const types = Array.isArray(schema.type) ? schema.type : [schema.type];
|
|
2420
|
+
const actual = this.jsonTypeOf(value);
|
|
2421
|
+
const numericMatch = actual === 'integer' && types.includes('number');
|
|
2422
|
+
if (!types.includes(actual) && !numericMatch) {
|
|
2423
|
+
errors.push(`${path}: expected ${types.join('|')} but got ${actual}`);
|
|
2424
|
+
return errors;
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
if (Array.isArray(schema.enum)) {
|
|
2428
|
+
const ok = schema.enum.some((e) => JSON.stringify(e) === JSON.stringify(value));
|
|
2429
|
+
if (!ok) {
|
|
2430
|
+
errors.push(`${path}: must be one of ${JSON.stringify(schema.enum)}`);
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
if (typeof value === 'number') {
|
|
2434
|
+
if (schema.minimum !== undefined && value < schema.minimum) {
|
|
2435
|
+
errors.push(`${path}: must be >= ${schema.minimum}`);
|
|
2436
|
+
}
|
|
2437
|
+
if (schema.maximum !== undefined && value > schema.maximum) {
|
|
2438
|
+
errors.push(`${path}: must be <= ${schema.maximum}`);
|
|
2439
|
+
}
|
|
2440
|
+
if (schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum) {
|
|
2441
|
+
errors.push(`${path}: must be > ${schema.exclusiveMinimum}`);
|
|
2442
|
+
}
|
|
2443
|
+
if (schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum) {
|
|
2444
|
+
errors.push(`${path}: must be < ${schema.exclusiveMaximum}`);
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
if (typeof value === 'string') {
|
|
2448
|
+
if (schema.minLength !== undefined && value.length < schema.minLength) {
|
|
2449
|
+
errors.push(`${path}: minLength ${schema.minLength}`);
|
|
2450
|
+
}
|
|
2451
|
+
if (schema.maxLength !== undefined && value.length > schema.maxLength) {
|
|
2452
|
+
errors.push(`${path}: maxLength ${schema.maxLength}`);
|
|
2453
|
+
}
|
|
2454
|
+
if (schema.pattern) {
|
|
2455
|
+
try {
|
|
2456
|
+
if (!new RegExp(schema.pattern).test(value)) {
|
|
2457
|
+
errors.push(`${path}: pattern mismatch`);
|
|
2458
|
+
}
|
|
2459
|
+
} catch {
|
|
2460
|
+
/* ignore invalid pattern */
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
2465
|
+
if (Array.isArray(schema.required)) {
|
|
2466
|
+
for (const req of schema.required) {
|
|
2467
|
+
if (!Object.prototype.hasOwnProperty.call(value, req)) {
|
|
2468
|
+
errors.push(`${path}.${req}: required`);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
const props = schema.properties || {};
|
|
2473
|
+
for (const [k, v] of Object.entries(value)) {
|
|
2474
|
+
if (props[k]) {
|
|
2475
|
+
errors.push(...this.validateAgainstSchema(v, props[k], `${path}.${k}`));
|
|
2476
|
+
} else if (schema.additionalProperties === false) {
|
|
2477
|
+
errors.push(`${path}.${k}: additional property not allowed`);
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
if (Array.isArray(value)) {
|
|
2482
|
+
if (schema.minItems !== undefined && value.length < schema.minItems) {
|
|
2483
|
+
errors.push(`${path}: minItems ${schema.minItems}`);
|
|
2484
|
+
}
|
|
2485
|
+
if (schema.maxItems !== undefined && value.length > schema.maxItems) {
|
|
2486
|
+
errors.push(`${path}: maxItems ${schema.maxItems}`);
|
|
2487
|
+
}
|
|
2488
|
+
if (schema.items) {
|
|
2489
|
+
value.forEach((item, i) => {
|
|
2490
|
+
errors.push(...this.validateAgainstSchema(item, schema.items, `${path}[${i}]`));
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
return errors;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
jsonTypeOf(v) {
|
|
2498
|
+
if (v === null) {
|
|
2499
|
+
return 'null';
|
|
2500
|
+
}
|
|
2501
|
+
if (Array.isArray(v)) {
|
|
2502
|
+
return 'array';
|
|
2503
|
+
}
|
|
2504
|
+
if (typeof v === 'number') {
|
|
2505
|
+
return Number.isInteger(v) ? 'integer' : 'number';
|
|
2506
|
+
}
|
|
2507
|
+
return typeof v;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
buildSkeletonFromSchema(schema) {
|
|
2511
|
+
if (!schema || typeof schema !== 'object') {
|
|
2512
|
+
return {};
|
|
2513
|
+
}
|
|
2514
|
+
const { type } = schema;
|
|
2515
|
+
|
|
2516
|
+
if (type === 'object' || schema.properties) {
|
|
2517
|
+
const props = schema.properties || {};
|
|
2518
|
+
const required = new Set(Array.isArray(schema.required) ? schema.required : Object.keys(props));
|
|
2519
|
+
const out = {};
|
|
2520
|
+
for (const [key, propSchema] of Object.entries(props)) {
|
|
2521
|
+
if (required.has(key) || !schema.required) {
|
|
2522
|
+
out[key] = this.skeletonValue(propSchema);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
return out;
|
|
2526
|
+
}
|
|
2527
|
+
return this.skeletonValue(schema);
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
skeletonValue(schema) {
|
|
2531
|
+
if (!schema || typeof schema !== 'object') {
|
|
2532
|
+
return null;
|
|
2533
|
+
}
|
|
2534
|
+
if (schema.default !== undefined) {
|
|
2535
|
+
return schema.default;
|
|
2536
|
+
}
|
|
2537
|
+
if (Array.isArray(schema.examples) && schema.examples.length) {
|
|
2538
|
+
return schema.examples[0];
|
|
2539
|
+
}
|
|
2540
|
+
if (schema.example !== undefined) {
|
|
2541
|
+
return schema.example;
|
|
2542
|
+
}
|
|
2543
|
+
if (Array.isArray(schema.enum) && schema.enum.length) {
|
|
2544
|
+
return schema.enum[0];
|
|
2545
|
+
}
|
|
2546
|
+
const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
|
|
2547
|
+
switch (type) {
|
|
2548
|
+
case 'string':
|
|
2549
|
+
return '';
|
|
2550
|
+
case 'number':
|
|
2551
|
+
case 'integer':
|
|
2552
|
+
return 0;
|
|
2553
|
+
case 'boolean':
|
|
2554
|
+
return false;
|
|
2555
|
+
case 'array': {
|
|
2556
|
+
const itemSkeleton = schema.items ? this.skeletonValue(schema.items) : null;
|
|
2557
|
+
return itemSkeleton === null || itemSkeleton === undefined ? [] : [itemSkeleton];
|
|
2558
|
+
}
|
|
2559
|
+
case 'object':
|
|
2560
|
+
return this.buildSkeletonFromSchema(schema);
|
|
2561
|
+
case 'null':
|
|
2562
|
+
return null;
|
|
2563
|
+
default:
|
|
2564
|
+
if (schema.properties) {
|
|
2565
|
+
return this.buildSkeletonFromSchema(schema);
|
|
2566
|
+
}
|
|
2567
|
+
return null;
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
async sendToolRequest() {
|
|
2572
|
+
const tool = this.getSelectedTool();
|
|
2573
|
+
if (!tool) {
|
|
2574
|
+
return;
|
|
2575
|
+
}
|
|
2576
|
+
if (!this.currentServer || !this.currentServer.isConnected) {
|
|
2577
|
+
this.showToast('Not connected to an MCP server', 'error');
|
|
2578
|
+
return;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
let parameters;
|
|
2582
|
+
const raw = this.ttRequestJson.value.trim();
|
|
2583
|
+
if (!raw) {
|
|
2584
|
+
parameters = {};
|
|
2585
|
+
} else {
|
|
2586
|
+
try {
|
|
2587
|
+
parameters = JSON.parse(raw);
|
|
2588
|
+
} catch (e) {
|
|
2589
|
+
this.ttRequestStatus.textContent = 'Invalid JSON: ' + e.message;
|
|
2590
|
+
this.ttRequestStatus.className = 'tt-status tt-status-error';
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
this.ttSendBtn.disabled = true;
|
|
2596
|
+
this.ttRequestStatus.textContent = 'Sending request…';
|
|
2597
|
+
this.ttRequestStatus.className = 'tt-status tt-status-progress';
|
|
2598
|
+
this.ttResponseContent.innerHTML = '';
|
|
2599
|
+
this.ttResponseContent.textContent = '⏳ Waiting for response…';
|
|
2600
|
+
|
|
2601
|
+
const startedAt = performance.now();
|
|
2602
|
+
try {
|
|
2603
|
+
const response = await apiFetch(`${API_BASE}/api/mcp/call-tool`, {
|
|
2604
|
+
method: 'POST',
|
|
2605
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2606
|
+
body: JSON.stringify({
|
|
2607
|
+
serverName: this.currentServer.name,
|
|
2608
|
+
toolName: tool.name,
|
|
2609
|
+
parameters,
|
|
2610
|
+
}),
|
|
2611
|
+
});
|
|
2612
|
+
const data = await response.json();
|
|
2613
|
+
const elapsedMs = Math.round(performance.now() - startedAt);
|
|
2614
|
+
|
|
2615
|
+
if (!response.ok || !data.success) {
|
|
2616
|
+
const errMsg = data.error || `HTTP ${response.status}`;
|
|
2617
|
+
this.ttRequestStatus.textContent = `Error in ${elapsedMs} ms`;
|
|
2618
|
+
this.ttRequestStatus.className = 'tt-status tt-status-error';
|
|
2619
|
+
this.renderToolResponse({ error: errMsg }, true);
|
|
2620
|
+
return;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
this.ttRequestStatus.textContent = `Success in ${data.durationMs ?? elapsedMs} ms`;
|
|
2624
|
+
this.ttRequestStatus.className = 'tt-status tt-status-success';
|
|
2625
|
+
this.renderToolResponse(data.result, false);
|
|
2626
|
+
} catch (error) {
|
|
2627
|
+
const elapsedMs = Math.round(performance.now() - startedAt);
|
|
2628
|
+
this.ttRequestStatus.textContent = `Error in ${elapsedMs} ms`;
|
|
2629
|
+
this.ttRequestStatus.className = 'tt-status tt-status-error';
|
|
2630
|
+
this.renderToolResponse({ error: error.message || String(error) }, true);
|
|
2631
|
+
} finally {
|
|
2632
|
+
this.ttSendBtn.disabled = false;
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
renderToolResponse(result, isError) {
|
|
2637
|
+
this.ttLastResult = result;
|
|
2638
|
+
this.ttResponseContent.classList.toggle('tt-response-error', !!isError);
|
|
2639
|
+
if (isError) {
|
|
2640
|
+
this.ttResponseTextMode = false;
|
|
2641
|
+
}
|
|
2642
|
+
this.renderToolResponseBody();
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
renderToolResponseBody() {
|
|
2646
|
+
const result = this.ttLastResult;
|
|
2647
|
+
this.ttResponseContent.classList.toggle('tt-response-text-mode', this.ttResponseTextMode);
|
|
2648
|
+
if (this.ttResponseTextView) {
|
|
2649
|
+
this.ttResponseTextView.classList.toggle('active', this.ttResponseTextMode);
|
|
2650
|
+
}
|
|
2651
|
+
if (result === null || result === undefined) {
|
|
2652
|
+
this.ttResponseContent.textContent = '';
|
|
2653
|
+
return;
|
|
2654
|
+
}
|
|
2655
|
+
if (this.ttResponseTextMode) {
|
|
2656
|
+
const firstText = this.extractFirstText(result);
|
|
2657
|
+
if (firstText === null) {
|
|
2658
|
+
this.ttResponseContent.textContent = '(no text field found in content[])';
|
|
2659
|
+
return;
|
|
2660
|
+
}
|
|
2661
|
+
const parsed = this.tryParseJson(firstText);
|
|
2662
|
+
if (parsed.ok) {
|
|
2663
|
+
this.renderPrettyJson(parsed.value);
|
|
2664
|
+
} else {
|
|
2665
|
+
this.ttResponseContent.textContent = firstText;
|
|
2666
|
+
}
|
|
2667
|
+
return;
|
|
2668
|
+
}
|
|
2669
|
+
this.renderPrettyJson(result);
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
renderPrettyJson(value) {
|
|
2673
|
+
if (window.prettyPrintJson && typeof window.prettyPrintJson.toHtml === 'function') {
|
|
2674
|
+
try {
|
|
2675
|
+
this.ttResponseContent.innerHTML = window.prettyPrintJson.toHtml(value, { indent: 2 });
|
|
2676
|
+
return;
|
|
2677
|
+
} catch {
|
|
2678
|
+
/* fall back to plain text */
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
try {
|
|
2682
|
+
this.ttResponseContent.textContent = JSON.stringify(value, null, 2);
|
|
2683
|
+
} catch {
|
|
2684
|
+
this.ttResponseContent.textContent = String(value);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
extractFirstText(result) {
|
|
2689
|
+
if (!result || typeof result !== 'object') {
|
|
2690
|
+
return null;
|
|
2691
|
+
}
|
|
2692
|
+
const content = Array.isArray(result.content) ? result.content : null;
|
|
2693
|
+
if (!content) {
|
|
2694
|
+
return null;
|
|
2695
|
+
}
|
|
2696
|
+
const first = content.find((c) => c && typeof c.text === 'string');
|
|
2697
|
+
return first ? first.text : null;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
tryParseJson(text) {
|
|
2701
|
+
const trimmed = text.trim();
|
|
2702
|
+
if ((trimmed.startsWith('{') && trimmed.endsWith('}')) || (trimmed.startsWith('[') && trimmed.endsWith(']'))) {
|
|
2703
|
+
try {
|
|
2704
|
+
return { ok: true, value: JSON.parse(trimmed) };
|
|
2705
|
+
} catch {
|
|
2706
|
+
/* fall through */
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
return { ok: false };
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
toggleResponseTextMode() {
|
|
2713
|
+
if (this.ttLastResult === null || this.ttLastResult === undefined) {
|
|
2714
|
+
return;
|
|
2715
|
+
}
|
|
2716
|
+
this.ttResponseTextMode = !this.ttResponseTextMode;
|
|
2717
|
+
this.renderToolResponseBody();
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
clearToolResponse() {
|
|
2721
|
+
this.ttLastResult = null;
|
|
2722
|
+
this.ttResponseTextMode = false;
|
|
2723
|
+
this.ttResponseContent.classList.remove('tt-response-error', 'tt-response-text-mode');
|
|
2724
|
+
if (this.ttResponseTextView) {
|
|
2725
|
+
this.ttResponseTextView.classList.remove('active');
|
|
2726
|
+
}
|
|
2727
|
+
this.ttResponseContent.innerHTML =
|
|
2728
|
+
'<span class="tt-placeholder">No response yet. Connect to a server, select a tool, and send a request.</span>';
|
|
2729
|
+
this.ttRequestStatus.textContent = '';
|
|
2730
|
+
this.ttRequestStatus.className = 'tt-status';
|
|
2731
|
+
}
|
|
2158
2732
|
}
|
|
2159
2733
|
|
|
2160
2734
|
// Initialize the app when DOM is loaded
|
|
@@ -1861,3 +1861,338 @@ textarea.prompt-modified {
|
|
|
1861
1861
|
font-size: 0.8rem;
|
|
1862
1862
|
text-align: center;
|
|
1863
1863
|
}
|
|
1864
|
+
|
|
1865
|
+
/* ============================================
|
|
1866
|
+
Tabs Bar + Tab Panes
|
|
1867
|
+
============================================ */
|
|
1868
|
+
.tabs-bar {
|
|
1869
|
+
display: flex;
|
|
1870
|
+
gap: 4px;
|
|
1871
|
+
padding: 0 16px;
|
|
1872
|
+
border-bottom: 1px solid var(--border);
|
|
1873
|
+
background: var(--bg-header);
|
|
1874
|
+
flex-shrink: 0;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
.tab-btn {
|
|
1878
|
+
display: inline-flex;
|
|
1879
|
+
align-items: center;
|
|
1880
|
+
gap: 6px;
|
|
1881
|
+
padding: 10px 16px;
|
|
1882
|
+
background: transparent;
|
|
1883
|
+
border: none;
|
|
1884
|
+
border-bottom: 2px solid transparent;
|
|
1885
|
+
color: var(--text-secondary);
|
|
1886
|
+
cursor: pointer;
|
|
1887
|
+
font-size: 0.85rem;
|
|
1888
|
+
font-weight: 500;
|
|
1889
|
+
font-family: inherit;
|
|
1890
|
+
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
.tab-btn:hover {
|
|
1894
|
+
color: var(--text);
|
|
1895
|
+
background: var(--bg-input);
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
.tab-btn.active {
|
|
1899
|
+
color: var(--primary);
|
|
1900
|
+
border-bottom-color: var(--primary);
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
.tab-btn .material-icons-round {
|
|
1904
|
+
font-size: 18px;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
.tab-pane {
|
|
1908
|
+
flex: 1;
|
|
1909
|
+
display: flex;
|
|
1910
|
+
flex-direction: column;
|
|
1911
|
+
min-height: 0;
|
|
1912
|
+
overflow: hidden;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
/* ============================================
|
|
1916
|
+
Tool Tester
|
|
1917
|
+
============================================ */
|
|
1918
|
+
.tool-tester-pane {
|
|
1919
|
+
padding: 16px;
|
|
1920
|
+
background: var(--bg-chat);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
.tt-layout {
|
|
1924
|
+
flex: 1;
|
|
1925
|
+
display: grid;
|
|
1926
|
+
grid-template-columns: 1fr 1fr;
|
|
1927
|
+
gap: 16px;
|
|
1928
|
+
min-height: 0;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
.tt-layout[data-show-schema="true"] {
|
|
1932
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
.tt-panel {
|
|
1936
|
+
display: flex;
|
|
1937
|
+
flex-direction: column;
|
|
1938
|
+
background: var(--bg-surface);
|
|
1939
|
+
border: 1px solid var(--border);
|
|
1940
|
+
border-radius: var(--radius-lg);
|
|
1941
|
+
overflow: hidden;
|
|
1942
|
+
min-height: 0;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
.tt-panel-header {
|
|
1946
|
+
display: flex;
|
|
1947
|
+
align-items: center;
|
|
1948
|
+
justify-content: space-between;
|
|
1949
|
+
gap: 12px;
|
|
1950
|
+
padding: 10px 14px;
|
|
1951
|
+
border-bottom: 1px solid var(--border);
|
|
1952
|
+
background: var(--bg-header);
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
.tt-panel-header h3 {
|
|
1956
|
+
font-size: 0.85rem;
|
|
1957
|
+
font-weight: 600;
|
|
1958
|
+
color: var(--text);
|
|
1959
|
+
margin: 0;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.tt-request-header {
|
|
1963
|
+
flex-direction: column;
|
|
1964
|
+
align-items: stretch;
|
|
1965
|
+
gap: 10px;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
.tt-tool-group {
|
|
1969
|
+
width: 100%;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
.tt-tool-group label {
|
|
1973
|
+
display: block;
|
|
1974
|
+
font-size: 0.7rem;
|
|
1975
|
+
font-weight: 600;
|
|
1976
|
+
text-transform: uppercase;
|
|
1977
|
+
letter-spacing: 0.06em;
|
|
1978
|
+
color: var(--text-muted);
|
|
1979
|
+
margin-bottom: 4px;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
.tt-tool-group select {
|
|
1983
|
+
width: 100%;
|
|
1984
|
+
padding: 8px 10px;
|
|
1985
|
+
border: 1px solid var(--border-input);
|
|
1986
|
+
border-radius: var(--radius);
|
|
1987
|
+
background: var(--bg-input);
|
|
1988
|
+
color: var(--text);
|
|
1989
|
+
font-size: 0.85rem;
|
|
1990
|
+
font-family: inherit;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
.tt-tool-group select:focus {
|
|
1994
|
+
outline: none;
|
|
1995
|
+
border-color: var(--border-focus);
|
|
1996
|
+
box-shadow: 0 0 0 3px var(--primary-glow);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
.tt-request-actions {
|
|
2000
|
+
display: flex;
|
|
2001
|
+
align-items: center;
|
|
2002
|
+
flex-wrap: wrap;
|
|
2003
|
+
gap: 6px;
|
|
2004
|
+
width: 100%;
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
.tt-request-actions .btn,
|
|
2008
|
+
.tt-request-actions .btn-icon {
|
|
2009
|
+
display: inline-flex;
|
|
2010
|
+
align-items: center;
|
|
2011
|
+
gap: 4px;
|
|
2012
|
+
padding: 4px 8px;
|
|
2013
|
+
font-size: 0.75rem;
|
|
2014
|
+
white-space: nowrap;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
.tt-request-actions .btn .material-icons-round,
|
|
2018
|
+
.tt-request-actions .btn-icon .material-icons-round {
|
|
2019
|
+
font-size: 18px;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
.tt-tool-description {
|
|
2023
|
+
padding: 8px 14px;
|
|
2024
|
+
background: var(--primary-subtle);
|
|
2025
|
+
color: var(--text-secondary);
|
|
2026
|
+
font-size: 0.78rem;
|
|
2027
|
+
line-height: 1.4;
|
|
2028
|
+
border-bottom: 1px solid var(--border);
|
|
2029
|
+
white-space: pre-wrap;
|
|
2030
|
+
word-break: break-word;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
.tt-panel-body {
|
|
2034
|
+
flex: 1;
|
|
2035
|
+
display: flex;
|
|
2036
|
+
min-height: 0;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
.tt-json-editor {
|
|
2040
|
+
flex: 1;
|
|
2041
|
+
width: 100%;
|
|
2042
|
+
resize: none;
|
|
2043
|
+
border: none;
|
|
2044
|
+
outline: none;
|
|
2045
|
+
padding: 12px 14px;
|
|
2046
|
+
background: var(--bg-surface);
|
|
2047
|
+
color: var(--text);
|
|
2048
|
+
font-family: 'Fira Code', 'JetBrains Mono', monospace;
|
|
2049
|
+
font-size: 0.8rem;
|
|
2050
|
+
line-height: 1.5;
|
|
2051
|
+
tab-size: 2;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
.tt-panel-footer {
|
|
2055
|
+
display: flex;
|
|
2056
|
+
align-items: center;
|
|
2057
|
+
gap: 12px;
|
|
2058
|
+
padding: 10px 14px;
|
|
2059
|
+
border-top: 1px solid var(--border);
|
|
2060
|
+
background: var(--bg-header);
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
.tt-status {
|
|
2064
|
+
font-size: 0.75rem;
|
|
2065
|
+
color: var(--text-muted);
|
|
2066
|
+
flex: 1;
|
|
2067
|
+
text-align: right;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
.tt-status-progress {
|
|
2071
|
+
color: var(--info-color);
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
.tt-status-success {
|
|
2075
|
+
color: var(--success);
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
.tt-status-error {
|
|
2079
|
+
color: var(--error);
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
.tt-schema-content,
|
|
2083
|
+
.tt-response-content {
|
|
2084
|
+
flex: 1;
|
|
2085
|
+
margin: 0;
|
|
2086
|
+
padding: 12px 14px;
|
|
2087
|
+
background: var(--bg-surface);
|
|
2088
|
+
color: var(--text);
|
|
2089
|
+
font-family: 'Fira Code', 'JetBrains Mono', monospace;
|
|
2090
|
+
font-size: 0.78rem;
|
|
2091
|
+
line-height: 1.5;
|
|
2092
|
+
white-space: pre-wrap;
|
|
2093
|
+
word-break: break-word;
|
|
2094
|
+
overflow: auto;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
/* prettyPrintJson syntax highlight — ported from multi-bot pretty-print-json.sass */
|
|
2098
|
+
.tt-schema-content,
|
|
2099
|
+
.tt-response-content {
|
|
2100
|
+
position: relative;
|
|
2101
|
+
width: 100%;
|
|
2102
|
+
max-width: 100%;
|
|
2103
|
+
box-sizing: border-box;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
a.json-link {
|
|
2107
|
+
text-decoration: none;
|
|
2108
|
+
border-bottom: 1px solid;
|
|
2109
|
+
outline: none;
|
|
2110
|
+
color: var(--primary);
|
|
2111
|
+
}
|
|
2112
|
+
a.json-link:hover {
|
|
2113
|
+
background-color: transparent;
|
|
2114
|
+
outline: none;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
.json-string { color: #000000; }
|
|
2118
|
+
.json-key { color: #000080; font-weight: 400; }
|
|
2119
|
+
.json-boolean { color: #007300; }
|
|
2120
|
+
.json-number { color: #0000ff; }
|
|
2121
|
+
.json-null { color: #862e9c; font-style: italic; }
|
|
2122
|
+
.json-mark { color: var(--text-muted); }
|
|
2123
|
+
|
|
2124
|
+
[data-theme="dark"] .json-string { color: #e8f0ff; }
|
|
2125
|
+
[data-theme="dark"] .json-key { color: #82aaff; }
|
|
2126
|
+
[data-theme="dark"] .json-boolean { color: #7fd96e; }
|
|
2127
|
+
[data-theme="dark"] .json-number { color: #82d4ff; }
|
|
2128
|
+
[data-theme="dark"] .json-null { color: #e599f7; }
|
|
2129
|
+
|
|
2130
|
+
/* Long-text wrapper for strings longer than maxTextLength */
|
|
2131
|
+
.json-key-container {
|
|
2132
|
+
display: inline;
|
|
2133
|
+
white-space: pre;
|
|
2134
|
+
}
|
|
2135
|
+
.json-long-text-inline {
|
|
2136
|
+
display: block;
|
|
2137
|
+
width: 100%;
|
|
2138
|
+
max-width: 100%;
|
|
2139
|
+
box-sizing: border-box;
|
|
2140
|
+
}
|
|
2141
|
+
.json-long-text-content {
|
|
2142
|
+
padding: 2px 5px;
|
|
2143
|
+
margin: 4px 0;
|
|
2144
|
+
background: #f8f9fa;
|
|
2145
|
+
border: 1px solid #dee2e6;
|
|
2146
|
+
border-radius: 4px;
|
|
2147
|
+
font-family: menlo, consolas, monospace;
|
|
2148
|
+
font-size: 0.85em;
|
|
2149
|
+
line-height: 1.4;
|
|
2150
|
+
color: #212529;
|
|
2151
|
+
white-space: pre-wrap;
|
|
2152
|
+
overflow-wrap: break-word;
|
|
2153
|
+
box-sizing: border-box;
|
|
2154
|
+
width: 100%;
|
|
2155
|
+
max-width: 100%;
|
|
2156
|
+
}
|
|
2157
|
+
[data-theme="dark"] .json-long-text-content {
|
|
2158
|
+
background: rgba(255, 255, 255, 0.04);
|
|
2159
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
2160
|
+
color: var(--text);
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
.tt-response-content.tt-response-error {
|
|
2164
|
+
color: var(--error);
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
.tt-response-content.tt-response-text-mode {
|
|
2168
|
+
background: #eaf6ff;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
[data-theme="dark"] .tt-response-content.tt-response-text-mode {
|
|
2172
|
+
background: rgba(99, 165, 240, 0.12);
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
.tt-response-actions {
|
|
2176
|
+
display: flex;
|
|
2177
|
+
align-items: center;
|
|
2178
|
+
gap: 4px;
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
#ttResponseTextView.active {
|
|
2182
|
+
color: var(--primary);
|
|
2183
|
+
background: var(--primary-glow);
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
.tt-placeholder {
|
|
2187
|
+
color: var(--text-muted);
|
|
2188
|
+
font-style: italic;
|
|
2189
|
+
font-family: 'Inter', sans-serif;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
@media (max-width: 900px) {
|
|
2193
|
+
.tt-layout,
|
|
2194
|
+
.tt-layout[data-show-schema="true"] {
|
|
2195
|
+
grid-template-columns: 1fr;
|
|
2196
|
+
grid-auto-rows: minmax(220px, auto);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fa-mcp-sdk",
|
|
3
3
|
"productName": "FA MCP SDK",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.109",
|
|
5
5
|
"description": "Core infrastructure and templates for building Model Context Protocol (MCP) servers with TypeScript",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/core/index.js",
|