@modelcontextprotocol/inspector 0.17.2 → 0.18.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/cli/build/client/prompts.js +10 -5
- package/cli/build/client/resources.js +12 -6
- package/cli/build/client/tools.js +17 -4
- package/cli/build/index.js +25 -8
- package/client/dist/assets/{OAuthCallback-DOgG8dke.js → OAuthCallback-CXY8DEIM.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-m70IPFbL.js → OAuthDebugCallback-zr6INHin.js} +1 -1
- package/client/dist/assets/{index-CV-uzqYs.css → index-DoQUGvvr.css} +30 -3
- package/client/dist/assets/{index-Bl2jgoAl.js → index-Dw52pmVD.js} +30607 -12552
- package/client/dist/index.html +2 -2
- package/package.json +6 -6
- package/server/build/index.js +37 -8
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// List available prompts
|
|
2
|
-
export async function listPrompts(client) {
|
|
2
|
+
export async function listPrompts(client, metadata) {
|
|
3
3
|
try {
|
|
4
|
-
const
|
|
4
|
+
const params = metadata && Object.keys(metadata).length > 0 ? { _meta: metadata } : {};
|
|
5
|
+
const response = await client.listPrompts(params);
|
|
5
6
|
return response;
|
|
6
7
|
}
|
|
7
8
|
catch (error) {
|
|
@@ -9,7 +10,7 @@ export async function listPrompts(client) {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
// Get a prompt
|
|
12
|
-
export async function getPrompt(client, name, args) {
|
|
13
|
+
export async function getPrompt(client, name, args, metadata) {
|
|
13
14
|
try {
|
|
14
15
|
// Convert all arguments to strings for prompt arguments
|
|
15
16
|
const stringArgs = {};
|
|
@@ -26,10 +27,14 @@ export async function getPrompt(client, name, args) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const params = {
|
|
30
31
|
name,
|
|
31
32
|
arguments: stringArgs,
|
|
32
|
-
}
|
|
33
|
+
};
|
|
34
|
+
if (metadata && Object.keys(metadata).length > 0) {
|
|
35
|
+
params._meta = metadata;
|
|
36
|
+
}
|
|
37
|
+
const response = await client.getPrompt(params);
|
|
33
38
|
return response;
|
|
34
39
|
}
|
|
35
40
|
catch (error) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// List available resources
|
|
2
|
-
export async function listResources(client) {
|
|
2
|
+
export async function listResources(client, metadata) {
|
|
3
3
|
try {
|
|
4
|
-
const
|
|
4
|
+
const params = metadata && Object.keys(metadata).length > 0 ? { _meta: metadata } : {};
|
|
5
|
+
const response = await client.listResources(params);
|
|
5
6
|
return response;
|
|
6
7
|
}
|
|
7
8
|
catch (error) {
|
|
@@ -9,9 +10,13 @@ export async function listResources(client) {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
// Read a resource
|
|
12
|
-
export async function readResource(client, uri) {
|
|
13
|
+
export async function readResource(client, uri, metadata) {
|
|
13
14
|
try {
|
|
14
|
-
const
|
|
15
|
+
const params = { uri };
|
|
16
|
+
if (metadata && Object.keys(metadata).length > 0) {
|
|
17
|
+
params._meta = metadata;
|
|
18
|
+
}
|
|
19
|
+
const response = await client.readResource(params);
|
|
15
20
|
return response;
|
|
16
21
|
}
|
|
17
22
|
catch (error) {
|
|
@@ -19,9 +24,10 @@ export async function readResource(client, uri) {
|
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
// List resource templates
|
|
22
|
-
export async function listResourceTemplates(client) {
|
|
27
|
+
export async function listResourceTemplates(client, metadata) {
|
|
23
28
|
try {
|
|
24
|
-
const
|
|
29
|
+
const params = metadata && Object.keys(metadata).length > 0 ? { _meta: metadata } : {};
|
|
30
|
+
const response = await client.listResourceTemplates(params);
|
|
25
31
|
return response;
|
|
26
32
|
}
|
|
27
33
|
catch (error) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export async function listTools(client) {
|
|
1
|
+
export async function listTools(client, metadata) {
|
|
2
2
|
try {
|
|
3
|
-
const
|
|
3
|
+
const params = metadata && Object.keys(metadata).length > 0 ? { _meta: metadata } : {};
|
|
4
|
+
const response = await client.listTools(params);
|
|
4
5
|
return response;
|
|
5
6
|
}
|
|
6
7
|
catch (error) {
|
|
@@ -42,9 +43,9 @@ function convertParameters(tool, params) {
|
|
|
42
43
|
}
|
|
43
44
|
return result;
|
|
44
45
|
}
|
|
45
|
-
export async function callTool(client, name, args) {
|
|
46
|
+
export async function callTool(client, name, args, generalMetadata, toolSpecificMetadata) {
|
|
46
47
|
try {
|
|
47
|
-
const toolsResponse = await listTools(client);
|
|
48
|
+
const toolsResponse = await listTools(client, generalMetadata);
|
|
48
49
|
const tools = toolsResponse.tools;
|
|
49
50
|
const tool = tools.find((t) => t.name === name);
|
|
50
51
|
let convertedArgs = args;
|
|
@@ -62,9 +63,21 @@ export async function callTool(client, name, args) {
|
|
|
62
63
|
convertedArgs = { ...args, ...convertedStringArgs };
|
|
63
64
|
}
|
|
64
65
|
}
|
|
66
|
+
// Merge general metadata with tool-specific metadata
|
|
67
|
+
// Tool-specific metadata takes precedence over general metadata
|
|
68
|
+
let mergedMetadata;
|
|
69
|
+
if (generalMetadata || toolSpecificMetadata) {
|
|
70
|
+
mergedMetadata = {
|
|
71
|
+
...(generalMetadata || {}),
|
|
72
|
+
...(toolSpecificMetadata || {}),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
65
75
|
const response = await client.callTool({
|
|
66
76
|
name: name,
|
|
67
77
|
arguments: convertedArgs,
|
|
78
|
+
_meta: mergedMetadata && Object.keys(mergedMetadata).length > 0
|
|
79
|
+
? mergedMetadata
|
|
80
|
+
: undefined,
|
|
68
81
|
});
|
|
69
82
|
return response;
|
|
70
83
|
}
|
package/cli/build/index.js
CHANGED
|
@@ -71,36 +71,36 @@ async function callMethod(args) {
|
|
|
71
71
|
let result;
|
|
72
72
|
// Tools methods
|
|
73
73
|
if (args.method === "tools/list") {
|
|
74
|
-
result = await listTools(client);
|
|
74
|
+
result = await listTools(client, args.metadata);
|
|
75
75
|
}
|
|
76
76
|
else if (args.method === "tools/call") {
|
|
77
77
|
if (!args.toolName) {
|
|
78
78
|
throw new Error("Tool name is required for tools/call method. Use --tool-name to specify the tool name.");
|
|
79
79
|
}
|
|
80
|
-
result = await callTool(client, args.toolName, args.toolArg || {});
|
|
80
|
+
result = await callTool(client, args.toolName, args.toolArg || {}, args.metadata, args.toolMeta);
|
|
81
81
|
}
|
|
82
82
|
// Resources methods
|
|
83
83
|
else if (args.method === "resources/list") {
|
|
84
|
-
result = await listResources(client);
|
|
84
|
+
result = await listResources(client, args.metadata);
|
|
85
85
|
}
|
|
86
86
|
else if (args.method === "resources/read") {
|
|
87
87
|
if (!args.uri) {
|
|
88
88
|
throw new Error("URI is required for resources/read method. Use --uri to specify the resource URI.");
|
|
89
89
|
}
|
|
90
|
-
result = await readResource(client, args.uri);
|
|
90
|
+
result = await readResource(client, args.uri, args.metadata);
|
|
91
91
|
}
|
|
92
92
|
else if (args.method === "resources/templates/list") {
|
|
93
|
-
result = await listResourceTemplates(client);
|
|
93
|
+
result = await listResourceTemplates(client, args.metadata);
|
|
94
94
|
}
|
|
95
95
|
// Prompts methods
|
|
96
96
|
else if (args.method === "prompts/list") {
|
|
97
|
-
result = await listPrompts(client);
|
|
97
|
+
result = await listPrompts(client, args.metadata);
|
|
98
98
|
}
|
|
99
99
|
else if (args.method === "prompts/get") {
|
|
100
100
|
if (!args.promptName) {
|
|
101
101
|
throw new Error("Prompt name is required for prompts/get method. Use --prompt-name to specify the prompt name.");
|
|
102
102
|
}
|
|
103
|
-
result = await getPrompt(client, args.promptName, args.promptArgs || {});
|
|
103
|
+
result = await getPrompt(client, args.promptName, args.promptArgs || {}, args.metadata);
|
|
104
104
|
}
|
|
105
105
|
// Logging methods
|
|
106
106
|
else if (args.method === "logging/setLevel") {
|
|
@@ -207,7 +207,12 @@ function parseArgs() {
|
|
|
207
207
|
//
|
|
208
208
|
// HTTP headers
|
|
209
209
|
//
|
|
210
|
-
.option("--header <headers...>", 'HTTP headers as "HeaderName: Value" pairs (for HTTP/SSE transports)', parseHeaderPair, {})
|
|
210
|
+
.option("--header <headers...>", 'HTTP headers as "HeaderName: Value" pairs (for HTTP/SSE transports)', parseHeaderPair, {})
|
|
211
|
+
//
|
|
212
|
+
// Metadata options
|
|
213
|
+
//
|
|
214
|
+
.option("--metadata <pairs...>", "General metadata as key=value pairs (applied to all methods)", parseKeyValuePair, {})
|
|
215
|
+
.option("--tool-metadata <pairs...>", "Tool-specific metadata as key=value pairs (for tools/call method only)", parseKeyValuePair, {});
|
|
211
216
|
// Parse only the arguments before --
|
|
212
217
|
program.parse(preArgs);
|
|
213
218
|
const options = program.opts();
|
|
@@ -221,6 +226,18 @@ function parseArgs() {
|
|
|
221
226
|
target: finalArgs,
|
|
222
227
|
...options,
|
|
223
228
|
headers: options.header, // commander.js uses 'header' field, map to 'headers'
|
|
229
|
+
metadata: options.metadata
|
|
230
|
+
? Object.fromEntries(Object.entries(options.metadata).map(([key, value]) => [
|
|
231
|
+
key,
|
|
232
|
+
String(value),
|
|
233
|
+
]))
|
|
234
|
+
: undefined,
|
|
235
|
+
toolMeta: options.toolMetadata
|
|
236
|
+
? Object.fromEntries(Object.entries(options.toolMetadata).map(([key, value]) => [
|
|
237
|
+
key,
|
|
238
|
+
String(value),
|
|
239
|
+
]))
|
|
240
|
+
: undefined,
|
|
224
241
|
};
|
|
225
242
|
}
|
|
226
243
|
async function main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-
|
|
1
|
+
import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-Dw52pmVD.js";
|
|
2
2
|
const OAuthCallback = ({ onConnect }) => {
|
|
3
3
|
const { toast } = useToast();
|
|
4
4
|
const hasProcessedRef = reactExports.useRef(false);
|
package/client/dist/assets/{OAuthDebugCallback-m70IPFbL.js → OAuthDebugCallback-zr6INHin.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-
|
|
1
|
+
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-Dw52pmVD.js";
|
|
2
2
|
const OAuthDebugCallback = ({ onConnect }) => {
|
|
3
3
|
reactExports.useEffect(() => {
|
|
4
4
|
let isProcessed = false;
|
|
@@ -281,7 +281,7 @@ pre[class*="language-"] {
|
|
|
281
281
|
--tw-contain-paint: ;
|
|
282
282
|
--tw-contain-style: ;
|
|
283
283
|
}/*
|
|
284
|
-
! tailwindcss v3.4.
|
|
284
|
+
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
|
|
285
285
|
*//*
|
|
286
286
|
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
|
287
287
|
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
|
@@ -916,11 +916,11 @@ video {
|
|
|
916
916
|
.mt-4 {
|
|
917
917
|
margin-top: 1rem;
|
|
918
918
|
}
|
|
919
|
-
.line-clamp-
|
|
919
|
+
.line-clamp-2 {
|
|
920
920
|
overflow: hidden;
|
|
921
921
|
display: -webkit-box;
|
|
922
922
|
-webkit-box-orient: vertical;
|
|
923
|
-
-webkit-line-clamp:
|
|
923
|
+
-webkit-line-clamp: 2;
|
|
924
924
|
}
|
|
925
925
|
.block {
|
|
926
926
|
display: block;
|
|
@@ -1173,6 +1173,11 @@ video {
|
|
|
1173
1173
|
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
|
|
1174
1174
|
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
1175
1175
|
}
|
|
1176
|
+
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
|
|
1177
|
+
--tw-space-y-reverse: 0;
|
|
1178
|
+
margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
|
|
1179
|
+
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
1180
|
+
}
|
|
1176
1181
|
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) {
|
|
1177
1182
|
--tw-space-y-reverse: 0;
|
|
1178
1183
|
margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -1398,6 +1403,10 @@ video {
|
|
|
1398
1403
|
--tw-bg-opacity: 1;
|
|
1399
1404
|
background-color: rgb(254 249 195 / var(--tw-bg-opacity, 1));
|
|
1400
1405
|
}
|
|
1406
|
+
.object-contain {
|
|
1407
|
+
-o-object-fit: contain;
|
|
1408
|
+
object-fit: contain;
|
|
1409
|
+
}
|
|
1401
1410
|
.p-0 {
|
|
1402
1411
|
padding: 0px;
|
|
1403
1412
|
}
|
|
@@ -1472,6 +1481,10 @@ video {
|
|
|
1472
1481
|
padding-top: 1.5rem;
|
|
1473
1482
|
padding-bottom: 1.5rem;
|
|
1474
1483
|
}
|
|
1484
|
+
.py-8 {
|
|
1485
|
+
padding-top: 2rem;
|
|
1486
|
+
padding-bottom: 2rem;
|
|
1487
|
+
}
|
|
1475
1488
|
.pb-4 {
|
|
1476
1489
|
padding-bottom: 1rem;
|
|
1477
1490
|
}
|
|
@@ -1591,6 +1604,10 @@ video {
|
|
|
1591
1604
|
--tw-text-opacity: 1;
|
|
1592
1605
|
color: rgb(55 65 81 / var(--tw-text-opacity, 1));
|
|
1593
1606
|
}
|
|
1607
|
+
.text-gray-800 {
|
|
1608
|
+
--tw-text-opacity: 1;
|
|
1609
|
+
color: rgb(31 41 55 / var(--tw-text-opacity, 1));
|
|
1610
|
+
}
|
|
1594
1611
|
.text-gray-900 {
|
|
1595
1612
|
--tw-text-opacity: 1;
|
|
1596
1613
|
color: rgb(17 24 39 / var(--tw-text-opacity, 1));
|
|
@@ -2012,6 +2029,11 @@ h1 {
|
|
|
2012
2029
|
--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1));
|
|
2013
2030
|
}
|
|
2014
2031
|
|
|
2032
|
+
.focus-visible\:ring-red-500:focus-visible {
|
|
2033
|
+
--tw-ring-opacity: 1;
|
|
2034
|
+
--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1));
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2015
2037
|
.focus-visible\:ring-ring:focus-visible {
|
|
2016
2038
|
--tw-ring-color: hsl(var(--ring));
|
|
2017
2039
|
}
|
|
@@ -2375,6 +2397,11 @@ h1 {
|
|
|
2375
2397
|
color: rgb(243 244 246 / var(--tw-text-opacity, 1));
|
|
2376
2398
|
}
|
|
2377
2399
|
|
|
2400
|
+
.dark\:text-gray-200:is(.dark *) {
|
|
2401
|
+
--tw-text-opacity: 1;
|
|
2402
|
+
color: rgb(229 231 235 / var(--tw-text-opacity, 1));
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2378
2405
|
.dark\:text-gray-300:is(.dark *) {
|
|
2379
2406
|
--tw-text-opacity: 1;
|
|
2380
2407
|
color: rgb(209 213 219 / var(--tw-text-opacity, 1));
|