@luveo-tech/vark-mcp 0.1.0
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/LICENSE +21 -0
- package/README.md +31 -0
- package/dist/bridge.d.ts +83 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +106 -0
- package/dist/bridge.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Saturn Security
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# `@luveo-tech/vark-mcp`
|
|
2
|
+
|
|
3
|
+
**Zero-rewrite bridge that wraps Anthropic Model Context Protocol (MCP) tools
|
|
4
|
+
with [`@luveo-tech/vark`](https://www.npmjs.com/package/@luveo-tech/vark) protection.**
|
|
5
|
+
|
|
6
|
+
Raw MCP descriptors are left byte-identical; vark adds a guard pipeline, an
|
|
7
|
+
`execute()` hook, and a CTP signature:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { VarkRuntime } from '@luveo-tech/vark';
|
|
11
|
+
import { VarkMCPAdapter } from '@luveo-tech/vark-mcp';
|
|
12
|
+
|
|
13
|
+
const runtime = new VarkRuntime();
|
|
14
|
+
const adapter = new VarkMCPAdapter({
|
|
15
|
+
runtime, // share the host runtime: same anomaly window, same audit chain
|
|
16
|
+
executor: async (tool, args) => client.callTool(tool.name, args),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const tools = adapter.wrapTools(mcpTools, {
|
|
20
|
+
network: { allowedHosts: ['docs.example.com', '*.docs.example.com'] },
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
await tools[0].execute({ url: 'https://evil.example.net' }); // → CAPABILITY_VIOLATION
|
|
24
|
+
tools[0].check({ url: 'https://docs.example.com' }); // dry run, no server call
|
|
25
|
+
tools[0].compact; // CTP signature
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Full documentation in the
|
|
29
|
+
[monorepo](https://github.com/luveo-technologies/vark).
|
|
30
|
+
|
|
31
|
+
Node 20+ · ESM · MIT
|
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic MCP bridge — zero-rewrite protection for Model Context Protocol
|
|
3
|
+
* tools.
|
|
4
|
+
*
|
|
5
|
+
* MCP exposes *schema-only* tool descriptors (`{ name, description,
|
|
6
|
+
* inputSchema }`); the actual call is a `tools/call` request against the MCP
|
|
7
|
+
* server. The adapter keeps those descriptors byte-identical and adds three
|
|
8
|
+
* things around them:
|
|
9
|
+
*
|
|
10
|
+
* - a vark guard pipeline (capabilities + circuit breaker + timeout),
|
|
11
|
+
* - an `execute()` hook that performs the server call,
|
|
12
|
+
* - a CTP signature so the descriptor can be sent to the model in far fewer
|
|
13
|
+
* tokens than the original JSON Schema.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const adapter = new VarkMCPAdapter({ executor: async (tool, args) => client.callTool(tool.name, args) });
|
|
17
|
+
* const tools = adapter.wrapTools(mcpTools, { network: { allowedHosts: ['api.example.com'] } });
|
|
18
|
+
* await tools[0].execute({ url: 'https://evil.com' }); // → CAPABILITY_VIOLATION
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import { VarkRuntime } from '@luveo-tech/vark';
|
|
22
|
+
import type { CapabilityConfig, CompressionReport, ExecutionOptions, ExecutionContext, GuardResult, InspectionResult, ToolExecutionResult, VarkConfig } from '@luveo-tech/vark';
|
|
23
|
+
/** Shape of a raw MCP (or OpenAI-style function) tool descriptor. */
|
|
24
|
+
export interface MCPToolLike {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
inputSchema?: Record<string, any>;
|
|
28
|
+
/** OpenAI-style alias for `inputSchema`. */
|
|
29
|
+
schema?: Record<string, any>;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/** Performs the real `tools/call` round trip against the MCP server. */
|
|
33
|
+
export type MCPExecutor = (tool: MCPToolLike, args: any, context: ExecutionContext) => Promise<unknown>;
|
|
34
|
+
/** A raw MCP tool after vark has wrapped it. */
|
|
35
|
+
export interface WrappedMCPTool {
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
inputSchema: Record<string, any>;
|
|
39
|
+
/** Effective grants (defaults merged with the per-wrap defaults). */
|
|
40
|
+
capabilities: CapabilityConfig;
|
|
41
|
+
/** CTP signature for this tool. */
|
|
42
|
+
compact: string;
|
|
43
|
+
/** CTP signature plus token accounting. */
|
|
44
|
+
compression: CompressionReport;
|
|
45
|
+
/** Dry run: guards only, no server call. */
|
|
46
|
+
check: (args?: unknown, options?: ExecutionOptions) => GuardResult;
|
|
47
|
+
/** Guarded execution — runs the payload through vark, then the MCP server. */
|
|
48
|
+
execute: (args?: unknown, options?: ExecutionOptions) => Promise<ToolExecutionResult>;
|
|
49
|
+
}
|
|
50
|
+
export interface VarkMCPAdapterOptions {
|
|
51
|
+
config?: VarkConfig;
|
|
52
|
+
executor?: MCPExecutor;
|
|
53
|
+
/**
|
|
54
|
+
* Reuse an existing runtime. This is how you keep the MCP tools inside the
|
|
55
|
+
* host's anomaly-guard window and audit trail (shared sessions, one chain).
|
|
56
|
+
* When provided, `config` is ignored.
|
|
57
|
+
*/
|
|
58
|
+
runtime?: VarkRuntime;
|
|
59
|
+
}
|
|
60
|
+
export declare class VarkMCPAdapter {
|
|
61
|
+
#private;
|
|
62
|
+
/** The underlying runtime — exposed so hosts can register bespoke tools too. */
|
|
63
|
+
readonly runtime: VarkRuntime;
|
|
64
|
+
constructor(options?: VarkMCPAdapterOptions);
|
|
65
|
+
/**
|
|
66
|
+
* Wrap raw Anthropic MCP tools with vark protection.
|
|
67
|
+
*
|
|
68
|
+
* @param mcpTools raw `{ name, description, inputSchema }` descriptors
|
|
69
|
+
* @param defaultCapabilities grants applied to every wrapped tool
|
|
70
|
+
* @param executor per-call override for the MCP server round trip
|
|
71
|
+
*/
|
|
72
|
+
wrapTools(mcpTools: any[], defaultCapabilities?: CapabilityConfig, executor?: MCPExecutor): WrappedMCPTool[];
|
|
73
|
+
get(name: string): WrappedMCPTool | undefined;
|
|
74
|
+
list(): WrappedMCPTool[];
|
|
75
|
+
/** Payload-only inspection (circuit breaker) for a raw argument object. */
|
|
76
|
+
inspect(args: unknown): InspectionResult;
|
|
77
|
+
/** Unwrap every tool registered through this adapter. */
|
|
78
|
+
clear(): void;
|
|
79
|
+
}
|
|
80
|
+
/** Functional shorthand for `new VarkMCPAdapter(options).wrapTools(...)`. */
|
|
81
|
+
export declare function wrapMCPTools(mcpTools: any[], defaultCapabilities?: CapabilityConfig, options?: VarkMCPAdapterOptions): WrappedMCPTool[];
|
|
82
|
+
export type { CompressionReport, ExecutionOptions, ExecutionContext, GuardResult, InspectionResult };
|
|
83
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACX,MAAM,kBAAkB,CAAC;AAG1B,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,CACxB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,q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,EAAE,CAAC"}
|
package/dist/bridge.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic MCP bridge — zero-rewrite protection for Model Context Protocol
|
|
3
|
+
* tools.
|
|
4
|
+
*
|
|
5
|
+
* MCP exposes *schema-only* tool descriptors (`{ name, description,
|
|
6
|
+
* inputSchema }`); the actual call is a `tools/call` request against the MCP
|
|
7
|
+
* server. The adapter keeps those descriptors byte-identical and adds three
|
|
8
|
+
* things around them:
|
|
9
|
+
*
|
|
10
|
+
* - a vark guard pipeline (capabilities + circuit breaker + timeout),
|
|
11
|
+
* - an `execute()` hook that performs the server call,
|
|
12
|
+
* - a CTP signature so the descriptor can be sent to the model in far fewer
|
|
13
|
+
* tokens than the original JSON Schema.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const adapter = new VarkMCPAdapter({ executor: async (tool, args) => client.callTool(tool.name, args) });
|
|
17
|
+
* const tools = adapter.wrapTools(mcpTools, { network: { allowedHosts: ['api.example.com'] } });
|
|
18
|
+
* await tools[0].execute({ url: 'https://evil.com' }); // → CAPABILITY_VIOLATION
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import { VarkRuntime } from '@luveo-tech/vark';
|
|
22
|
+
import { VarkError } from '@luveo-tech/vark';
|
|
23
|
+
function normalizeTool(raw) {
|
|
24
|
+
if (!raw || typeof raw !== 'object')
|
|
25
|
+
throw new TypeError('MCP tool descriptor must be an object');
|
|
26
|
+
const tool = raw;
|
|
27
|
+
const name = typeof tool.name === 'string' ? tool.name.trim() : '';
|
|
28
|
+
if (!name)
|
|
29
|
+
throw new TypeError('MCP tool descriptor is missing "name"');
|
|
30
|
+
return tool;
|
|
31
|
+
}
|
|
32
|
+
export class VarkMCPAdapter {
|
|
33
|
+
/** The underlying runtime — exposed so hosts can register bespoke tools too. */
|
|
34
|
+
runtime;
|
|
35
|
+
#executor;
|
|
36
|
+
#tools = new Map();
|
|
37
|
+
constructor(options = {}) {
|
|
38
|
+
this.runtime = options.runtime ?? new VarkRuntime(options.config ?? {});
|
|
39
|
+
this.#executor = options.executor;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Wrap raw Anthropic MCP tools with vark protection.
|
|
43
|
+
*
|
|
44
|
+
* @param mcpTools raw `{ name, description, inputSchema }` descriptors
|
|
45
|
+
* @param defaultCapabilities grants applied to every wrapped tool
|
|
46
|
+
* @param executor per-call override for the MCP server round trip
|
|
47
|
+
*/
|
|
48
|
+
wrapTools(mcpTools, defaultCapabilities, executor) {
|
|
49
|
+
const dispatch = executor ?? this.#executor;
|
|
50
|
+
const wrapped = [];
|
|
51
|
+
for (const raw of Array.isArray(mcpTools) ? mcpTools : []) {
|
|
52
|
+
const tool = normalizeTool(raw);
|
|
53
|
+
if (this.#tools.has(tool.name)) {
|
|
54
|
+
throw new Error(`MCP tool "${tool.name}" is already wrapped`);
|
|
55
|
+
}
|
|
56
|
+
const inputSchema = tool.inputSchema ?? tool.schema ?? {};
|
|
57
|
+
const capabilities = { ...(defaultCapabilities ?? {}) };
|
|
58
|
+
const guard = this.runtime.tool({
|
|
59
|
+
name: tool.name,
|
|
60
|
+
description: tool.description ?? '',
|
|
61
|
+
schema: inputSchema,
|
|
62
|
+
capabilities,
|
|
63
|
+
run: async (args, context) => {
|
|
64
|
+
if (!dispatch) {
|
|
65
|
+
throw new VarkError('EXECUTION_ERROR', `MCP tool "${tool.name}" passed every guard, but no executor is bound to call the server`);
|
|
66
|
+
}
|
|
67
|
+
return dispatch(tool, args, context);
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
const entry = {
|
|
71
|
+
name: tool.name,
|
|
72
|
+
description: tool.description ?? '',
|
|
73
|
+
inputSchema,
|
|
74
|
+
capabilities: guard.capabilities,
|
|
75
|
+
compact: guard.compact,
|
|
76
|
+
compression: guard.compression,
|
|
77
|
+
check: (args, options) => this.runtime.check(tool.name, args, options),
|
|
78
|
+
execute: (args, options) => guard.execute(args, options),
|
|
79
|
+
};
|
|
80
|
+
this.#tools.set(entry.name, entry);
|
|
81
|
+
wrapped.push(entry);
|
|
82
|
+
}
|
|
83
|
+
return wrapped;
|
|
84
|
+
}
|
|
85
|
+
get(name) {
|
|
86
|
+
return this.#tools.get(name);
|
|
87
|
+
}
|
|
88
|
+
list() {
|
|
89
|
+
return [...this.#tools.values()];
|
|
90
|
+
}
|
|
91
|
+
/** Payload-only inspection (circuit breaker) for a raw argument object. */
|
|
92
|
+
inspect(args) {
|
|
93
|
+
return this.runtime.inspect(args);
|
|
94
|
+
}
|
|
95
|
+
/** Unwrap every tool registered through this adapter. */
|
|
96
|
+
clear() {
|
|
97
|
+
for (const name of this.#tools.keys())
|
|
98
|
+
this.runtime.unregister(name);
|
|
99
|
+
this.#tools.clear();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Functional shorthand for `new VarkMCPAdapter(options).wrapTools(...)`. */
|
|
103
|
+
export function wrapMCPTools(mcpTools, defaultCapabilities, options = {}) {
|
|
104
|
+
return new VarkMCPAdapter(options).wrapTools(mcpTools, defaultCapabilities);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAW/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA+C7C,SAAS,aAAa,CAAC,GAAY;IACjC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;IAClG,MAAM,IAAI,GAAG,GAAkB,CAAC;IAChC,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI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IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,2EAA2E;IAC3E,OAAO,CAAC,IAAa;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,yDAAyD;IACzD,KAAK;QACH,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;YAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF;AAED,6EAA6E;AAC7E,MAAM,UAAU,YAAY,CAC1B,QAAe,EACf,mBAAsC,EACtC,UAAiC,EAAE;IAEnC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@luveo-tech/vark-mcp` — zero-rewrite bridge between Anthropic Model Context
|
|
3
|
+
* Protocol tool descriptors and the vark guard pipeline.
|
|
4
|
+
*/
|
|
5
|
+
export { VarkMCPAdapter, wrapMCPTools } from './bridge.js';
|
|
6
|
+
export type { MCPExecutor, MCPToolLike, VarkMCPAdapterOptions, WrappedMCPTool, } from './bridge.js';
|
|
7
|
+
export type { ExecutionOptions } from './bridge.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,EACV,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@luveo-tech/vark-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zero-rewrite bridge that wraps Anthropic Model Context Protocol (MCP) tools with vark protection.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@luveo-tech/vark": "0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -p tsconfig.json",
|
|
27
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
28
|
+
}
|
|
29
|
+
}
|