palaryn 0.1.0 → 0.3.2
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 +243 -588
- package/dist/sdk/typescript/src/client.js +2 -2
- package/dist/sdk/typescript/src/client.js.map +1 -1
- package/dist/src/anomaly/detector.d.ts +7 -4
- package/dist/src/anomaly/detector.d.ts.map +1 -1
- package/dist/src/anomaly/detector.js +22 -12
- package/dist/src/anomaly/detector.js.map +1 -1
- package/dist/src/audit/logger.d.ts +10 -0
- package/dist/src/audit/logger.d.ts.map +1 -1
- package/dist/src/audit/logger.js +52 -38
- package/dist/src/audit/logger.js.map +1 -1
- package/dist/src/auth/routes.d.ts.map +1 -1
- package/dist/src/auth/routes.js +35 -0
- package/dist/src/auth/routes.js.map +1 -1
- package/dist/src/budget/manager.d.ts +5 -0
- package/dist/src/budget/manager.d.ts.map +1 -1
- package/dist/src/budget/manager.js +32 -0
- package/dist/src/budget/manager.js.map +1 -1
- package/dist/src/budget/model-pricing.d.ts +20 -0
- package/dist/src/budget/model-pricing.d.ts.map +1 -0
- package/dist/src/budget/model-pricing.js +107 -0
- package/dist/src/budget/model-pricing.js.map +1 -0
- package/dist/src/budget/usage-extractor.d.ts +3 -1
- package/dist/src/budget/usage-extractor.d.ts.map +1 -1
- package/dist/src/budget/usage-extractor.js +47 -3
- package/dist/src/budget/usage-extractor.js.map +1 -1
- package/dist/src/config/defaults.d.ts.map +1 -1
- package/dist/src/config/defaults.js +65 -13
- package/dist/src/config/defaults.js.map +1 -1
- package/dist/src/dlp/tool-patterns.d.ts +7 -0
- package/dist/src/dlp/tool-patterns.d.ts.map +1 -0
- package/dist/src/dlp/tool-patterns.js +34 -0
- package/dist/src/dlp/tool-patterns.js.map +1 -0
- package/dist/src/executor/filesystem-executor.d.ts +28 -0
- package/dist/src/executor/filesystem-executor.d.ts.map +1 -0
- package/dist/src/executor/filesystem-executor.js +192 -0
- package/dist/src/executor/filesystem-executor.js.map +1 -0
- package/dist/src/executor/http-executor.d.ts.map +1 -1
- package/dist/src/executor/http-executor.js +22 -2
- package/dist/src/executor/http-executor.js.map +1 -1
- package/dist/src/executor/index.d.ts +4 -0
- package/dist/src/executor/index.d.ts.map +1 -1
- package/dist/src/executor/index.js +9 -1
- package/dist/src/executor/index.js.map +1 -1
- package/dist/src/executor/shell-executor.d.ts +22 -0
- package/dist/src/executor/shell-executor.d.ts.map +1 -0
- package/dist/src/executor/shell-executor.js +119 -0
- package/dist/src/executor/shell-executor.js.map +1 -0
- package/dist/src/executor/sql-executor.d.ts +29 -0
- package/dist/src/executor/sql-executor.d.ts.map +1 -0
- package/dist/src/executor/sql-executor.js +114 -0
- package/dist/src/executor/sql-executor.js.map +1 -0
- package/dist/src/executor/websocket-executor.d.ts +26 -0
- package/dist/src/executor/websocket-executor.d.ts.map +1 -0
- package/dist/src/executor/websocket-executor.js +205 -0
- package/dist/src/executor/websocket-executor.js.map +1 -0
- package/dist/src/interceptor/index.d.ts +2 -0
- package/dist/src/interceptor/index.d.ts.map +1 -0
- package/dist/src/interceptor/index.js +6 -0
- package/dist/src/interceptor/index.js.map +1 -0
- package/dist/src/interceptor/provider-interceptor.d.ts +36 -0
- package/dist/src/interceptor/provider-interceptor.d.ts.map +1 -0
- package/dist/src/interceptor/provider-interceptor.js +302 -0
- package/dist/src/interceptor/provider-interceptor.js.map +1 -0
- package/dist/src/mcp/auth-verifier.d.ts.map +1 -1
- package/dist/src/mcp/auth-verifier.js +3 -2
- package/dist/src/mcp/auth-verifier.js.map +1 -1
- package/dist/src/mcp/bridge.d.ts +14 -10
- package/dist/src/mcp/bridge.d.ts.map +1 -1
- package/dist/src/mcp/bridge.js +51 -227
- package/dist/src/mcp/bridge.js.map +1 -1
- package/dist/src/mcp/http-transport.d.ts +2 -0
- package/dist/src/mcp/http-transport.d.ts.map +1 -1
- package/dist/src/mcp/http-transport.js +117 -66
- package/dist/src/mcp/http-transport.js.map +1 -1
- package/dist/src/mcp/internal-auth.d.ts +13 -0
- package/dist/src/mcp/internal-auth.d.ts.map +1 -0
- package/dist/src/mcp/internal-auth.js +12 -0
- package/dist/src/mcp/internal-auth.js.map +1 -0
- package/dist/src/mcp/tool-definitions.d.ts +41 -0
- package/dist/src/mcp/tool-definitions.d.ts.map +1 -0
- package/dist/src/mcp/tool-definitions.js +491 -0
- package/dist/src/mcp/tool-definitions.js.map +1 -0
- package/dist/src/middleware/auth.js.map +1 -1
- package/dist/src/middleware/session.js.map +1 -1
- package/dist/src/middleware/validate.d.ts +8 -0
- package/dist/src/middleware/validate.d.ts.map +1 -1
- package/dist/src/middleware/validate.js +45 -0
- package/dist/src/middleware/validate.js.map +1 -1
- package/dist/src/policy/engine.d.ts +4 -0
- package/dist/src/policy/engine.d.ts.map +1 -1
- package/dist/src/policy/engine.js +117 -0
- package/dist/src/policy/engine.js.map +1 -1
- package/dist/src/saas/routes.d.ts.map +1 -1
- package/dist/src/saas/routes.js +355 -22
- package/dist/src/saas/routes.js.map +1 -1
- package/dist/src/server/app.d.ts.map +1 -1
- package/dist/src/server/app.js +24 -3
- package/dist/src/server/app.js.map +1 -1
- package/dist/src/server/gateway.d.ts.map +1 -1
- package/dist/src/server/gateway.js +17 -0
- package/dist/src/server/gateway.js.map +1 -1
- package/dist/src/server/index.d.ts.map +1 -1
- package/dist/src/server/index.js +18 -0
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/storage/interfaces.d.ts +14 -3
- package/dist/src/storage/interfaces.d.ts.map +1 -1
- package/dist/src/storage/memory.d.ts +2 -0
- package/dist/src/storage/memory.d.ts.map +1 -1
- package/dist/src/storage/memory.js +6 -0
- package/dist/src/storage/memory.js.map +1 -1
- package/dist/src/storage/postgres.d.ts +5 -0
- package/dist/src/storage/postgres.d.ts.map +1 -1
- package/dist/src/storage/postgres.js +16 -0
- package/dist/src/storage/postgres.js.map +1 -1
- package/dist/src/storage/redis.d.ts +10 -0
- package/dist/src/storage/redis.d.ts.map +1 -1
- package/dist/src/storage/redis.js +65 -0
- package/dist/src/storage/redis.js.map +1 -1
- package/dist/src/types/budget.d.ts +4 -0
- package/dist/src/types/budget.d.ts.map +1 -1
- package/dist/src/types/config.d.ts +58 -0
- package/dist/src/types/config.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +1 -0
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/policy.d.ts +11 -1
- package/dist/src/types/policy.d.ts.map +1 -1
- package/dist/src/types/tool-result.d.ts +11 -0
- package/dist/src/types/tool-result.d.ts.map +1 -1
- package/dist/tests/unit/app-routes.test.d.ts +2 -0
- package/dist/tests/unit/app-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/app-routes.test.js +715 -0
- package/dist/tests/unit/app-routes.test.js.map +1 -0
- package/dist/tests/unit/audit-logger.test.js +105 -0
- package/dist/tests/unit/audit-logger.test.js.map +1 -1
- package/dist/tests/unit/auth-providers.test.d.ts +2 -0
- package/dist/tests/unit/auth-providers.test.d.ts.map +1 -0
- package/dist/tests/unit/auth-providers.test.js +279 -0
- package/dist/tests/unit/auth-providers.test.js.map +1 -0
- package/dist/tests/unit/auth-routes-extended.test.d.ts +2 -0
- package/dist/tests/unit/auth-routes-extended.test.d.ts.map +1 -0
- package/dist/tests/unit/auth-routes-extended.test.js +993 -0
- package/dist/tests/unit/auth-routes-extended.test.js.map +1 -0
- package/dist/tests/unit/auth-verifier.test.d.ts +2 -0
- package/dist/tests/unit/auth-verifier.test.d.ts.map +1 -0
- package/dist/tests/unit/auth-verifier.test.js +505 -0
- package/dist/tests/unit/auth-verifier.test.js.map +1 -0
- package/dist/tests/unit/billing-routes.test.d.ts +2 -0
- package/dist/tests/unit/billing-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/billing-routes.test.js +432 -0
- package/dist/tests/unit/billing-routes.test.js.map +1 -0
- package/dist/tests/unit/config-defaults.test.d.ts +2 -0
- package/dist/tests/unit/config-defaults.test.d.ts.map +1 -0
- package/dist/tests/unit/config-defaults.test.js +119 -0
- package/dist/tests/unit/config-defaults.test.js.map +1 -0
- package/dist/tests/unit/defaults.test.js +0 -10
- package/dist/tests/unit/defaults.test.js.map +1 -1
- package/dist/tests/unit/filesystem-executor.test.d.ts +2 -0
- package/dist/tests/unit/filesystem-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/filesystem-executor.test.js +280 -0
- package/dist/tests/unit/filesystem-executor.test.js.map +1 -0
- package/dist/tests/unit/gateway-branches.test.d.ts +2 -0
- package/dist/tests/unit/gateway-branches.test.d.ts.map +1 -0
- package/dist/tests/unit/gateway-branches.test.js +1039 -0
- package/dist/tests/unit/gateway-branches.test.js.map +1 -0
- package/dist/tests/unit/http-executor-branches.test.d.ts +2 -0
- package/dist/tests/unit/http-executor-branches.test.d.ts.map +1 -0
- package/dist/tests/unit/http-executor-branches.test.js +495 -0
- package/dist/tests/unit/http-executor-branches.test.js.map +1 -0
- package/dist/tests/unit/logger.test.d.ts +2 -0
- package/dist/tests/unit/logger.test.d.ts.map +1 -0
- package/dist/tests/unit/logger.test.js +97 -0
- package/dist/tests/unit/logger.test.js.map +1 -0
- package/dist/tests/unit/mcp-internal-auth.test.d.ts +2 -0
- package/dist/tests/unit/mcp-internal-auth.test.d.ts.map +1 -0
- package/dist/tests/unit/mcp-internal-auth.test.js +445 -0
- package/dist/tests/unit/mcp-internal-auth.test.js.map +1 -0
- package/dist/tests/unit/metrics.test.js +102 -0
- package/dist/tests/unit/metrics.test.js.map +1 -1
- package/dist/tests/unit/model-pricing.test.d.ts +2 -0
- package/dist/tests/unit/model-pricing.test.d.ts.map +1 -0
- package/dist/tests/unit/model-pricing.test.js +87 -0
- package/dist/tests/unit/model-pricing.test.js.map +1 -0
- package/dist/tests/unit/oauth-stores.test.d.ts +2 -0
- package/dist/tests/unit/oauth-stores.test.d.ts.map +1 -0
- package/dist/tests/unit/oauth-stores.test.js +260 -0
- package/dist/tests/unit/oauth-stores.test.js.map +1 -0
- package/dist/tests/unit/policy-engine.test.js +466 -0
- package/dist/tests/unit/policy-engine.test.js.map +1 -1
- package/dist/tests/unit/provider-interceptor.test.d.ts +2 -0
- package/dist/tests/unit/provider-interceptor.test.d.ts.map +1 -0
- package/dist/tests/unit/provider-interceptor.test.js +472 -0
- package/dist/tests/unit/provider-interceptor.test.js.map +1 -0
- package/dist/tests/unit/saas-routes-branches.test.d.ts +2 -0
- package/dist/tests/unit/saas-routes-branches.test.d.ts.map +1 -0
- package/dist/tests/unit/saas-routes-branches.test.js +2165 -0
- package/dist/tests/unit/saas-routes-branches.test.js.map +1 -0
- package/dist/tests/unit/saas-routes-crud.test.d.ts +2 -0
- package/dist/tests/unit/saas-routes-crud.test.d.ts.map +1 -0
- package/dist/tests/unit/saas-routes-crud.test.js +332 -0
- package/dist/tests/unit/saas-routes-crud.test.js.map +1 -0
- package/dist/tests/unit/saas-routes-data.test.d.ts +2 -0
- package/dist/tests/unit/saas-routes-data.test.d.ts.map +1 -0
- package/dist/tests/unit/saas-routes-data.test.js +405 -0
- package/dist/tests/unit/saas-routes-data.test.js.map +1 -0
- package/dist/tests/unit/saas-routes.test.js +3 -3
- package/dist/tests/unit/saas-routes.test.js.map +1 -1
- package/dist/tests/unit/shell-executor.test.d.ts +2 -0
- package/dist/tests/unit/shell-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/shell-executor.test.js +145 -0
- package/dist/tests/unit/shell-executor.test.js.map +1 -0
- package/dist/tests/unit/sql-executor.test.d.ts +2 -0
- package/dist/tests/unit/sql-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/sql-executor.test.js +177 -0
- package/dist/tests/unit/sql-executor.test.js.map +1 -0
- package/dist/tests/unit/stream-proxy.test.d.ts +2 -0
- package/dist/tests/unit/stream-proxy.test.d.ts.map +1 -0
- package/dist/tests/unit/stream-proxy.test.js +147 -0
- package/dist/tests/unit/stream-proxy.test.js.map +1 -0
- package/dist/tests/unit/tool-definitions.test.d.ts +2 -0
- package/dist/tests/unit/tool-definitions.test.d.ts.map +1 -0
- package/dist/tests/unit/tool-definitions.test.js +184 -0
- package/dist/tests/unit/tool-definitions.test.js.map +1 -0
- package/dist/tests/unit/usage-extractor.test.js +140 -0
- package/dist/tests/unit/usage-extractor.test.js.map +1 -1
- package/dist/tests/unit/webhook-handler.test.d.ts +2 -0
- package/dist/tests/unit/webhook-handler.test.d.ts.map +1 -0
- package/dist/tests/unit/webhook-handler.test.js +453 -0
- package/dist/tests/unit/webhook-handler.test.js.map +1 -0
- package/dist/tests/unit/webhook-routes.test.d.ts +2 -0
- package/dist/tests/unit/webhook-routes.test.d.ts.map +1 -0
- package/dist/tests/unit/webhook-routes.test.js +69 -0
- package/dist/tests/unit/webhook-routes.test.js.map +1 -0
- package/dist/tests/unit/websocket-executor.test.d.ts +2 -0
- package/dist/tests/unit/websocket-executor.test.d.ts.map +1 -0
- package/dist/tests/unit/websocket-executor.test.js +121 -0
- package/dist/tests/unit/websocket-executor.test.js.map +1 -0
- package/package.json +8 -2
- package/policy-packs/demo_fail.yaml +41 -0
- package/policy-packs/full_tools.yaml +136 -0
- package/src/admin/index.ts +1 -0
- package/src/admin/routes.ts +509 -0
- package/src/admin/templates.ts +572 -0
- package/src/anomaly/detector.ts +730 -0
- package/src/anomaly/index.ts +1 -0
- package/src/approval/manager.ts +569 -0
- package/src/approval/webhook.ts +133 -0
- package/src/audit/logger.ts +490 -0
- package/src/auth/index.ts +5 -0
- package/src/auth/password.ts +21 -0
- package/src/auth/pkce.ts +22 -0
- package/src/auth/providers.ts +208 -0
- package/src/auth/routes.ts +561 -0
- package/src/auth/session.ts +84 -0
- package/src/billing/index.ts +6 -0
- package/src/billing/plan-enforcer.ts +135 -0
- package/src/billing/routes.ts +229 -0
- package/src/billing/stripe-client.ts +58 -0
- package/src/billing/webhook-handler.ts +182 -0
- package/src/billing/webhook-routes.ts +28 -0
- package/src/budget/manager.ts +679 -0
- package/src/budget/model-pricing.ts +119 -0
- package/src/budget/usage-extractor.ts +214 -0
- package/src/cli.ts +91 -0
- package/src/config/defaults.ts +261 -0
- package/src/config/validate.ts +88 -0
- package/src/dlp/composite-scanner.ts +213 -0
- package/src/dlp/index.ts +9 -0
- package/src/dlp/interfaces.ts +34 -0
- package/src/dlp/patterns.ts +30 -0
- package/src/dlp/prompt-injection-backend.ts +181 -0
- package/src/dlp/prompt-injection-patterns.ts +302 -0
- package/src/dlp/regex-backend.ts +181 -0
- package/src/dlp/scanner.ts +502 -0
- package/src/dlp/text-normalizer.ts +225 -0
- package/src/dlp/tool-patterns.ts +35 -0
- package/src/dlp/trufflehog-backend.ts +190 -0
- package/src/executor/filesystem-executor.ts +196 -0
- package/src/executor/http-executor.ts +349 -0
- package/src/executor/index.ts +9 -0
- package/src/executor/interfaces.ts +11 -0
- package/src/executor/noop-executor.ts +23 -0
- package/src/executor/registry.ts +64 -0
- package/src/executor/shell-executor.ts +148 -0
- package/src/executor/slack-executor.ts +176 -0
- package/src/executor/sql-executor.ts +146 -0
- package/src/executor/websocket-executor.ts +211 -0
- package/src/index.ts +24 -0
- package/src/interceptor/index.ts +1 -0
- package/src/interceptor/provider-interceptor.ts +315 -0
- package/src/mcp/auth-verifier.ts +152 -0
- package/src/mcp/bridge.ts +703 -0
- package/src/mcp/http-transport.ts +698 -0
- package/src/mcp/index.ts +9 -0
- package/src/mcp/internal-auth.ts +14 -0
- package/src/mcp/oauth-pages.ts +139 -0
- package/src/mcp/oauth-postgres-stores.ts +278 -0
- package/src/mcp/oauth-provider.ts +536 -0
- package/src/mcp/oauth-stores.ts +202 -0
- package/src/mcp/server.ts +55 -0
- package/src/mcp/tool-definitions.ts +562 -0
- package/src/metrics/collector.ts +357 -0
- package/src/metrics/index.ts +1 -0
- package/src/middleware/auth.ts +814 -0
- package/src/middleware/session.ts +85 -0
- package/src/middleware/validate.ts +130 -0
- package/src/policy/engine.ts +815 -0
- package/src/policy/index.ts +2 -0
- package/src/policy/opa-engine.ts +829 -0
- package/src/proxy/forward-proxy.ts +649 -0
- package/src/proxy/index.ts +1 -0
- package/src/ratelimit/limiter.ts +196 -0
- package/src/replay/engine.ts +142 -0
- package/src/replay/index.ts +1 -0
- package/src/saas/index.ts +1 -0
- package/src/saas/routes.ts +2178 -0
- package/src/server/app.ts +985 -0
- package/src/server/errors.ts +49 -0
- package/src/server/gateway.ts +1130 -0
- package/src/server/index.ts +307 -0
- package/src/server/logger.ts +255 -0
- package/src/server/stream-proxy.ts +202 -0
- package/src/storage/file-persistence.ts +315 -0
- package/src/storage/index.ts +4 -0
- package/src/storage/interfaces.ts +287 -0
- package/src/storage/memory.ts +686 -0
- package/src/storage/postgres.ts +1831 -0
- package/src/storage/redis.ts +835 -0
- package/src/tracing/index.ts +1 -0
- package/src/tracing/provider.ts +100 -0
- package/src/trust/calculator.ts +141 -0
- package/src/trust/index.ts +7 -0
- package/src/types/budget.ts +36 -0
- package/src/types/config.ts +278 -0
- package/src/types/events.ts +41 -0
- package/src/types/express.d.ts +14 -0
- package/src/types/index.ts +7 -0
- package/src/types/policy.ts +83 -0
- package/src/types/stripe-config.ts +11 -0
- package/src/types/subscription.ts +59 -0
- package/src/types/tool-call.ts +47 -0
- package/src/types/tool-result.ts +82 -0
- package/src/types/user.ts +125 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto';
|
|
2
|
+
import { ToolCall, ToolCallArgs, ToolInfo } from '../types/tool-call';
|
|
3
|
+
import { MCPBridgeConfig } from './bridge';
|
|
4
|
+
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// MCP tool definition type (subset needed for tools/list)
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
export interface MCPToolDefinition {
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object';
|
|
14
|
+
properties: Record<string, unknown>;
|
|
15
|
+
required?: string[];
|
|
16
|
+
};
|
|
17
|
+
annotations?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// MCPToolHandler interface
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
export interface MCPToolHandler {
|
|
25
|
+
definition: MCPToolDefinition;
|
|
26
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Shared helper: build a ToolCall from common parameters
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
export function buildToolCallHelper(params: {
|
|
34
|
+
toolName: string;
|
|
35
|
+
capability: ToolInfo['capability'];
|
|
36
|
+
args: ToolCallArgs;
|
|
37
|
+
constraints?: { timeout_ms?: number; max_cost_usd?: number };
|
|
38
|
+
context?: { purpose?: string; labels?: string[] };
|
|
39
|
+
bridgeConfig: Required<MCPBridgeConfig>;
|
|
40
|
+
}): ToolCall {
|
|
41
|
+
const toolCall: ToolCall = {
|
|
42
|
+
tool_call_id: randomUUID(),
|
|
43
|
+
task_id: params.bridgeConfig.task_id || randomUUID(),
|
|
44
|
+
workspace_id: params.bridgeConfig.workspace_id,
|
|
45
|
+
actor: { ...params.bridgeConfig.actor },
|
|
46
|
+
source: { ...params.bridgeConfig.source },
|
|
47
|
+
tool: {
|
|
48
|
+
name: params.toolName,
|
|
49
|
+
version: '1.0.0',
|
|
50
|
+
capability: params.capability,
|
|
51
|
+
},
|
|
52
|
+
args: params.args,
|
|
53
|
+
timestamp: new Date().toISOString(),
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Add constraints if any are specified
|
|
57
|
+
if (params.constraints?.timeout_ms != null || params.constraints?.max_cost_usd != null) {
|
|
58
|
+
toolCall.constraints = {};
|
|
59
|
+
if (params.constraints.timeout_ms != null) {
|
|
60
|
+
toolCall.constraints.timeout_ms = params.constraints.timeout_ms;
|
|
61
|
+
}
|
|
62
|
+
if (params.constraints.max_cost_usd != null) {
|
|
63
|
+
toolCall.constraints.max_cost_usd = params.constraints.max_cost_usd;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Add context if any is specified
|
|
68
|
+
if (params.context?.purpose || params.context?.labels) {
|
|
69
|
+
toolCall.context = {};
|
|
70
|
+
if (params.context.purpose) {
|
|
71
|
+
toolCall.context.purpose = params.context.purpose;
|
|
72
|
+
}
|
|
73
|
+
if (params.context.labels) {
|
|
74
|
+
toolCall.context.labels = params.context.labels;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return toolCall;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Shared helpers
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Map an HTTP method to a ToolInfo capability level.
|
|
87
|
+
*/
|
|
88
|
+
function methodToCapability(method: string): ToolInfo['capability'] {
|
|
89
|
+
switch (method.toUpperCase()) {
|
|
90
|
+
case 'GET':
|
|
91
|
+
case 'HEAD':
|
|
92
|
+
case 'OPTIONS':
|
|
93
|
+
return 'read';
|
|
94
|
+
case 'POST':
|
|
95
|
+
case 'PUT':
|
|
96
|
+
case 'PATCH':
|
|
97
|
+
return 'write';
|
|
98
|
+
case 'DELETE':
|
|
99
|
+
return 'delete';
|
|
100
|
+
default:
|
|
101
|
+
return 'write';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Attempt to parse a body string as JSON, falling back to the raw string.
|
|
107
|
+
*/
|
|
108
|
+
function parseBody(body: string): unknown {
|
|
109
|
+
try {
|
|
110
|
+
return JSON.parse(body);
|
|
111
|
+
} catch {
|
|
112
|
+
return body;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Extract common HTTP constraints and context from MCP args.
|
|
118
|
+
*/
|
|
119
|
+
function extractHttpMeta(args: Record<string, unknown>) {
|
|
120
|
+
return {
|
|
121
|
+
constraints: {
|
|
122
|
+
timeout_ms: typeof args.timeout_ms === 'number' ? args.timeout_ms : undefined,
|
|
123
|
+
max_cost_usd: typeof args.max_cost_usd === 'number' ? args.max_cost_usd : undefined,
|
|
124
|
+
},
|
|
125
|
+
context: {
|
|
126
|
+
purpose: typeof args.purpose === 'string' ? args.purpose : undefined,
|
|
127
|
+
labels: Array.isArray(args.labels) ? args.labels : undefined,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// HTTP Tool Handlers
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
const httpRequestHandler: MCPToolHandler = {
|
|
137
|
+
definition: {
|
|
138
|
+
name: 'http_request',
|
|
139
|
+
description:
|
|
140
|
+
'Execute an HTTP request through the Palaryn gateway. ' +
|
|
141
|
+
'Supports all HTTP methods. The request goes through policy evaluation, ' +
|
|
142
|
+
'DLP scanning, budget checks, and rate limiting before execution.',
|
|
143
|
+
inputSchema: {
|
|
144
|
+
type: 'object',
|
|
145
|
+
properties: {
|
|
146
|
+
url: { type: 'string', description: 'The target URL for the HTTP request' },
|
|
147
|
+
method: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
enum: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'],
|
|
150
|
+
description: 'HTTP method (defaults to GET)',
|
|
151
|
+
},
|
|
152
|
+
headers: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
additionalProperties: { type: 'string' },
|
|
155
|
+
description: 'HTTP headers as key-value pairs',
|
|
156
|
+
},
|
|
157
|
+
body: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
description: 'Request body (typically JSON string for POST/PUT/PATCH)',
|
|
160
|
+
},
|
|
161
|
+
timeout_ms: { type: 'number', description: 'Request timeout in milliseconds' },
|
|
162
|
+
max_cost_usd: {
|
|
163
|
+
type: 'number',
|
|
164
|
+
description: 'Maximum cost budget for this request in USD',
|
|
165
|
+
},
|
|
166
|
+
purpose: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
description: 'Description of why this request is being made',
|
|
169
|
+
},
|
|
170
|
+
labels: {
|
|
171
|
+
type: 'array',
|
|
172
|
+
items: { type: 'string' },
|
|
173
|
+
description: 'Classification labels for the request',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
required: ['url'],
|
|
177
|
+
},
|
|
178
|
+
annotations: {
|
|
179
|
+
title: 'HTTP Request',
|
|
180
|
+
readOnlyHint: false,
|
|
181
|
+
destructiveHint: true,
|
|
182
|
+
openWorldHint: true,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
187
|
+
const method = (typeof args.method === 'string' ? args.method : 'GET').toUpperCase();
|
|
188
|
+
const capability = methodToCapability(method);
|
|
189
|
+
const { constraints, context } = extractHttpMeta(args);
|
|
190
|
+
|
|
191
|
+
return buildToolCallHelper({
|
|
192
|
+
toolName: 'http.request',
|
|
193
|
+
capability,
|
|
194
|
+
args: {
|
|
195
|
+
method,
|
|
196
|
+
url: args.url as string,
|
|
197
|
+
headers: args.headers as Record<string, string> | undefined,
|
|
198
|
+
body: typeof args.body === 'string' ? parseBody(args.body) : undefined,
|
|
199
|
+
},
|
|
200
|
+
constraints,
|
|
201
|
+
context,
|
|
202
|
+
bridgeConfig,
|
|
203
|
+
});
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const httpGetHandler: MCPToolHandler = {
|
|
208
|
+
definition: {
|
|
209
|
+
name: 'http_get',
|
|
210
|
+
description:
|
|
211
|
+
'Execute an HTTP GET request through the Palaryn gateway. ' +
|
|
212
|
+
'Shorthand for http_request with method=GET. The request goes through ' +
|
|
213
|
+
'policy evaluation, DLP scanning, budget checks, and rate limiting.',
|
|
214
|
+
inputSchema: {
|
|
215
|
+
type: 'object',
|
|
216
|
+
properties: {
|
|
217
|
+
url: { type: 'string', description: 'The target URL for the GET request' },
|
|
218
|
+
headers: {
|
|
219
|
+
type: 'object',
|
|
220
|
+
additionalProperties: { type: 'string' },
|
|
221
|
+
description: 'HTTP headers as key-value pairs',
|
|
222
|
+
},
|
|
223
|
+
timeout_ms: { type: 'number', description: 'Request timeout in milliseconds' },
|
|
224
|
+
max_cost_usd: {
|
|
225
|
+
type: 'number',
|
|
226
|
+
description: 'Maximum cost budget for this request in USD',
|
|
227
|
+
},
|
|
228
|
+
purpose: {
|
|
229
|
+
type: 'string',
|
|
230
|
+
description: 'Description of why this request is being made',
|
|
231
|
+
},
|
|
232
|
+
labels: {
|
|
233
|
+
type: 'array',
|
|
234
|
+
items: { type: 'string' },
|
|
235
|
+
description: 'Classification labels for the request',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
required: ['url'],
|
|
239
|
+
},
|
|
240
|
+
annotations: {
|
|
241
|
+
title: 'HTTP GET',
|
|
242
|
+
readOnlyHint: true,
|
|
243
|
+
destructiveHint: false,
|
|
244
|
+
openWorldHint: true,
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
249
|
+
const { constraints, context } = extractHttpMeta(args);
|
|
250
|
+
|
|
251
|
+
return buildToolCallHelper({
|
|
252
|
+
toolName: 'http.get',
|
|
253
|
+
capability: 'read',
|
|
254
|
+
args: {
|
|
255
|
+
method: 'GET',
|
|
256
|
+
url: args.url as string,
|
|
257
|
+
headers: args.headers as Record<string, string> | undefined,
|
|
258
|
+
},
|
|
259
|
+
constraints,
|
|
260
|
+
context,
|
|
261
|
+
bridgeConfig,
|
|
262
|
+
});
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const httpPostHandler: MCPToolHandler = {
|
|
267
|
+
definition: {
|
|
268
|
+
name: 'http_post',
|
|
269
|
+
description:
|
|
270
|
+
'Execute an HTTP POST request through the Palaryn gateway. ' +
|
|
271
|
+
'Shorthand for http_request with method=POST. The request goes through ' +
|
|
272
|
+
'policy evaluation, DLP scanning, budget checks, and rate limiting.',
|
|
273
|
+
inputSchema: {
|
|
274
|
+
type: 'object',
|
|
275
|
+
properties: {
|
|
276
|
+
url: { type: 'string', description: 'The target URL for the POST request' },
|
|
277
|
+
headers: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
additionalProperties: { type: 'string' },
|
|
280
|
+
description: 'HTTP headers as key-value pairs',
|
|
281
|
+
},
|
|
282
|
+
body: { type: 'string', description: 'Request body (typically a JSON string)' },
|
|
283
|
+
timeout_ms: { type: 'number', description: 'Request timeout in milliseconds' },
|
|
284
|
+
max_cost_usd: {
|
|
285
|
+
type: 'number',
|
|
286
|
+
description: 'Maximum cost budget for this request in USD',
|
|
287
|
+
},
|
|
288
|
+
purpose: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
description: 'Description of why this request is being made',
|
|
291
|
+
},
|
|
292
|
+
labels: {
|
|
293
|
+
type: 'array',
|
|
294
|
+
items: { type: 'string' },
|
|
295
|
+
description: 'Classification labels for the request',
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
required: ['url'],
|
|
299
|
+
},
|
|
300
|
+
annotations: {
|
|
301
|
+
title: 'HTTP POST',
|
|
302
|
+
readOnlyHint: false,
|
|
303
|
+
destructiveHint: false,
|
|
304
|
+
openWorldHint: true,
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
309
|
+
const { constraints, context } = extractHttpMeta(args);
|
|
310
|
+
|
|
311
|
+
return buildToolCallHelper({
|
|
312
|
+
toolName: 'http.post',
|
|
313
|
+
capability: 'write',
|
|
314
|
+
args: {
|
|
315
|
+
method: 'POST',
|
|
316
|
+
url: args.url as string,
|
|
317
|
+
headers: args.headers as Record<string, string> | undefined,
|
|
318
|
+
body: typeof args.body === 'string' ? parseBody(args.body) : undefined,
|
|
319
|
+
},
|
|
320
|
+
constraints,
|
|
321
|
+
context,
|
|
322
|
+
bridgeConfig,
|
|
323
|
+
});
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
// ---------------------------------------------------------------------------
|
|
328
|
+
// File Tool Handlers
|
|
329
|
+
// ---------------------------------------------------------------------------
|
|
330
|
+
|
|
331
|
+
const fileReadHandler: MCPToolHandler = {
|
|
332
|
+
definition: {
|
|
333
|
+
name: 'file_read',
|
|
334
|
+
description:
|
|
335
|
+
'Read a file from the sandboxed filesystem through the Palaryn gateway. ' +
|
|
336
|
+
'The request goes through policy evaluation, DLP scanning, and audit logging.',
|
|
337
|
+
inputSchema: {
|
|
338
|
+
type: 'object',
|
|
339
|
+
properties: {
|
|
340
|
+
path: { type: 'string', description: 'Path to the file to read (relative to sandbox root)' },
|
|
341
|
+
encoding: {
|
|
342
|
+
type: 'string',
|
|
343
|
+
description: 'File encoding (defaults to utf-8)',
|
|
344
|
+
enum: ['utf-8', 'ascii', 'base64', 'hex', 'binary'],
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
required: ['path'],
|
|
348
|
+
},
|
|
349
|
+
annotations: {
|
|
350
|
+
title: 'File Read',
|
|
351
|
+
readOnlyHint: true,
|
|
352
|
+
destructiveHint: false,
|
|
353
|
+
openWorldHint: false,
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
358
|
+
return buildToolCallHelper({
|
|
359
|
+
toolName: 'file.read',
|
|
360
|
+
capability: 'read',
|
|
361
|
+
args: {
|
|
362
|
+
path: args.path as string,
|
|
363
|
+
encoding: typeof args.encoding === 'string' ? args.encoding : undefined,
|
|
364
|
+
},
|
|
365
|
+
bridgeConfig,
|
|
366
|
+
});
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const fileWriteHandler: MCPToolHandler = {
|
|
371
|
+
definition: {
|
|
372
|
+
name: 'file_write',
|
|
373
|
+
description:
|
|
374
|
+
'Write content to a file in the sandboxed filesystem through the Palaryn gateway. ' +
|
|
375
|
+
'The request goes through policy evaluation, DLP scanning, and audit logging.',
|
|
376
|
+
inputSchema: {
|
|
377
|
+
type: 'object',
|
|
378
|
+
properties: {
|
|
379
|
+
path: { type: 'string', description: 'Path to the file to write (relative to sandbox root)' },
|
|
380
|
+
content: { type: 'string', description: 'Content to write to the file' },
|
|
381
|
+
append: { type: 'boolean', description: 'Append to file instead of overwriting (defaults to false)' },
|
|
382
|
+
},
|
|
383
|
+
required: ['path', 'content'],
|
|
384
|
+
},
|
|
385
|
+
annotations: {
|
|
386
|
+
title: 'File Write',
|
|
387
|
+
readOnlyHint: false,
|
|
388
|
+
destructiveHint: true,
|
|
389
|
+
openWorldHint: false,
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
394
|
+
return buildToolCallHelper({
|
|
395
|
+
toolName: 'file.write',
|
|
396
|
+
capability: 'write',
|
|
397
|
+
args: {
|
|
398
|
+
path: args.path as string,
|
|
399
|
+
content: args.content as string,
|
|
400
|
+
append: typeof args.append === 'boolean' ? args.append : undefined,
|
|
401
|
+
},
|
|
402
|
+
bridgeConfig,
|
|
403
|
+
});
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
const fileListHandler: MCPToolHandler = {
|
|
408
|
+
definition: {
|
|
409
|
+
name: 'file_list',
|
|
410
|
+
description:
|
|
411
|
+
'List files and directories in the sandboxed filesystem through the Palaryn gateway. ' +
|
|
412
|
+
'The request goes through policy evaluation and audit logging.',
|
|
413
|
+
inputSchema: {
|
|
414
|
+
type: 'object',
|
|
415
|
+
properties: {
|
|
416
|
+
path: { type: 'string', description: 'Directory path to list (relative to sandbox root)' },
|
|
417
|
+
recursive: { type: 'boolean', description: 'List files recursively (defaults to false)' },
|
|
418
|
+
pattern: { type: 'string', description: 'Glob pattern to filter files (e.g. "*.json")' },
|
|
419
|
+
},
|
|
420
|
+
required: ['path'],
|
|
421
|
+
},
|
|
422
|
+
annotations: {
|
|
423
|
+
title: 'File List',
|
|
424
|
+
readOnlyHint: true,
|
|
425
|
+
destructiveHint: false,
|
|
426
|
+
openWorldHint: false,
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
431
|
+
return buildToolCallHelper({
|
|
432
|
+
toolName: 'file.list',
|
|
433
|
+
capability: 'read',
|
|
434
|
+
args: {
|
|
435
|
+
path: args.path as string,
|
|
436
|
+
recursive: typeof args.recursive === 'boolean' ? args.recursive : undefined,
|
|
437
|
+
pattern: typeof args.pattern === 'string' ? args.pattern : undefined,
|
|
438
|
+
},
|
|
439
|
+
bridgeConfig,
|
|
440
|
+
});
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
// ---------------------------------------------------------------------------
|
|
445
|
+
// SQL Tool Handlers
|
|
446
|
+
// ---------------------------------------------------------------------------
|
|
447
|
+
|
|
448
|
+
const sqlQueryHandler: MCPToolHandler = {
|
|
449
|
+
definition: {
|
|
450
|
+
name: 'sql_query',
|
|
451
|
+
description:
|
|
452
|
+
'Execute a SQL query through the Palaryn gateway. ' +
|
|
453
|
+
'The request goes through policy evaluation, DLP scanning, budget checks, and audit logging. ' +
|
|
454
|
+
'Query restrictions (read-only mode, blocked tables) are enforced by the gateway.',
|
|
455
|
+
inputSchema: {
|
|
456
|
+
type: 'object',
|
|
457
|
+
properties: {
|
|
458
|
+
query: { type: 'string', description: 'SQL query to execute' },
|
|
459
|
+
params: {
|
|
460
|
+
type: 'array',
|
|
461
|
+
items: {},
|
|
462
|
+
description: 'Parameterized query values (positional $1, $2, etc.)',
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
required: ['query'],
|
|
466
|
+
},
|
|
467
|
+
annotations: {
|
|
468
|
+
title: 'SQL Query',
|
|
469
|
+
readOnlyHint: false,
|
|
470
|
+
destructiveHint: true,
|
|
471
|
+
openWorldHint: false,
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
buildToolCall(args: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
476
|
+
return buildToolCallHelper({
|
|
477
|
+
toolName: 'sql.query',
|
|
478
|
+
capability: 'read',
|
|
479
|
+
args: {
|
|
480
|
+
query: args.query as string,
|
|
481
|
+
params: Array.isArray(args.params) ? args.params : undefined,
|
|
482
|
+
},
|
|
483
|
+
bridgeConfig,
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
// ---------------------------------------------------------------------------
|
|
489
|
+
// Shell Tool Handlers
|
|
490
|
+
// ---------------------------------------------------------------------------
|
|
491
|
+
|
|
492
|
+
const shellExecHandler: MCPToolHandler = {
|
|
493
|
+
definition: {
|
|
494
|
+
name: 'shell_exec',
|
|
495
|
+
description:
|
|
496
|
+
'Execute a shell command through the Palaryn gateway. ' +
|
|
497
|
+
'The request goes through policy evaluation, DLP scanning, and audit logging. ' +
|
|
498
|
+
'Only commands in the allowed list can be executed.',
|
|
499
|
+
inputSchema: {
|
|
500
|
+
type: 'object',
|
|
501
|
+
properties: {
|
|
502
|
+
command: { type: 'string', description: 'Command to execute' },
|
|
503
|
+
args: {
|
|
504
|
+
type: 'array',
|
|
505
|
+
items: { type: 'string' },
|
|
506
|
+
description: 'Command arguments',
|
|
507
|
+
},
|
|
508
|
+
cwd: { type: 'string', description: 'Working directory for command execution' },
|
|
509
|
+
timeout_ms: { type: 'number', description: 'Command timeout in milliseconds' },
|
|
510
|
+
},
|
|
511
|
+
required: ['command'],
|
|
512
|
+
},
|
|
513
|
+
annotations: {
|
|
514
|
+
title: 'Shell Execute',
|
|
515
|
+
readOnlyHint: false,
|
|
516
|
+
destructiveHint: true,
|
|
517
|
+
openWorldHint: false,
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
buildToolCall(mcpArgs: Record<string, unknown>, bridgeConfig: Required<MCPBridgeConfig>): ToolCall {
|
|
522
|
+
return buildToolCallHelper({
|
|
523
|
+
toolName: 'shell.exec',
|
|
524
|
+
capability: 'write',
|
|
525
|
+
args: {
|
|
526
|
+
command: mcpArgs.command as string,
|
|
527
|
+
args: Array.isArray(mcpArgs.args) ? mcpArgs.args : undefined,
|
|
528
|
+
cwd: typeof mcpArgs.cwd === 'string' ? mcpArgs.cwd : undefined,
|
|
529
|
+
},
|
|
530
|
+
constraints: {
|
|
531
|
+
timeout_ms: typeof mcpArgs.timeout_ms === 'number' ? mcpArgs.timeout_ms : undefined,
|
|
532
|
+
},
|
|
533
|
+
bridgeConfig,
|
|
534
|
+
});
|
|
535
|
+
},
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
// ---------------------------------------------------------------------------
|
|
539
|
+
// Validation helpers (used by HTTP tools to check required args)
|
|
540
|
+
// ---------------------------------------------------------------------------
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Returns an error string if the url arg is missing/invalid, or null if valid.
|
|
544
|
+
*/
|
|
545
|
+
export function validateUrlArg(args: Record<string, unknown>): string | null {
|
|
546
|
+
if (!args.url || typeof args.url !== 'string') {
|
|
547
|
+
return 'Missing required argument: url';
|
|
548
|
+
}
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// ---------------------------------------------------------------------------
|
|
553
|
+
// Tool group exports
|
|
554
|
+
// ---------------------------------------------------------------------------
|
|
555
|
+
|
|
556
|
+
export const HTTP_TOOLS: MCPToolHandler[] = [httpRequestHandler, httpGetHandler, httpPostHandler];
|
|
557
|
+
export const FILE_TOOLS: MCPToolHandler[] = [fileReadHandler, fileWriteHandler, fileListHandler];
|
|
558
|
+
export const SQL_TOOLS: MCPToolHandler[] = [sqlQueryHandler];
|
|
559
|
+
export const SHELL_TOOLS: MCPToolHandler[] = [shellExecHandler];
|
|
560
|
+
|
|
561
|
+
/** Default tools registered when no config overrides are applied. */
|
|
562
|
+
export const ALL_DEFAULT_TOOLS: MCPToolHandler[] = [...HTTP_TOOLS];
|