@justanothermldude/mcp-exec 1.7.8 → 1.7.10
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 -1
- package/dist/index.js +9 -8
- package/dist/tools/execute-with-wrappers.js +6 -4
- package/dist/tools/list-servers.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -336,7 +336,7 @@ mcp-exec maintains a disk-cached tool catalog at `~/.meta-mcp/tool-catalog.json`
|
|
|
336
336
|
2. **Every session after:** On startup, mcp-exec reads the catalog and embeds the full API reference in the `execute_code_with_wrappers` tool description. The agent sees all tool names and parameter signatures before writing code:
|
|
337
337
|
```
|
|
338
338
|
Tool API Reference:
|
|
339
|
-
|
|
339
|
+
example-server: tool_one({args, config?}), tool_two({args, config?}), ...
|
|
340
340
|
```
|
|
341
341
|
|
|
342
342
|
3. **Self-maintaining:**
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,7 @@ function createListServersHandler() {
|
|
|
77
77
|
const escapedTags = escapeMarkdownCell(tagsStr);
|
|
78
78
|
return `| \`${escapedName}\` | ${escapedDesc} | ${escapedTags} |`;
|
|
79
79
|
});
|
|
80
|
-
const table = "## Available MCP Servers\n\n| Name | Description | Tags |\n|------|-------------|------|\n" + rows.join("\n") + '\n\nTo use a server, pass its exact name in the `wrappers` array of `execute_code_with_wrappers`.\nExample: `wrappers: ["
|
|
80
|
+
const table = "## Available MCP Servers\n\n| Name | Description | Tags |\n|------|-------------|------|\n" + rows.join("\n") + '\n\nTo use a server, pass its exact name in the `wrappers` array of `execute_code_with_wrappers`.\nExample: `wrappers: ["example-server"]`\n\nTo see tools on a server: `get_mcp_tool_schema({ server: "example-server" })`';
|
|
81
81
|
return {
|
|
82
82
|
content: [{ type: "text", text: table }],
|
|
83
83
|
isError: false
|
|
@@ -198,7 +198,7 @@ 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/mcp-exec-core";
|
|
201
|
+
import { listServers as listServers4, getServerConfig as getServerConfig2 } from "@justanothermldude/mcp-exec-core";
|
|
202
202
|
|
|
203
203
|
// dist/tools/tool-catalog.js
|
|
204
204
|
import { readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
@@ -1774,7 +1774,6 @@ function createExecuteWithWrappersHandler(pool, config = {}) {
|
|
|
1774
1774
|
}
|
|
1775
1775
|
__name(stopActiveBridge, "stopActiveBridge");
|
|
1776
1776
|
async function executeWithWrappersHandler(args2) {
|
|
1777
|
-
const TOOLS_FETCH_TIMEOUT_MS = 15e3;
|
|
1778
1777
|
const { code, wrappers, timeout_ms = DEFAULT_TIMEOUT_MS } = args2;
|
|
1779
1778
|
if (!code || typeof code !== "string") {
|
|
1780
1779
|
return {
|
|
@@ -1816,10 +1815,12 @@ function createExecuteWithWrappersHandler(pool, config = {}) {
|
|
|
1816
1815
|
try {
|
|
1817
1816
|
connection = await pool.getConnection(serverName);
|
|
1818
1817
|
const conn = connection;
|
|
1818
|
+
const serverConfig = getServerConfig2(serverName);
|
|
1819
|
+
const toolsFetchTimeoutMs = serverConfig?.timeout ?? 15e3;
|
|
1819
1820
|
const tools = await new Promise((resolve, reject) => {
|
|
1820
1821
|
const timeoutHandle = setTimeout(() => {
|
|
1821
|
-
reject(new Error(`Timed out fetching tools from server '${serverName}' after ${
|
|
1822
|
-
},
|
|
1822
|
+
reject(new Error(`Timed out fetching tools from server '${serverName}' after ${toolsFetchTimeoutMs}ms`));
|
|
1823
|
+
}, toolsFetchTimeoutMs);
|
|
1823
1824
|
conn.getTools().then((result2) => {
|
|
1824
1825
|
clearTimeout(timeoutHandle);
|
|
1825
1826
|
resolve(result2);
|
|
@@ -2000,9 +2001,9 @@ function createMcpExecServer(pool, config = {}) {
|
|
|
2000
2001
|
__name(createMcpExecServer, "createMcpExecServer");
|
|
2001
2002
|
|
|
2002
2003
|
// dist/index.js
|
|
2003
|
-
import { ServerPool, createConnection, getServerConfig as
|
|
2004
|
+
import { ServerPool, createConnection, getServerConfig as getServerConfig3, loadServerManifest as loadServerManifest2, cleanupOrphanedProcesses } from "@justanothermldude/mcp-exec-core";
|
|
2004
2005
|
var APP_NAME = "mcp-exec";
|
|
2005
|
-
var VERSION2 = "1.7.
|
|
2006
|
+
var VERSION2 = "1.7.10";
|
|
2006
2007
|
var defaultExecutor = null;
|
|
2007
2008
|
function getDefaultExecutor() {
|
|
2008
2009
|
if (!defaultExecutor) {
|
|
@@ -2056,7 +2057,7 @@ async function main() {
|
|
|
2056
2057
|
}
|
|
2057
2058
|
loadServerManifest2();
|
|
2058
2059
|
const connectionFactory = /* @__PURE__ */ __name(async (serverId) => {
|
|
2059
|
-
const config =
|
|
2060
|
+
const config = getServerConfig3(serverId);
|
|
2060
2061
|
if (!config) {
|
|
2061
2062
|
throw new Error(`Server config not found: ${serverId}`);
|
|
2062
2063
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { listServers } from '@justanothermldude/mcp-exec-core';
|
|
1
|
+
import { listServers, getServerConfig } 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';
|
|
@@ -200,7 +200,6 @@ export function createExecuteWithWrappersHandler(pool, config = {}) {
|
|
|
200
200
|
* Execute code with wrappers handler - generates wrappers, composes code, and executes
|
|
201
201
|
*/
|
|
202
202
|
async function executeWithWrappersHandler(args) {
|
|
203
|
-
const TOOLS_FETCH_TIMEOUT_MS = 15000;
|
|
204
203
|
const { code, wrappers, timeout_ms = DEFAULT_TIMEOUT_MS } = args;
|
|
205
204
|
// Validate input
|
|
206
205
|
if (!code || typeof code !== 'string') {
|
|
@@ -248,11 +247,14 @@ export function createExecuteWithWrappersHandler(pool, config = {}) {
|
|
|
248
247
|
// Get connection for this server
|
|
249
248
|
connection = await pool.getConnection(serverName);
|
|
250
249
|
const conn = connection;
|
|
250
|
+
// Get per-server timeout from config (default to 15s)
|
|
251
|
+
const serverConfig = getServerConfig(serverName);
|
|
252
|
+
const toolsFetchTimeoutMs = serverConfig?.timeout ?? 15000;
|
|
251
253
|
// Fetch tools from the server with proper timeout cleanup
|
|
252
254
|
const tools = await new Promise((resolve, reject) => {
|
|
253
255
|
const timeoutHandle = setTimeout(() => {
|
|
254
|
-
reject(new Error(`Timed out fetching tools from server '${serverName}' after ${
|
|
255
|
-
},
|
|
256
|
+
reject(new Error(`Timed out fetching tools from server '${serverName}' after ${toolsFetchTimeoutMs}ms`));
|
|
257
|
+
}, toolsFetchTimeoutMs);
|
|
256
258
|
conn.getTools().then((result) => { clearTimeout(timeoutHandle); resolve(result); }, (err) => { clearTimeout(timeoutHandle); reject(err); });
|
|
257
259
|
});
|
|
258
260
|
// Cache tools to disk for catalog embedding in tool description
|
|
@@ -101,8 +101,8 @@ export function createListServersHandler() {
|
|
|
101
101
|
rows.join('\n') +
|
|
102
102
|
'\n\n' +
|
|
103
103
|
'To use a server, pass its exact name in the `wrappers` array of `execute_code_with_wrappers`.\n' +
|
|
104
|
-
'Example: `wrappers: ["
|
|
105
|
-
'To see tools on a server: `get_mcp_tool_schema({ server: "
|
|
104
|
+
'Example: `wrappers: ["example-server"]`\n\n' +
|
|
105
|
+
'To see tools on a server: `get_mcp_tool_schema({ server: "example-server" })`';
|
|
106
106
|
return {
|
|
107
107
|
content: [{ type: 'text', text: table }],
|
|
108
108
|
isError: false,
|