@blockrun/runcode 2.2.3 → 2.2.5
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/agent/commands.js +1 -1
- package/dist/mcp/config.js +19 -5
- package/package.json +1 -1
package/dist/agent/commands.js
CHANGED
package/dist/mcp/config.js
CHANGED
|
@@ -6,24 +6,38 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
+
import { execSync } from 'node:child_process';
|
|
9
10
|
import { BLOCKRUN_DIR } from '../config.js';
|
|
10
11
|
const GLOBAL_MCP_FILE = path.join(BLOCKRUN_DIR, 'mcp.json');
|
|
11
12
|
/**
|
|
12
13
|
* Load MCP server configurations from global + project files.
|
|
13
14
|
* Project config overrides global for same server name.
|
|
14
15
|
*/
|
|
15
|
-
// Built-in MCP server: @blockrun/mcp
|
|
16
|
+
// Built-in MCP server: @blockrun/mcp available when globally installed
|
|
17
|
+
// Uses `blockrun-mcp` binary instead of `npx` for fast startup
|
|
16
18
|
const BUILTIN_MCP_SERVERS = {
|
|
17
19
|
blockrun: {
|
|
18
20
|
transport: 'stdio',
|
|
19
|
-
command: '
|
|
20
|
-
args: [
|
|
21
|
+
command: 'blockrun-mcp',
|
|
22
|
+
args: [],
|
|
21
23
|
label: 'BlockRun (built-in)',
|
|
22
24
|
},
|
|
23
25
|
};
|
|
26
|
+
function isCommandAvailable(cmd) {
|
|
27
|
+
try {
|
|
28
|
+
execSync(`which ${cmd}`, { stdio: 'pipe' });
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
24
35
|
export function loadMcpConfig(workDir) {
|
|
25
|
-
// Start with built-in servers
|
|
26
|
-
const servers = {
|
|
36
|
+
// Start with built-in servers (only if binary is available)
|
|
37
|
+
const servers = {};
|
|
38
|
+
if (isCommandAvailable('blockrun-mcp')) {
|
|
39
|
+
Object.assign(servers, BUILTIN_MCP_SERVERS);
|
|
40
|
+
}
|
|
27
41
|
// 1. Global config
|
|
28
42
|
try {
|
|
29
43
|
if (fs.existsSync(GLOBAL_MCP_FILE)) {
|