@justanothermldude/mcp-exec 1.7.5 → 1.7.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/dist/bridge/port-cleanup.js +1 -1
- package/dist/bridge/server.d.ts +1 -1
- package/dist/bridge/server.js +1 -1
- package/dist/codegen/module-resolver.d.ts +1 -1
- package/dist/codegen/module-resolver.js +1 -1
- package/dist/codegen/wrapper-generator.d.ts +1 -1
- package/dist/codegen/wrapper-generator.js +2 -1
- package/dist/index.js +10 -9
- package/dist/server.d.ts +1 -1
- package/dist/tools/execute-with-wrappers.d.ts +1 -1
- package/dist/tools/execute-with-wrappers.js +1 -1
- package/dist/tools/get-tool-schema.d.ts +1 -1
- package/dist/tools/list-servers.js +1 -1
- package/dist/tools/tool-catalog.js +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Orphan process cleanup (PPID=1) is handled by cleanupOrphanedProcesses in core.
|
|
4
4
|
*/
|
|
5
5
|
import { execSync } from 'child_process';
|
|
6
|
-
import { isOrphanedProcess } from '@justanothermldude/
|
|
6
|
+
import { isOrphanedProcess } from '@justanothermldude/mcp-exec-core';
|
|
7
7
|
/**
|
|
8
8
|
* Check if a process is an mcp-exec process by examining its command line
|
|
9
9
|
*/
|
package/dist/bridge/server.d.ts
CHANGED
package/dist/bridge/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createServer } from 'http';
|
|
2
2
|
import getPort from 'get-port';
|
|
3
|
-
import { getServerConfig, listServers } from '@justanothermldude/
|
|
3
|
+
import { getServerConfig, listServers } from '@justanothermldude/mcp-exec-core';
|
|
4
4
|
import { cleanupStaleProcess } from './port-cleanup.js';
|
|
5
5
|
const DEFAULT_PORT = 3000;
|
|
6
6
|
const DEFAULT_HOST = '127.0.0.1';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Generates and caches TypeScript wrappers, enabling import from
|
|
4
4
|
* ./servers/<name>/<tool>.ts paths.
|
|
5
5
|
*/
|
|
6
|
-
import type { ToolDefinition, ServerManifest } from '@justanothermldude/
|
|
6
|
+
import type { ToolDefinition, ServerManifest } from '@justanothermldude/mcp-exec-core';
|
|
7
7
|
/**
|
|
8
8
|
* Virtual module resolver that maintains a cache of generated TypeScript
|
|
9
9
|
* wrappers for MCP tools, enabling import from ./servers/<name>/<tool>.ts paths.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Generates and caches TypeScript wrappers, enabling import from
|
|
4
4
|
* ./servers/<name>/<tool>.ts paths.
|
|
5
5
|
*/
|
|
6
|
-
import { loadServerManifest } from '@justanothermldude/
|
|
6
|
+
import { loadServerManifest } from '@justanothermldude/mcp-exec-core';
|
|
7
7
|
import { generateToolWrapper } from './wrapper-generator.js';
|
|
8
8
|
/**
|
|
9
9
|
* Sanitize a tool name to create a valid filename
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* TypeScript wrapper generator for MCP tools.
|
|
3
3
|
* Generates type-safe wrapper functions that call bridge endpoint.
|
|
4
4
|
*/
|
|
5
|
-
import type { ToolDefinition } from '@justanothermldude/
|
|
5
|
+
import type { ToolDefinition } from '@justanothermldude/mcp-exec-core';
|
|
6
6
|
/**
|
|
7
7
|
* Generate a recursive Proxy guard that warns on undefined field access on MCP responses.
|
|
8
8
|
* Injected into generated wrapper code. On missing field: logs available fields to stderr.
|
|
@@ -414,7 +414,8 @@ function generateMethodDefinition(tool, serverName, bridgePort) {
|
|
|
414
414
|
// Use escapeForTemplateLiteral to prevent backtick/`${}` injection in error messages
|
|
415
415
|
const tlSafe = (s) => escapeForTemplateLiteral(s);
|
|
416
416
|
lines.push(` if (!response.ok) {`);
|
|
417
|
-
lines.push(`
|
|
417
|
+
lines.push(` const errBody = await response.text().catch(() => '');`);
|
|
418
|
+
lines.push(` throw new Error(\`[${tlSafe(safeServerName)}.${tlSafe(safeToolName)}] HTTP \${response.status}: \${response.statusText}\${errBody ? ' — ' + errBody.slice(0, 500) : ''}\`);`);
|
|
418
419
|
lines.push(` }`);
|
|
419
420
|
lines.push(` const data = await response.json() as { success: boolean; content?: unknown; error?: string; isError?: boolean };`);
|
|
420
421
|
lines.push(` if (!data.success) {`);
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
10
10
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
11
11
|
|
|
12
12
|
// dist/tools/list-servers.js
|
|
13
|
-
import { listServers } from "@justanothermldude/
|
|
13
|
+
import { listServers } from "@justanothermldude/mcp-exec-core";
|
|
14
14
|
function escapeMarkdownCell(text) {
|
|
15
15
|
return text.replace(/\|/g, "\\|");
|
|
16
16
|
}
|
|
@@ -198,13 +198,13 @@ function isGetToolSchemaInput(args2) {
|
|
|
198
198
|
__name(isGetToolSchemaInput, "isGetToolSchemaInput");
|
|
199
199
|
|
|
200
200
|
// dist/tools/execute-with-wrappers.js
|
|
201
|
-
import { listServers as listServers4 } from "@justanothermldude/
|
|
201
|
+
import { listServers as listServers4 } from "@justanothermldude/mcp-exec-core";
|
|
202
202
|
|
|
203
203
|
// dist/tools/tool-catalog.js
|
|
204
204
|
import { readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
205
205
|
import { join, dirname } from "path";
|
|
206
206
|
import { homedir } from "os";
|
|
207
|
-
import { listServers as listServers2 } from "@justanothermldude/
|
|
207
|
+
import { listServers as listServers2 } from "@justanothermldude/mcp-exec-core";
|
|
208
208
|
var CATALOG_PATH = join(homedir(), ".meta-mcp", "tool-catalog.json");
|
|
209
209
|
function compactTypeHint(propSchema) {
|
|
210
210
|
if (Array.isArray(propSchema.enum)) {
|
|
@@ -677,7 +677,8 @@ function generateMethodDefinition(tool, serverName, bridgePort) {
|
|
|
677
677
|
lines.push(` });`);
|
|
678
678
|
const tlSafe = /* @__PURE__ */ __name((s) => escapeForTemplateLiteral(s), "tlSafe");
|
|
679
679
|
lines.push(` if (!response.ok) {`);
|
|
680
|
-
lines.push(`
|
|
680
|
+
lines.push(` const errBody = await response.text().catch(() => '');`);
|
|
681
|
+
lines.push(` throw new Error(\`[${tlSafe(safeServerName)}.${tlSafe(safeToolName)}] HTTP \${response.status}: \${response.statusText}\${errBody ? ' \u2014 ' + errBody.slice(0, 500) : ''}\`);`);
|
|
681
682
|
lines.push(` }`);
|
|
682
683
|
lines.push(` const data = await response.json() as { success: boolean; content?: unknown; error?: string; isError?: boolean };`);
|
|
683
684
|
lines.push(` if (!data.success) {`);
|
|
@@ -849,7 +850,7 @@ function generateMcpDictionary(serverNames) {
|
|
|
849
850
|
__name(generateMcpDictionary, "generateMcpDictionary");
|
|
850
851
|
|
|
851
852
|
// dist/codegen/module-resolver.js
|
|
852
|
-
import { loadServerManifest } from "@justanothermldude/
|
|
853
|
+
import { loadServerManifest } from "@justanothermldude/mcp-exec-core";
|
|
853
854
|
function sanitizeFileName(name) {
|
|
854
855
|
return name.replace(/[^a-zA-Z0-9_-]/g, "_").toLowerCase();
|
|
855
856
|
}
|
|
@@ -1229,11 +1230,11 @@ globalThis.mcp = {
|
|
|
1229
1230
|
// dist/bridge/server.js
|
|
1230
1231
|
import { createServer } from "http";
|
|
1231
1232
|
import getPort from "get-port";
|
|
1232
|
-
import { getServerConfig, listServers as listServers3 } from "@justanothermldude/
|
|
1233
|
+
import { getServerConfig, listServers as listServers3 } from "@justanothermldude/mcp-exec-core";
|
|
1233
1234
|
|
|
1234
1235
|
// dist/bridge/port-cleanup.js
|
|
1235
1236
|
import { execSync } from "child_process";
|
|
1236
|
-
import { isOrphanedProcess } from "@justanothermldude/
|
|
1237
|
+
import { isOrphanedProcess } from "@justanothermldude/mcp-exec-core";
|
|
1237
1238
|
function isMcpExecProcess(pid) {
|
|
1238
1239
|
try {
|
|
1239
1240
|
const cmdline = execSync(`ps -p ${pid} -o command=`, { encoding: "utf8" }).trim();
|
|
@@ -1999,9 +2000,9 @@ function createMcpExecServer(pool, config = {}) {
|
|
|
1999
2000
|
__name(createMcpExecServer, "createMcpExecServer");
|
|
2000
2001
|
|
|
2001
2002
|
// dist/index.js
|
|
2002
|
-
import { ServerPool, createConnection, getServerConfig as getServerConfig2, loadServerManifest as loadServerManifest2, cleanupOrphanedProcesses } from "@justanothermldude/
|
|
2003
|
+
import { ServerPool, createConnection, getServerConfig as getServerConfig2, loadServerManifest as loadServerManifest2, cleanupOrphanedProcesses } from "@justanothermldude/mcp-exec-core";
|
|
2003
2004
|
var APP_NAME = "mcp-exec";
|
|
2004
|
-
var VERSION2 = "1.7.
|
|
2005
|
+
var VERSION2 = "1.7.7";
|
|
2005
2006
|
var defaultExecutor = null;
|
|
2006
2007
|
function getDefaultExecutor() {
|
|
2007
2008
|
if (!defaultExecutor) {
|
package/dist/server.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
6
|
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
-
import type { ServerPool } from '@justanothermldude/
|
|
7
|
+
import type { ServerPool } from '@justanothermldude/mcp-exec-core';
|
|
8
8
|
import { type ExecuteWithWrappersHandlerConfig } from './tools/index.js';
|
|
9
9
|
interface CallToolParams {
|
|
10
10
|
name: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* execute_code_with_wrappers MCP tool handler
|
|
3
3
|
* Executes code with auto-generated typed wrappers for specified MCP servers
|
|
4
4
|
*/
|
|
5
|
-
import type { ServerPool } from '@justanothermldude/
|
|
5
|
+
import type { ServerPool } from '@justanothermldude/mcp-exec-core';
|
|
6
6
|
import { type SandboxExecutorConfig } from '../sandbox/index.js';
|
|
7
7
|
import { type MCPBridgeConfig } from '../bridge/index.js';
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { listServers } from '@justanothermldude/
|
|
1
|
+
import { listServers } from '@justanothermldude/mcp-exec-core';
|
|
2
2
|
import { generateServerModule, generateMcpDictionaryFromMap, generateFieldGuard, sanitizeIdentifier } from '../codegen/index.js';
|
|
3
3
|
import { SandboxExecutor } from '../sandbox/index.js';
|
|
4
4
|
import { MCPBridge } from '../bridge/index.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* get_mcp_tool_schema MCP tool handler
|
|
3
3
|
* Fetches the schema for a specific MCP tool from a server
|
|
4
4
|
*/
|
|
5
|
-
import { ServerPool } from '@justanothermldude/
|
|
5
|
+
import { ServerPool } from '@justanothermldude/mcp-exec-core';
|
|
6
6
|
/**
|
|
7
7
|
* Input type for get_mcp_tool_schema tool
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* list_available_mcp_servers MCP tool handler
|
|
3
3
|
* Lists all available MCP servers with optional filtering
|
|
4
4
|
*/
|
|
5
|
-
import { listServers } from '@justanothermldude/
|
|
5
|
+
import { listServers } from '@justanothermldude/mcp-exec-core';
|
|
6
6
|
/**
|
|
7
7
|
* Escapes pipe characters in text for safe inclusion in a markdown table cell.
|
|
8
8
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
10
10
|
import { join, dirname } from 'path';
|
|
11
11
|
import { homedir } from 'os';
|
|
12
|
-
import { listServers } from '@justanothermldude/
|
|
12
|
+
import { listServers } from '@justanothermldude/mcp-exec-core';
|
|
13
13
|
const CATALOG_PATH = join(homedir(), '.meta-mcp', 'tool-catalog.json');
|
|
14
14
|
/**
|
|
15
15
|
* Generate a compact type hint for a single JSON Schema property.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justanothermldude/mcp-exec",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "MCP execution utilities for sandboxed code execution with OS-level isolation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@anthropic-ai/sandbox-runtime": "^0.0.19",
|
|
24
|
-
"@justanothermldude/
|
|
24
|
+
"@justanothermldude/mcp-exec-core": "^0.1.9",
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
26
26
|
"esbuild": "^0.25.12",
|
|
27
27
|
"get-port": "^7.1.0"
|