slimmcp-proxy 0.0.0-stage → 1.0.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 +32 -2
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +201 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config.d.ts +6 -0
- package/dist/src/config.js +81 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +11 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/indexer.d.ts +22 -0
- package/dist/src/indexer.js +131 -0
- package/dist/src/indexer.js.map +1 -0
- package/dist/src/ledger.d.ts +28 -0
- package/dist/src/ledger.js +106 -0
- package/dist/src/ledger.js.map +1 -0
- package/dist/src/policy.d.ts +81 -0
- package/dist/src/policy.js +148 -0
- package/dist/src/policy.js.map +1 -0
- package/dist/src/redactor.d.ts +2 -0
- package/dist/src/redactor.js +297 -0
- package/dist/src/redactor.js.map +1 -0
- package/dist/src/server.d.ts +45 -0
- package/dist/src/server.js +355 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tokenizer.d.ts +11 -0
- package/dist/src/tokenizer.js +37 -0
- package/dist/src/tokenizer.js.map +1 -0
- package/dist/src/types.d.ts +80 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/upstream.d.ts +37 -0
- package/dist/src/upstream.js +317 -0
- package/dist/src/upstream.js.map +1 -0
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +23 -0
- package/dist/src/version.js.map +1 -0
- package/package.json +40 -4
- package/slimmcp.config.example.json +24 -0
- package/slimmcp.policy.example.json +19 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
3
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
4
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
5
|
+
import { SLIMMCP_VERSION } from './version.js';
|
|
6
|
+
export const DEFAULT_CONNECT_TIMEOUT_MS = 15_000;
|
|
7
|
+
export const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
|
|
8
|
+
export const DEFAULT_ENV_ALLOWLIST = [
|
|
9
|
+
'PATH',
|
|
10
|
+
'HOME',
|
|
11
|
+
'USERPROFILE',
|
|
12
|
+
'SYSTEMROOT',
|
|
13
|
+
'COMSPEC',
|
|
14
|
+
'TMP',
|
|
15
|
+
'TEMP',
|
|
16
|
+
'LANG',
|
|
17
|
+
'NODE_ENV'
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Builds an isolated child environment using only a minimal safe allowlist,
|
|
21
|
+
* optional per-server allowlisted keys, and explicit `spec.env` overrides.
|
|
22
|
+
*/
|
|
23
|
+
export function buildIsolatedChildEnv(explicitEnv, envAllowlist, sourceEnv = process.env) {
|
|
24
|
+
const out = {};
|
|
25
|
+
const allowedKeys = new Set(DEFAULT_ENV_ALLOWLIST);
|
|
26
|
+
if (envAllowlist) {
|
|
27
|
+
for (const key of envAllowlist) {
|
|
28
|
+
const trimmed = key.trim();
|
|
29
|
+
if (trimmed)
|
|
30
|
+
allowedKeys.add(trimmed);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (const key of allowedKeys) {
|
|
34
|
+
const val = sourceEnv[key];
|
|
35
|
+
if (typeof val === 'string' && !val.startsWith('()')) {
|
|
36
|
+
out[key] = val;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (explicitEnv) {
|
|
40
|
+
for (const [k, v] of Object.entries(explicitEnv)) {
|
|
41
|
+
if (typeof v === 'string') {
|
|
42
|
+
out[k] = v;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
async function withTimeout(promise, timeoutMs, label) {
|
|
49
|
+
let timer;
|
|
50
|
+
try {
|
|
51
|
+
return await Promise.race([
|
|
52
|
+
promise,
|
|
53
|
+
new Promise((_, reject) => {
|
|
54
|
+
timer = setTimeout(() => {
|
|
55
|
+
reject(new Error(`${label} timed out after ${timeoutMs}ms.`));
|
|
56
|
+
}, timeoutMs);
|
|
57
|
+
timer.unref?.();
|
|
58
|
+
})
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
if (timer !== undefined) {
|
|
63
|
+
clearTimeout(timer);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const BLOCKED_METADATA_HOSTS = new Set([
|
|
68
|
+
'169.254.169.254',
|
|
69
|
+
'metadata.google.internal',
|
|
70
|
+
'metadata.goog',
|
|
71
|
+
'metadata',
|
|
72
|
+
'100.100.100.200',
|
|
73
|
+
'fd00:ec2::254'
|
|
74
|
+
]);
|
|
75
|
+
function parseIpv6Groups(host) {
|
|
76
|
+
if (!host.includes(':'))
|
|
77
|
+
return null;
|
|
78
|
+
const zoneIdx = host.indexOf('%');
|
|
79
|
+
const clean = zoneIdx === -1 ? host : host.slice(0, zoneIdx);
|
|
80
|
+
const doubleColonParts = clean.split('::');
|
|
81
|
+
if (doubleColonParts.length > 2)
|
|
82
|
+
return null;
|
|
83
|
+
const parseSegmentList = (seg) => {
|
|
84
|
+
if (!seg)
|
|
85
|
+
return [];
|
|
86
|
+
const parts = seg.split(':');
|
|
87
|
+
const out = [];
|
|
88
|
+
for (let i = 0; i < parts.length; i++) {
|
|
89
|
+
const part = parts[i];
|
|
90
|
+
if (part.includes('.')) {
|
|
91
|
+
if (i !== parts.length - 1)
|
|
92
|
+
return null;
|
|
93
|
+
const octets = part.split('.');
|
|
94
|
+
if (octets.length !== 4)
|
|
95
|
+
return null;
|
|
96
|
+
const nums = octets.map((o) => (/^\d+$/.test(o) ? Number(o) : -1));
|
|
97
|
+
if (nums.some((n) => n < 0 || n > 255))
|
|
98
|
+
return null;
|
|
99
|
+
out.push((nums[0] << 8) | nums[1], (nums[2] << 8) | nums[3]);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (!/^[0-9a-f]{1,4}$/i.test(part))
|
|
103
|
+
return null;
|
|
104
|
+
out.push(Number.parseInt(part, 16));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
108
|
+
};
|
|
109
|
+
const left = parseSegmentList(doubleColonParts[0]);
|
|
110
|
+
if (!left)
|
|
111
|
+
return null;
|
|
112
|
+
if (doubleColonParts.length === 1) {
|
|
113
|
+
return left.length === 8 ? left : null;
|
|
114
|
+
}
|
|
115
|
+
const right = parseSegmentList(doubleColonParts[1]);
|
|
116
|
+
if (!right)
|
|
117
|
+
return null;
|
|
118
|
+
const missing = 8 - (left.length + right.length);
|
|
119
|
+
if (missing < 1)
|
|
120
|
+
return null;
|
|
121
|
+
return [...left, ...Array(missing).fill(0), ...right];
|
|
122
|
+
}
|
|
123
|
+
function isBlockedIpv4(ip) {
|
|
124
|
+
return BLOCKED_METADATA_HOSTS.has(ip) || ip.startsWith('169.254.');
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Validates that an upstream remote URL uses http:/https: and does not target
|
|
128
|
+
* cloud instance metadata or link-local metadata endpoints (including IPv4-mapped IPv6).
|
|
129
|
+
*/
|
|
130
|
+
export function validateUpstreamUrl(urlStr) {
|
|
131
|
+
const parsed = new URL(urlStr);
|
|
132
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
133
|
+
throw new Error(`Unsupported upstream URL scheme "${parsed.protocol}"; only http: and https: are allowed.`);
|
|
134
|
+
}
|
|
135
|
+
const host = parsed.hostname.toLowerCase().replace(/\.+$/, '').replace(/^\[|\]$/g, '');
|
|
136
|
+
if (BLOCKED_METADATA_HOSTS.has(host) || isBlockedIpv4(host)) {
|
|
137
|
+
throw new Error(`Blocked cloud metadata / link-local upstream host "${parsed.hostname}".`);
|
|
138
|
+
}
|
|
139
|
+
const ipv6 = parseIpv6Groups(host);
|
|
140
|
+
if (ipv6) {
|
|
141
|
+
// ::/128 unspecified IPv6 address
|
|
142
|
+
if (ipv6.every((g) => g === 0)) {
|
|
143
|
+
throw new Error(`Blocked cloud metadata / link-local upstream host "${parsed.hostname}".`);
|
|
144
|
+
}
|
|
145
|
+
// 64:ff9b::/96 NAT64 well-known prefix
|
|
146
|
+
if (ipv6[0] === 0x0064 &&
|
|
147
|
+
ipv6[1] === 0xff9b &&
|
|
148
|
+
ipv6[2] === 0 &&
|
|
149
|
+
ipv6[3] === 0 &&
|
|
150
|
+
ipv6[4] === 0 &&
|
|
151
|
+
ipv6[5] === 0) {
|
|
152
|
+
throw new Error(`Blocked cloud metadata / link-local upstream host "${parsed.hostname}".`);
|
|
153
|
+
}
|
|
154
|
+
// fe80::/10 link-local
|
|
155
|
+
if ((ipv6[0] & 0xffc0) === 0xfe80) {
|
|
156
|
+
throw new Error(`Blocked cloud metadata / link-local upstream host "${parsed.hostname}".`);
|
|
157
|
+
}
|
|
158
|
+
// fd00:ec2::254 (AWS IPv6 IMDS)
|
|
159
|
+
if (ipv6[0] === 0xfd00 &&
|
|
160
|
+
ipv6[1] === 0x0ec2 &&
|
|
161
|
+
ipv6[2] === 0 &&
|
|
162
|
+
ipv6[3] === 0 &&
|
|
163
|
+
ipv6[4] === 0 &&
|
|
164
|
+
ipv6[5] === 0 &&
|
|
165
|
+
ipv6[6] === 0 &&
|
|
166
|
+
ipv6[7] === 0x0254) {
|
|
167
|
+
throw new Error(`Blocked cloud metadata / link-local upstream host "${parsed.hostname}".`);
|
|
168
|
+
}
|
|
169
|
+
// IPv4-mapped IPv6 (::ffff:a.b.c.d / ::ffff:xxxx:yyyy) or IPv4-compatible (::a.b.c.d)
|
|
170
|
+
const isIpv4Mapped = ipv6[0] === 0 &&
|
|
171
|
+
ipv6[1] === 0 &&
|
|
172
|
+
ipv6[2] === 0 &&
|
|
173
|
+
ipv6[3] === 0 &&
|
|
174
|
+
ipv6[4] === 0 &&
|
|
175
|
+
ipv6[5] === 0xffff;
|
|
176
|
+
const isIpv4Compat = ipv6[0] === 0 &&
|
|
177
|
+
ipv6[1] === 0 &&
|
|
178
|
+
ipv6[2] === 0 &&
|
|
179
|
+
ipv6[3] === 0 &&
|
|
180
|
+
ipv6[4] === 0 &&
|
|
181
|
+
ipv6[5] === 0 &&
|
|
182
|
+
(ipv6[6] !== 0 || ipv6[7] > 1);
|
|
183
|
+
if (isIpv4Mapped || isIpv4Compat) {
|
|
184
|
+
const mappedIpv4 = [
|
|
185
|
+
(ipv6[6] >> 8) & 0xff,
|
|
186
|
+
ipv6[6] & 0xff,
|
|
187
|
+
(ipv6[7] >> 8) & 0xff,
|
|
188
|
+
ipv6[7] & 0xff
|
|
189
|
+
].join('.');
|
|
190
|
+
if (isBlockedIpv4(mappedIpv4)) {
|
|
191
|
+
throw new Error(`Blocked cloud metadata / link-local upstream host "${parsed.hostname}".`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return parsed;
|
|
196
|
+
}
|
|
197
|
+
const safeUpstreamFetch = (url, init) => {
|
|
198
|
+
validateUpstreamUrl(typeof url === 'string' ? url : url.toString());
|
|
199
|
+
return fetch(url, { ...init, redirect: 'error' });
|
|
200
|
+
};
|
|
201
|
+
function buildRemoteTransport(urlStr, kind, headers) {
|
|
202
|
+
const endpoint = validateUpstreamUrl(urlStr);
|
|
203
|
+
const requestInit = {
|
|
204
|
+
...(headers ? { headers } : {}),
|
|
205
|
+
redirect: 'error'
|
|
206
|
+
};
|
|
207
|
+
if (kind === 'sse') {
|
|
208
|
+
return new SSEClientTransport(endpoint, { requestInit, fetch: safeUpstreamFetch });
|
|
209
|
+
}
|
|
210
|
+
return new StreamableHTTPClientTransport(endpoint, { requestInit, fetch: safeUpstreamFetch });
|
|
211
|
+
}
|
|
212
|
+
async function connectWithTransport(transport, connectTimeoutMs) {
|
|
213
|
+
const client = new Client({ name: 'slimmcp-proxy-client', version: SLIMMCP_VERSION }, { capabilities: {} });
|
|
214
|
+
try {
|
|
215
|
+
await withTimeout(client.connect(transport, { timeout: connectTimeoutMs }), connectTimeoutMs, 'Upstream connect');
|
|
216
|
+
const listResult = await withTimeout(client.listTools(undefined, { timeout: connectTimeoutMs }), connectTimeoutMs, 'Upstream listTools');
|
|
217
|
+
const tools = (listResult.tools ?? []).map((t) => ({
|
|
218
|
+
name: t.name,
|
|
219
|
+
description: t.description,
|
|
220
|
+
inputSchema: t.inputSchema ?? {
|
|
221
|
+
type: 'object',
|
|
222
|
+
properties: {}
|
|
223
|
+
}
|
|
224
|
+
}));
|
|
225
|
+
return { client, tools };
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
await client.close().catch(() => { });
|
|
229
|
+
await transport.close().catch(() => { });
|
|
230
|
+
throw err;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export class UpstreamManager {
|
|
234
|
+
connections = new Map();
|
|
235
|
+
defaultConnectTimeoutMs;
|
|
236
|
+
defaultRequestTimeoutMs;
|
|
237
|
+
constructor(options) {
|
|
238
|
+
this.defaultConnectTimeoutMs = options?.connectTimeoutMs ?? DEFAULT_CONNECT_TIMEOUT_MS;
|
|
239
|
+
this.defaultRequestTimeoutMs = options?.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
240
|
+
}
|
|
241
|
+
async connectAll(configs) {
|
|
242
|
+
const results = [];
|
|
243
|
+
for (const cfg of configs) {
|
|
244
|
+
const connectTimeoutMs = cfg.connectTimeoutMs ?? this.defaultConnectTimeoutMs;
|
|
245
|
+
const requestTimeoutMs = cfg.requestTimeoutMs ?? this.defaultRequestTimeoutMs;
|
|
246
|
+
let transport;
|
|
247
|
+
let connected;
|
|
248
|
+
if (cfg.url) {
|
|
249
|
+
const preferred = cfg.transport === 'sse' ? 'sse' : 'streamable-http';
|
|
250
|
+
transport = buildRemoteTransport(cfg.url, preferred, cfg.headers);
|
|
251
|
+
try {
|
|
252
|
+
connected = await connectWithTransport(transport, connectTimeoutMs);
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
// If transport wasn't pinned to 'streamable-http', retry once with legacy SSE transport
|
|
256
|
+
if (cfg.transport === undefined) {
|
|
257
|
+
await transport.close().catch(() => { });
|
|
258
|
+
transport = buildRemoteTransport(cfg.url, 'sse', cfg.headers);
|
|
259
|
+
connected = await connectWithTransport(transport, connectTimeoutMs);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
throw err;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
if (!cfg.command) {
|
|
268
|
+
throw new Error(`Upstream "${cfg.id}" requires either "command" or "url".`);
|
|
269
|
+
}
|
|
270
|
+
const isolatedEnv = buildIsolatedChildEnv(cfg.env, cfg.envAllowlist);
|
|
271
|
+
const stdioTransport = new StdioClientTransport({
|
|
272
|
+
command: cfg.command,
|
|
273
|
+
args: cfg.args ?? [],
|
|
274
|
+
env: isolatedEnv,
|
|
275
|
+
cwd: cfg.cwd,
|
|
276
|
+
stderr: 'pipe'
|
|
277
|
+
});
|
|
278
|
+
// Drain piped stderr so noisy upstreams never deadlock on full pipe buffers
|
|
279
|
+
stdioTransport.stderr?.on('data', () => { });
|
|
280
|
+
transport = stdioTransport;
|
|
281
|
+
connected = await connectWithTransport(transport, connectTimeoutMs);
|
|
282
|
+
}
|
|
283
|
+
this.connections.set(cfg.id, {
|
|
284
|
+
config: cfg,
|
|
285
|
+
client: connected.client,
|
|
286
|
+
transport,
|
|
287
|
+
tools: connected.tools,
|
|
288
|
+
requestTimeoutMs
|
|
289
|
+
});
|
|
290
|
+
results.push({ serverId: cfg.id, tools: connected.tools });
|
|
291
|
+
}
|
|
292
|
+
return results;
|
|
293
|
+
}
|
|
294
|
+
async callTool(serverId, toolName, args) {
|
|
295
|
+
const conn = this.connections.get(serverId);
|
|
296
|
+
if (!conn) {
|
|
297
|
+
throw new Error(`Unknown upstream server "${serverId}".`);
|
|
298
|
+
}
|
|
299
|
+
const result = await withTimeout(conn.client.callTool({
|
|
300
|
+
name: toolName,
|
|
301
|
+
arguments: args
|
|
302
|
+
}, undefined, { timeout: conn.requestTimeoutMs }), conn.requestTimeoutMs, `Upstream callTool "${serverId}:${toolName}"`);
|
|
303
|
+
return result;
|
|
304
|
+
}
|
|
305
|
+
async closeAll() {
|
|
306
|
+
for (const conn of this.connections.values()) {
|
|
307
|
+
try {
|
|
308
|
+
await conn.client.close();
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
// Ignore teardown errors during shutdown
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
this.connections.clear();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=upstream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream.js","sourceRoot":"","sources":["../../src/upstream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAGnG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AACjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM;IACN,MAAM;IACN,aAAa;IACb,YAAY;IACZ,SAAS;IACT,KAAK;IACL,MAAM;IACN,MAAM;IACN,UAAU;CACF,CAAC;AAeX;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAoC,EACpC,YAAuB,EACvB,YAA+B,OAAO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,IAAI,CAAC,MAAM,CAAC,QAAQ,CAClB;YACE,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;SAChB,EACD,SAAS,EACT,EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,CACnC,EACD,IAAI,CAAC,gBAAgB,EACrB,sBAAsB,QAAQ,IAAI,QAAQ,GAAG,CAC9C,CAAC;QACF,OAAO,MAGN,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7C,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC5B,CAAC;YAAC,MAAM,CAAC;gBACP,yCAAyC;YAC3C,CAAC;QACH,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SLIMMCP_VERSION: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
function resolvePackageVersion() {
|
|
3
|
+
const candidates = [
|
|
4
|
+
new URL('../../package.json', import.meta.url),
|
|
5
|
+
new URL('../package.json', import.meta.url)
|
|
6
|
+
];
|
|
7
|
+
for (const url of candidates) {
|
|
8
|
+
try {
|
|
9
|
+
if (existsSync(url)) {
|
|
10
|
+
const pkg = JSON.parse(readFileSync(url, 'utf8'));
|
|
11
|
+
if (typeof pkg.version === 'string' && pkg.version.length > 0) {
|
|
12
|
+
return pkg.version;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Try next candidate
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return '1.0.2';
|
|
21
|
+
}
|
|
22
|
+
export const SLIMMCP_VERSION = resolvePackageVersion();
|
|
23
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,SAAS,qBAAqB;IAC5B,MAAM,UAAU,GAAG;QACjB,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC9C,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;KAC5C,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAyB,CAAC;gBAC1E,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC9D,OAAO,GAAG,CAAC,OAAO,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,qBAAqB;QACvB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slimmcp-proxy",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"mcpName": "io.github.apexhive-hq/slimmcp-proxy",
|
|
5
|
+
"description": "Free MIT progressive-disclosure Meta-MCP proxy supporting stdio, Streamable-HTTP, and SSE upstreams with BM25 discovery, secret redaction, and RBAC policy guardrails.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/apexhive-hq/slimmcp-proxy.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/apexhive-hq/slimmcp-proxy",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"bin": {
|
|
14
|
+
"slimmcp-proxy": "dist/src/cli.js"
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/src/index.js",
|
|
17
|
+
"types": "./dist/src/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"slimmcp.config.example.json",
|
|
22
|
+
"slimmcp.policy.example.json"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22.13.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p tsconfig.json",
|
|
29
|
+
"build:prod": "tsc -p tsconfig.build.json",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
31
|
+
"test": "pnpm run build && node --test dist/tests/*.test.js",
|
|
32
|
+
"benchmark": "pnpm run build && node dist/src/cli.js benchmark --config slimmcp.benchmark.config.json"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
36
|
+
"zod": "^3.25.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^24.0.0",
|
|
40
|
+
"typescript": "^5.8.3"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"servers": [
|
|
3
|
+
{
|
|
4
|
+
"id": "filesystem",
|
|
5
|
+
"command": "npx",
|
|
6
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/abs/path/to/workspace"],
|
|
7
|
+
"connectTimeoutMs": 15000,
|
|
8
|
+
"requestTimeoutMs": 30000
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "remote-docs",
|
|
12
|
+
"transport": "streamable-http",
|
|
13
|
+
"url": "https://mcp.example.com/mcp",
|
|
14
|
+
"headers": {
|
|
15
|
+
"Authorization": "Bearer YOUR_MCP_TOKEN"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"redaction": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"redactInputs": true,
|
|
22
|
+
"redactOutputs": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"defaultAction": "allow",
|
|
3
|
+
"sessionLimits": {
|
|
4
|
+
"maxCallsPerSession": 100,
|
|
5
|
+
"maxX402AtomicUsdcPerSession": 1000000
|
|
6
|
+
},
|
|
7
|
+
"rules": [
|
|
8
|
+
{
|
|
9
|
+
"pattern": "*:delete_*",
|
|
10
|
+
"action": "deny"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"pattern": "finance:pay_x402*",
|
|
14
|
+
"action": "allow",
|
|
15
|
+
"maxCallsPerSession": 5,
|
|
16
|
+
"estimatedX402AtomicUsdc": 10000
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|