@softeria/ms-365-mcp-server 0.185.1 → 0.187.0
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/README.md +42 -0
- package/dist/apps/bridge.js +258 -0
- package/dist/apps/file-browser.html +157 -0
- package/dist/apps/file-browser.js +362 -0
- package/dist/apps/mail-draft.html +109 -0
- package/dist/apps/mail-draft.js +341 -0
- package/dist/cli.js +6 -0
- package/dist/endpoints.json +42 -9
- package/dist/graph-tools.js +29 -2
- package/dist/mcp-apps.js +125 -0
- package/dist/server.js +8 -1
- package/eslint.config.js +8 -0
- package/package.json +1 -1
- package/src/apps/bridge.js +258 -0
- package/src/apps/file-browser.html +157 -0
- package/src/apps/file-browser.js +362 -0
- package/src/apps/mail-draft.html +109 -0
- package/src/apps/mail-draft.js +341 -0
- package/src/endpoints.json +42 -9
- package/tsup.config.ts +4 -1
package/README.md
CHANGED
|
@@ -781,6 +781,45 @@ Select a small set: exposing many generated Graph schemas can consume substantia
|
|
|
781
781
|
model context. This option does not shrink individual schemas. Without
|
|
782
782
|
`--eager-tools`, discovery and normal registration behave as before.
|
|
783
783
|
|
|
784
|
+
## MCP Apps (experimental)
|
|
785
|
+
|
|
786
|
+
With `--enable-mcp-apps` (or `MS365_MCP_ENABLE_MCP_APPS=true`), tools that have an
|
|
787
|
+
[MCP Apps](https://github.com/modelcontextprotocol/ext-apps) view show it in hosts that
|
|
788
|
+
support MCP Apps, such as Claude, ChatGPT and VS Code. Other hosts ignore it and get the
|
|
789
|
+
same tool results as before, except with `excludeResponse` (see below).
|
|
790
|
+
|
|
791
|
+
- **File browser**, for `list-folder-files`: open folders, go back through the folder
|
|
792
|
+
path, load more items and open files in the browser.
|
|
793
|
+
- **Mail draft**, for `create-draft-email`, the reply, reply-all and forward drafts, and
|
|
794
|
+
their shared mailbox versions: the draft's subject, its recipients with every address
|
|
795
|
+
written out, and its body as the plain text Graph gives for it, which in practice writes
|
|
796
|
+
out link and image addresses. It has a Send button and a link to edit it in Outlook.
|
|
797
|
+
Ask for a draft to review a mail before it goes out; `send-mail` still sends straight away.
|
|
798
|
+
|
|
799
|
+
The views get their data through the host, which calls this server's tools again, so they
|
|
800
|
+
need no network access of their own. A click on Send is the user's confirmation, so the
|
|
801
|
+
view sends with `confirm: true`. The mail draft reads the draft itself when it opens, so it
|
|
802
|
+
shows the draft as Graph has it rather than what the model's call returned. Before it sends,
|
|
803
|
+
it reads the draft again: if the draft changed since it was shown, the view shows the new
|
|
804
|
+
version and waits for another click. With `MS365_MCP_BODY_FORMAT=html` the view shows only
|
|
805
|
+
Graph's 255-character preview of the body, and has no Send button.
|
|
806
|
+
|
|
807
|
+
When the model passes `excludeResponse`, the tool's text answer is only `{"success":true}`,
|
|
808
|
+
and the draft goes along as `structuredContent` for the view. The MCP Apps spec keeps
|
|
809
|
+
`structuredContent` out of the model's context, but ChatGPT, and clients without MCP Apps
|
|
810
|
+
that read it, give it to the model as well.
|
|
811
|
+
|
|
812
|
+
A view only offers what this server registers. The Send button needs both
|
|
813
|
+
`get-mail-message` and `send-draft-message` (for a shared mailbox,
|
|
814
|
+
`get-shared-mailbox-message` and `send-shared-mailbox-draft`); when `--enabled-tools` or the
|
|
815
|
+
allowed scopes leave one out, the mail draft has no Send button, and without the read tool
|
|
816
|
+
it shows only the start of the body.
|
|
817
|
+
|
|
818
|
+
- It has no effect with `--toon`, since the views read JSON results.
|
|
819
|
+
- With `--discovery`, only tools published directly with `--eager-tools` show a view, and
|
|
820
|
+
the Send button needs its tools published too, e.g.
|
|
821
|
+
`--discovery --eager-tools create-draft-email,get-mail-message,send-draft-message`.
|
|
822
|
+
|
|
784
823
|
## CLI Options
|
|
785
824
|
|
|
786
825
|
The following options can be used when running ms-365-mcp-server directly from the command line:
|
|
@@ -849,6 +888,8 @@ When running as an MCP server, the following options can be used:
|
|
|
849
888
|
--blob-output File download tools answer an MCP EmbeddedResource with the file instead of
|
|
850
889
|
base64 JSON in a text block (see MS365_MCP_BLOB_OUTPUT below)
|
|
851
890
|
--discovery Dynamic tool discovery: loads tools on demand to reduce initial token usage (see "Dynamic Tool Discovery" above)
|
|
891
|
+
--enable-mcp-apps (experimental) Show the interactive MCP Apps views, a OneDrive/SharePoint file browser
|
|
892
|
+
and a mail draft view with a Send button, in hosts that support them (see "MCP Apps" above)
|
|
852
893
|
--public-url <url> Public base URL for OAuth when behind a reverse proxy (see Open WebUI section and docs/deployment.md)
|
|
853
894
|
```
|
|
854
895
|
|
|
@@ -866,6 +907,7 @@ Environment variables:
|
|
|
866
907
|
- `MS365_MCP_FEDERATED_TOKEN_FILE=<path>`: Federated token (workload identity federation), used instead of a secret or certificate in app mode
|
|
867
908
|
- `MS365_MCP_MANAGED_IDENTITY=system|<client id>`: Use the host's managed identity in app mode, instead of an app registration
|
|
868
909
|
- `MS365_MCP_OUTPUT_FORMAT=toon`: Enable TOON output format (alternative to --toon flag)
|
|
910
|
+
- `MS365_MCP_ENABLE_MCP_APPS=true|1`: Show the MCP Apps views (alternative to --enable-mcp-apps; see "MCP Apps" above)
|
|
869
911
|
- `MS365_MCP_MAX_TOP=<n>`: Hard cap for Graph `$top` / `top` on list requests (positive integer). When the model passes a larger value, the server clamps it to `n` so responses stay smaller. Example: `MS365_MCP_MAX_TOP=15`
|
|
870
912
|
- `MS365_MCP_MAX_PAGES=<n>`: Maximum number of pages followed when a tool is called with `fetchAllPages: true` (positive integer, default `100`). Bounds memory and latency for large result sets.
|
|
871
913
|
- `MS365_MCP_MAX_ITEMS=<n>`: Maximum number of items accumulated when `fetchAllPages: true` (positive integer, default `10000`). Pagination stops after a whole page reaches this count, so the result can exceed the cap.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/* exported createMcpAppBridge */
|
|
2
|
+
|
|
3
|
+
// MCP Apps (spec 2026-01-26): JSON-RPC 2.0 with the host over postMessage. The server inlines
|
|
4
|
+
// this into every view, before the view's own script, which calls createMcpAppBridge once.
|
|
5
|
+
function createMcpAppBridge(handlers) {
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const PROTOCOL_VERSION = '2026-01-26';
|
|
9
|
+
// Like ext-apps' App: a request the host never answers fails after this, and a tool call's
|
|
10
|
+
// timer starts over on each progress notification, so a host heartbeat keeps it alive
|
|
11
|
+
const REQUEST_TIMEOUT_MS = 60000;
|
|
12
|
+
|
|
13
|
+
let nextId = 1;
|
|
14
|
+
const pending = new Map();
|
|
15
|
+
let capabilities = {};
|
|
16
|
+
let locale;
|
|
17
|
+
let inputSeen = false;
|
|
18
|
+
let resultSeen = false;
|
|
19
|
+
|
|
20
|
+
function post(message) {
|
|
21
|
+
window.parent.postMessage(Object.assign({ jsonrpc: '2.0' }, message), '*');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// options.timeout: milliseconds, 0 for none. options.progress: ask for progress notifications.
|
|
25
|
+
function request(method, params, options) {
|
|
26
|
+
const id = nextId++;
|
|
27
|
+
const timeout =
|
|
28
|
+
options && typeof options.timeout === 'number' ? options.timeout : REQUEST_TIMEOUT_MS;
|
|
29
|
+
let sent = params;
|
|
30
|
+
if (options && options.progress) {
|
|
31
|
+
const meta = Object.assign({}, params && params._meta, { progressToken: id });
|
|
32
|
+
sent = Object.assign({}, params, { _meta: meta });
|
|
33
|
+
}
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
const waiter = { method, resolve, reject, timeout, timer: undefined };
|
|
36
|
+
pending.set(id, waiter);
|
|
37
|
+
arm(id, waiter);
|
|
38
|
+
post({ id, method, params: sent });
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function arm(id, waiter) {
|
|
43
|
+
clearTimeout(waiter.timer);
|
|
44
|
+
if (waiter.timeout > 0) {
|
|
45
|
+
waiter.timer = setTimeout(() => {
|
|
46
|
+
// Like the SDK: tell the host the view gave up, so it can drop the request too
|
|
47
|
+
notify('notifications/cancelled', { requestId: id, reason: 'Timed out' });
|
|
48
|
+
const error = new Error('The host did not answer in time.');
|
|
49
|
+
error.name = 'TimeoutError';
|
|
50
|
+
settle(id, error);
|
|
51
|
+
}, waiter.timeout);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function settle(id, error, result) {
|
|
56
|
+
const waiter = pending.get(id);
|
|
57
|
+
if (!waiter) return;
|
|
58
|
+
pending.delete(id);
|
|
59
|
+
clearTimeout(waiter.timer);
|
|
60
|
+
if (error) waiter.reject(error);
|
|
61
|
+
else waiter.resolve(result);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function notify(method, params) {
|
|
65
|
+
post({ method, params });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
window.addEventListener('message', (event) => {
|
|
69
|
+
if (event.source !== window.parent) return;
|
|
70
|
+
const msg = event.data;
|
|
71
|
+
if (!msg || typeof msg !== 'object' || msg.jsonrpc !== '2.0') return;
|
|
72
|
+
if (typeof msg.method === 'string') {
|
|
73
|
+
if (msg.id !== undefined) answerHost(msg);
|
|
74
|
+
else onNotification(msg.method, isObject(msg.params) ? msg.params : {});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (msg.error) settle(msg.id, new Error(msg.error.message || 'The host refused.'));
|
|
78
|
+
else settle(msg.id, undefined, msg.result);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
function answerHost(msg) {
|
|
82
|
+
if (msg.method === 'ui/resource-teardown' || msg.method === 'ping') {
|
|
83
|
+
post({ id: msg.id, result: {} });
|
|
84
|
+
} else {
|
|
85
|
+
post({ id: msg.id, error: { code: -32601, message: 'Method not found' } });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Only the first tool-input and tool-result count: they are the call that opened the view.
|
|
90
|
+
// Hosts may echo the view's own calls here too (the spec's interactive phase), and those
|
|
91
|
+
// answers already come back to the request that made them.
|
|
92
|
+
function onNotification(method, params) {
|
|
93
|
+
if (method === 'ui/notifications/tool-input') {
|
|
94
|
+
if (!inputSeen && !resultSeen) {
|
|
95
|
+
inputSeen = true;
|
|
96
|
+
handle('onToolInput', isObject(params.arguments) ? params.arguments : {});
|
|
97
|
+
}
|
|
98
|
+
} else if (method === 'ui/notifications/tool-result') {
|
|
99
|
+
if (!resultSeen) {
|
|
100
|
+
resultSeen = true;
|
|
101
|
+
handle('onToolResult', params);
|
|
102
|
+
}
|
|
103
|
+
} else if (method === 'ui/notifications/tool-cancelled') {
|
|
104
|
+
// This is about the call that opened the view, never one the view made itself, so
|
|
105
|
+
// it means nothing once that call's result is in
|
|
106
|
+
if (!resultSeen) handle('onToolCancelled', params);
|
|
107
|
+
} else if (method === 'notifications/progress') {
|
|
108
|
+
const waiter = pending.get(params.progressToken);
|
|
109
|
+
if (waiter) arm(params.progressToken, waiter);
|
|
110
|
+
} else if (method === 'ui/notifications/host-context-changed') {
|
|
111
|
+
applyHostContext(params);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function applyHostContext(context) {
|
|
116
|
+
if (!isObject(context)) return;
|
|
117
|
+
const root = document.documentElement;
|
|
118
|
+
if (context.theme === 'light' || context.theme === 'dark') {
|
|
119
|
+
root.dataset.theme = context.theme;
|
|
120
|
+
root.style.colorScheme = context.theme;
|
|
121
|
+
}
|
|
122
|
+
const variables = context.styles && context.styles.variables;
|
|
123
|
+
if (isObject(variables)) {
|
|
124
|
+
for (const [name, value] of Object.entries(variables)) {
|
|
125
|
+
if (name.startsWith('--') && typeof value === 'string') {
|
|
126
|
+
root.style.setProperty(name, value);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (typeof context.locale === 'string') locale = context.locale;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Tell the host how tall the view is, like the official App's autoResize
|
|
134
|
+
let lastWidth = 0;
|
|
135
|
+
let lastHeight = 0;
|
|
136
|
+
let sizeQueued = false;
|
|
137
|
+
function reportSize() {
|
|
138
|
+
if (sizeQueued) return;
|
|
139
|
+
sizeQueued = true;
|
|
140
|
+
requestAnimationFrame(() => {
|
|
141
|
+
sizeQueued = false;
|
|
142
|
+
const root = document.documentElement;
|
|
143
|
+
const previous = root.style.height;
|
|
144
|
+
root.style.height = 'max-content';
|
|
145
|
+
const height = Math.ceil(root.getBoundingClientRect().height);
|
|
146
|
+
root.style.height = previous;
|
|
147
|
+
const width = Math.ceil(window.innerWidth);
|
|
148
|
+
if (width === lastWidth && height === lastHeight) return;
|
|
149
|
+
lastWidth = width;
|
|
150
|
+
lastHeight = height;
|
|
151
|
+
notify('ui/notifications/size-changed', { width, height });
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// This server's tool results are JSON text; a failure sets isError and has an error field.
|
|
156
|
+
// A body the model asked to leave out comes as structuredContent instead.
|
|
157
|
+
function readToolResult(result, failure) {
|
|
158
|
+
const failed = Boolean(result && result.isError);
|
|
159
|
+
let data =
|
|
160
|
+
!failed && result && isObject(result.structuredContent)
|
|
161
|
+
? result.structuredContent
|
|
162
|
+
: undefined;
|
|
163
|
+
if (data === undefined) {
|
|
164
|
+
const text = resultText(result);
|
|
165
|
+
try {
|
|
166
|
+
data = JSON.parse(text);
|
|
167
|
+
} catch {
|
|
168
|
+
throw new Error(
|
|
169
|
+
failed ? text || failure : 'This result is not JSON, so it is not shown here.'
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (failed || (isObject(data) && data.error)) throw new Error(errorText(data) || failure);
|
|
174
|
+
return data;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// The message of a failed result, undefined when it did not fail. A success need not be
|
|
178
|
+
// JSON at all: Graph answers some actions with an empty body.
|
|
179
|
+
function toolError(result, failure) {
|
|
180
|
+
const text = resultText(result);
|
|
181
|
+
let data;
|
|
182
|
+
try {
|
|
183
|
+
data = JSON.parse(text);
|
|
184
|
+
} catch {
|
|
185
|
+
return result && result.isError ? text || failure : undefined;
|
|
186
|
+
}
|
|
187
|
+
if (!(result && result.isError) && !(isObject(data) && data.error)) return undefined;
|
|
188
|
+
return errorText(data) || text || failure;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function resultText(result) {
|
|
192
|
+
const blocks = result && Array.isArray(result.content) ? result.content : [];
|
|
193
|
+
return blocks
|
|
194
|
+
.filter((block) => block && block.type === 'text' && typeof block.text === 'string')
|
|
195
|
+
.map((block) => block.text)
|
|
196
|
+
.join('');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// { error: 'text' }, Graph's { error: { message } } or { error: 'code', message }
|
|
200
|
+
function errorText(data) {
|
|
201
|
+
if (!isObject(data)) return undefined;
|
|
202
|
+
if (typeof data.message === 'string') return data.message;
|
|
203
|
+
if (typeof data.error === 'string') return data.error;
|
|
204
|
+
if (isObject(data.error) && typeof data.error.message === 'string') {
|
|
205
|
+
return data.error.message;
|
|
206
|
+
}
|
|
207
|
+
return undefined;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function handle(name, value) {
|
|
211
|
+
if (handlers && typeof handlers[name] === 'function') handlers[name](value);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function isObject(value) {
|
|
215
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
request('ui/initialize', {
|
|
219
|
+
appInfo: { name: (handlers && handlers.name) || 'ms-365-app', version: '1.0.0' },
|
|
220
|
+
appCapabilities: {},
|
|
221
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
222
|
+
}).then(
|
|
223
|
+
(result) => {
|
|
224
|
+
capabilities = (result && isObject(result.hostCapabilities) && result.hostCapabilities) || {};
|
|
225
|
+
applyHostContext(result && result.hostContext);
|
|
226
|
+
notify('ui/notifications/initialized', {});
|
|
227
|
+
const observer = new ResizeObserver(reportSize);
|
|
228
|
+
observer.observe(document.documentElement);
|
|
229
|
+
observer.observe(document.body);
|
|
230
|
+
handle('onReady', capabilities);
|
|
231
|
+
},
|
|
232
|
+
(error) => handle('onInitError', error)
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
get capabilities() {
|
|
237
|
+
return capabilities;
|
|
238
|
+
},
|
|
239
|
+
get locale() {
|
|
240
|
+
return locale;
|
|
241
|
+
},
|
|
242
|
+
callTool(name, args, options) {
|
|
243
|
+
return request(
|
|
244
|
+
'tools/call',
|
|
245
|
+
{ name, arguments: args },
|
|
246
|
+
Object.assign({ progress: true }, options)
|
|
247
|
+
);
|
|
248
|
+
},
|
|
249
|
+
openLink(url) {
|
|
250
|
+
return request('ui/open-link', { url });
|
|
251
|
+
},
|
|
252
|
+
updateModelContext(text) {
|
|
253
|
+
return request('ui/update-model-context', { content: [{ type: 'text', text }] });
|
|
254
|
+
},
|
|
255
|
+
readToolResult,
|
|
256
|
+
toolError,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Files</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme: light dark;
|
|
10
|
+
font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
|
|
11
|
+
font-size: var(--font-text-sm-size, 14px);
|
|
12
|
+
line-height: var(--font-text-sm-line-height, 1.4);
|
|
13
|
+
color: var(--color-text-primary, CanvasText);
|
|
14
|
+
background: var(--color-background-primary, transparent);
|
|
15
|
+
}
|
|
16
|
+
* {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
[hidden] {
|
|
20
|
+
display: none !important;
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 12px;
|
|
25
|
+
}
|
|
26
|
+
button {
|
|
27
|
+
font: inherit;
|
|
28
|
+
color: inherit;
|
|
29
|
+
}
|
|
30
|
+
header {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 8px;
|
|
34
|
+
margin-bottom: 8px;
|
|
35
|
+
}
|
|
36
|
+
nav {
|
|
37
|
+
flex: 1;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-wrap: wrap;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 2px;
|
|
43
|
+
font-weight: var(--font-weight-semibold, 600);
|
|
44
|
+
}
|
|
45
|
+
.crumb {
|
|
46
|
+
border: 0;
|
|
47
|
+
background: none;
|
|
48
|
+
padding: 2px 4px;
|
|
49
|
+
border-radius: var(--border-radius-sm, 4px);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
color: var(--color-text-info, LinkText);
|
|
52
|
+
}
|
|
53
|
+
.crumb:disabled {
|
|
54
|
+
cursor: default;
|
|
55
|
+
color: inherit;
|
|
56
|
+
}
|
|
57
|
+
.sep {
|
|
58
|
+
color: var(--color-text-tertiary, GrayText);
|
|
59
|
+
}
|
|
60
|
+
.tool {
|
|
61
|
+
flex: none;
|
|
62
|
+
border: 1px solid var(--color-border-secondary, rgba(127, 127, 127, 0.4));
|
|
63
|
+
background: none;
|
|
64
|
+
padding: 4px 10px;
|
|
65
|
+
border-radius: var(--border-radius-sm, 4px);
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
}
|
|
68
|
+
.tool:disabled {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
cursor: default;
|
|
71
|
+
}
|
|
72
|
+
ul {
|
|
73
|
+
list-style: none;
|
|
74
|
+
margin: 0;
|
|
75
|
+
padding: 0;
|
|
76
|
+
max-height: 420px;
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
border-top: 1px solid var(--color-border-tertiary, rgba(127, 127, 127, 0.25));
|
|
79
|
+
}
|
|
80
|
+
li {
|
|
81
|
+
border-bottom: 1px solid var(--color-border-tertiary, rgba(127, 127, 127, 0.25));
|
|
82
|
+
}
|
|
83
|
+
.row {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 10px;
|
|
87
|
+
width: 100%;
|
|
88
|
+
padding: 8px 6px;
|
|
89
|
+
border: 0;
|
|
90
|
+
background: none;
|
|
91
|
+
text-align: left;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
.row:hover:not(:disabled),
|
|
95
|
+
.row:focus-visible {
|
|
96
|
+
background: var(--color-background-secondary, rgba(127, 127, 127, 0.12));
|
|
97
|
+
}
|
|
98
|
+
.row:disabled {
|
|
99
|
+
cursor: default;
|
|
100
|
+
}
|
|
101
|
+
.icon {
|
|
102
|
+
flex: none;
|
|
103
|
+
width: 20px;
|
|
104
|
+
height: 20px;
|
|
105
|
+
}
|
|
106
|
+
.icon.folder path {
|
|
107
|
+
fill: var(--color-text-warning, #d9a21b);
|
|
108
|
+
}
|
|
109
|
+
.icon.file path {
|
|
110
|
+
fill: none;
|
|
111
|
+
stroke: var(--color-text-secondary, GrayText);
|
|
112
|
+
stroke-width: 1.3;
|
|
113
|
+
stroke-linejoin: round;
|
|
114
|
+
}
|
|
115
|
+
.name {
|
|
116
|
+
flex: 1;
|
|
117
|
+
min-width: 0;
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
text-overflow: ellipsis;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
}
|
|
122
|
+
.meta {
|
|
123
|
+
flex: none;
|
|
124
|
+
color: var(--color-text-secondary, GrayText);
|
|
125
|
+
font-size: var(--font-text-xs-size, 12px);
|
|
126
|
+
}
|
|
127
|
+
#more {
|
|
128
|
+
margin-top: 8px;
|
|
129
|
+
}
|
|
130
|
+
#status {
|
|
131
|
+
margin: 8px 0 0;
|
|
132
|
+
color: var(--color-text-secondary, GrayText);
|
|
133
|
+
}
|
|
134
|
+
#status.error {
|
|
135
|
+
color: var(--color-text-danger, #c62828);
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
138
|
+
</head>
|
|
139
|
+
<body>
|
|
140
|
+
<header>
|
|
141
|
+
<nav id="crumbs" aria-label="Folder path"></nav>
|
|
142
|
+
<button id="refresh" class="tool" type="button" disabled>Refresh</button>
|
|
143
|
+
</header>
|
|
144
|
+
<ul id="items" hidden></ul>
|
|
145
|
+
<button id="more" class="tool" type="button" hidden>Load more</button>
|
|
146
|
+
<p id="status" role="status">Loading...</p>
|
|
147
|
+
<script type="application/json" id="mcp-app-config">
|
|
148
|
+
__MCP_APP_CONFIG__
|
|
149
|
+
</script>
|
|
150
|
+
<script>
|
|
151
|
+
__MCP_APP_BRIDGE__
|
|
152
|
+
</script>
|
|
153
|
+
<script>
|
|
154
|
+
__MCP_APP_SCRIPT__
|
|
155
|
+
</script>
|
|
156
|
+
</body>
|
|
157
|
+
</html>
|