@mcpjam/inspector 0.3.5 → 0.3.7
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 +1 -0
- package/cli/build/cli.js +52 -16
- package/client/dist/assets/{OAuthCallback-CaYMoLGO.js → OAuthCallback-CEBEd-Vt.js} +2 -1
- package/client/dist/assets/{OAuthDebugCallback-CBFeYzo9.js → OAuthDebugCallback-D-raj6yP.js} +1 -1
- package/client/dist/assets/{index-DQYTYcqe.js → index-BG-3VNs4.js} +1505 -976
- package/client/dist/assets/{index-DegSReJM.css → index-CWDemo1t.css} +65 -3
- package/client/dist/index.html +2 -2
- package/package.json +1 -1
- package/server/build/database/DatabaseManager.js +108 -0
- package/server/build/database/index.js +8 -0
- package/server/build/database/routes.js +86 -0
- package/server/build/database/types.js +27 -0
- package/server/build/database/utils.js +86 -0
- package/server/build/index.js +109 -131
- package/server/build/shared/MCPProxyService.js +221 -0
- package/server/build/shared/TransportFactory.js +130 -0
- package/server/build/shared/index.js +4 -0
- package/server/build/shared/types.js +1 -0
- package/server/build/shared/utils.js +27 -0
- package/server/build/test-server.js +145 -0
- package/server/build/testing/HealthCheck.js +42 -0
- package/server/build/testing/TestExecutor.js +240 -0
- package/server/build/testing/TestRunner.js +198 -0
- package/server/build/testing/TestServer.js +440 -0
- package/server/build/testing/types.js +1 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/@mcpjam/inspector)
|
|
16
16
|
[](https://www.npmjs.com/package/@mcpjam/inspector)
|
|
17
|
+
[](https://hub.docker.com/r/mcpjam/mcp-inspector)
|
|
17
18
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
18
19
|
[](https://nodejs.org/)
|
|
19
20
|
[](https://www.typescriptlang.org/)
|
package/cli/build/cli.js
CHANGED
|
@@ -60,6 +60,9 @@ async function runWebClient(args) {
|
|
|
60
60
|
...process.env,
|
|
61
61
|
PORT: SERVER_PORT,
|
|
62
62
|
MCP_ENV_VARS: JSON.stringify(args.envArgs),
|
|
63
|
+
MCP_SERVER_CONFIGS: args.serverConfigs
|
|
64
|
+
? JSON.stringify(args.serverConfigs)
|
|
65
|
+
: undefined,
|
|
63
66
|
},
|
|
64
67
|
signal: abort.signal,
|
|
65
68
|
echoOutput: true,
|
|
@@ -136,6 +139,28 @@ function loadConfigFile(configPath, serverName) {
|
|
|
136
139
|
throw err;
|
|
137
140
|
}
|
|
138
141
|
}
|
|
142
|
+
function loadAllServersFromConfig(configPath) {
|
|
143
|
+
try {
|
|
144
|
+
const resolvedConfigPath = path.isAbsolute(configPath)
|
|
145
|
+
? configPath
|
|
146
|
+
: path.resolve(process.cwd(), configPath);
|
|
147
|
+
if (!fs.existsSync(resolvedConfigPath)) {
|
|
148
|
+
throw new Error(`Config file not found: ${resolvedConfigPath}`);
|
|
149
|
+
}
|
|
150
|
+
const configContent = fs.readFileSync(resolvedConfigPath, "utf8");
|
|
151
|
+
const parsedConfig = JSON.parse(configContent);
|
|
152
|
+
if (!parsedConfig.mcpServers) {
|
|
153
|
+
throw new Error("No 'mcpServers' section found in config file");
|
|
154
|
+
}
|
|
155
|
+
return parsedConfig.mcpServers;
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
if (err instanceof SyntaxError) {
|
|
159
|
+
throw new Error(`Invalid JSON in config file: ${err.message}`);
|
|
160
|
+
}
|
|
161
|
+
throw err;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
139
164
|
function parseKeyValuePair(value, previous = {}) {
|
|
140
165
|
const parts = value.split("=");
|
|
141
166
|
const key = parts[0];
|
|
@@ -168,22 +193,33 @@ function parseArgs() {
|
|
|
168
193
|
const remainingArgs = program.args;
|
|
169
194
|
// Add back any arguments that came after --
|
|
170
195
|
const finalArgs = [...remainingArgs, ...postArgs];
|
|
171
|
-
// Validate
|
|
172
|
-
if (
|
|
173
|
-
(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
196
|
+
// Validate server option
|
|
197
|
+
if (!options.config && options.server) {
|
|
198
|
+
throw new Error("--server option requires --config to be specified.");
|
|
199
|
+
}
|
|
200
|
+
// If config file is specified
|
|
201
|
+
if (options.config) {
|
|
202
|
+
if (options.server) {
|
|
203
|
+
// Single server mode: load specific server from config
|
|
204
|
+
const config = loadConfigFile(options.config, options.server);
|
|
205
|
+
return {
|
|
206
|
+
command: config.command,
|
|
207
|
+
args: [...(config.args || []), ...finalArgs],
|
|
208
|
+
envArgs: { ...(config.env || {}), ...(options.e || {}) },
|
|
209
|
+
cli: options.cli || false,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
// Multiple servers mode: load all servers from config
|
|
214
|
+
const serverConfigs = loadAllServersFromConfig(options.config);
|
|
215
|
+
return {
|
|
216
|
+
command: "", // No single command in multi-server mode
|
|
217
|
+
args: finalArgs,
|
|
218
|
+
envArgs: options.e || {},
|
|
219
|
+
cli: options.cli || false,
|
|
220
|
+
serverConfigs,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
187
223
|
}
|
|
188
224
|
// Otherwise use command line arguments
|
|
189
225
|
const command = finalArgs[0] || "";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription,
|
|
1
|
+
import { u as useToast, r as reactExports, S as SESSION_KEYS, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, I as InspectorOAuthClientProvider, a as auth } from "./index-BG-3VNs4.js";
|
|
2
2
|
const OAuthCallback = ({ onConnect }) => {
|
|
3
3
|
const { toast } = useToast();
|
|
4
4
|
const hasProcessedRef = reactExports.useRef(false);
|
|
@@ -45,6 +45,7 @@ const OAuthCallback = ({ onConnect }) => {
|
|
|
45
45
|
onConnect(serverUrl);
|
|
46
46
|
};
|
|
47
47
|
handleCallback().finally(() => {
|
|
48
|
+
sessionStorage.removeItem(SESSION_KEYS.TRANSPORT_TYPE);
|
|
48
49
|
window.history.replaceState({}, document.title, "/");
|
|
49
50
|
});
|
|
50
51
|
}, [toast, onConnect]);
|
package/client/dist/assets/{OAuthDebugCallback-CBFeYzo9.js → OAuthDebugCallback-D-raj6yP.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-BG-3VNs4.js";
|
|
2
2
|
const OAuthDebugCallback = ({ onConnect }) => {
|
|
3
3
|
reactExports.useEffect(() => {
|
|
4
4
|
let isProcessed = false;
|