@mcpspend/proxy
Advanced tools
+1
-1
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
| const init_js_1 = require("./init.js"); | ||
| const VERSION = '0.2.1'; | ||
| const VERSION = '0.2.2'; | ||
| const HELP = `mcpspend — observability proxy for MCP servers (v${VERSION}) | ||
@@ -10,0 +10,0 @@ |
@@ -30,2 +30,3 @@ export interface McpServerEntry { | ||
| } | ||
| export declare function isAlreadyWrapped(entry: McpServerEntry): boolean; | ||
| export interface WrapOptions { | ||
@@ -32,0 +33,0 @@ apiKey?: string; |
+12
-2
@@ -7,2 +7,3 @@ "use strict"; | ||
| exports.writeClientConfig = writeClientConfig; | ||
| exports.isAlreadyWrapped = isAlreadyWrapped; | ||
| exports.wrapEntry = wrapEntry; | ||
@@ -115,2 +116,11 @@ exports.unwrapEntry = unwrapEntry; | ||
| const PROXY_PKG = '@mcpspend/proxy'; | ||
| // True if `pkgArg` is some form of @mcpspend/proxy: bare, @version, or @tag. | ||
| // '@mcpspend/proxy', '@mcpspend/proxy@0.2.1', '@mcpspend/proxy@latest' → true | ||
| function isProxyPackageArg(pkgArg) { | ||
| if (!pkgArg) | ||
| return false; | ||
| if (pkgArg === PROXY_PKG) | ||
| return true; | ||
| return pkgArg.startsWith(PROXY_PKG + '@'); | ||
| } | ||
| function isAlreadyWrapped(entry) { | ||
@@ -123,6 +133,6 @@ const cmd = (entry.command || '').toLowerCase(); | ||
| return true; | ||
| // Shape B: `npx [-y] @mcpspend/proxy wrap ...` | ||
| // Shape B: `npx [-y] @mcpspend/proxy[@version] wrap ...` | ||
| if (NPX_BIN_NAMES.has(base)) { | ||
| const skipFlag = args[0] === '-y' || args[0] === '--yes' ? 1 : 0; | ||
| if (args[skipFlag] === PROXY_PKG && args[skipFlag + 1] === 'wrap') | ||
| if (isProxyPackageArg(args[skipFlag]) && args[skipFlag + 1] === 'wrap') | ||
| return true; | ||
@@ -129,0 +139,0 @@ } |
+1
-1
@@ -5,5 +5,5 @@ export { loadConfig, saveConfig } from './config.js'; | ||
| export type { ToolCallEvent } from './ingest.js'; | ||
| export { CLIENTS, discoverClients, readClientConfig, writeClientConfig, wrapAllServers, unwrapAllServers, wrapEntry, unwrapEntry, } from './clients.js'; | ||
| export { CLIENTS, discoverClients, readClientConfig, writeClientConfig, wrapAllServers, unwrapAllServers, wrapEntry, unwrapEntry, isAlreadyWrapped, } from './clients.js'; | ||
| export type { ClientDefinition, ClientConfig, DiscoveredClient, McpServerEntry, WrapResult, WrapOptions, } from './clients.js'; | ||
| export { runInit, runDoctor, formatReport, formatDoctor } from './init.js'; | ||
| export type { InitOptions, InitReport, ClientReport, DoctorReport } from './init.js'; |
+2
-1
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.formatDoctor = exports.formatReport = exports.runDoctor = exports.runInit = exports.unwrapEntry = exports.wrapEntry = exports.unwrapAllServers = exports.wrapAllServers = exports.writeClientConfig = exports.readClientConfig = exports.discoverClients = exports.CLIENTS = exports.runProxy = exports.saveConfig = exports.loadConfig = void 0; | ||
| exports.formatDoctor = exports.formatReport = exports.runDoctor = exports.runInit = exports.isAlreadyWrapped = exports.unwrapEntry = exports.wrapEntry = exports.unwrapAllServers = exports.wrapAllServers = exports.writeClientConfig = exports.readClientConfig = exports.discoverClients = exports.CLIENTS = exports.runProxy = exports.saveConfig = exports.loadConfig = void 0; | ||
| var config_js_1 = require("./config.js"); | ||
@@ -19,2 +19,3 @@ Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_js_1.loadConfig; } }); | ||
| Object.defineProperty(exports, "unwrapEntry", { enumerable: true, get: function () { return clients_js_1.unwrapEntry; } }); | ||
| Object.defineProperty(exports, "isAlreadyWrapped", { enumerable: true, get: function () { return clients_js_1.isAlreadyWrapped; } }); | ||
| var init_js_1 = require("./init.js"); | ||
@@ -21,0 +22,0 @@ Object.defineProperty(exports, "runInit", { enumerable: true, get: function () { return init_js_1.runInit; } }); |
+2
-5
@@ -159,7 +159,4 @@ "use strict"; | ||
| for (const s of Object.values(servers)) { | ||
| const cmdBase = (s.command || '').toLowerCase().split(/[\\/]/).pop() || ''; | ||
| if (cmdBase === 'mcpspend' || cmdBase === 'mcpspend.cmd' || cmdBase === 'mcpspend.exe') { | ||
| if ((s.args || [])[0] === 'wrap') | ||
| wrappedCount++; | ||
| } | ||
| if (s && typeof s.command === 'string' && (0, clients_js_1.isAlreadyWrapped)(s)) | ||
| wrappedCount++; | ||
| } | ||
@@ -166,0 +163,0 @@ } |
+1
-1
| { | ||
| "name": "@mcpspend/proxy", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "description": "Transparent proxy CLI for MCP servers — tracks tool calls, latency, and cost via MCPSpend.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
49575
0.96%1160
0.78%17
-5.56%