mcpbox 0.3.1 → 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 +2 -1
- package/dist/auth/oauth.d.ts +2 -1
- package/dist/auth/oauth.js +7 -8
- package/dist/config/schema.d.ts +1 -31
- package/dist/config/schema.js +2 -2
- package/dist/config/types.d.ts +1 -5
- package/dist/mcp/manager.d.ts +0 -10
- package/package.json +12 -5
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.svg">
|
|
4
4
|
<img src="assets/logo.svg" width="128" alt="MCPBox">
|
|
5
5
|
</picture>
|
|
6
|
+
<br>
|
|
7
|
+
<a href="https://www.npmjs.com/package/mcpbox"><img src="https://img.shields.io/npm/v/mcpbox?style=flat-square" alt="npm version"></a>
|
|
6
8
|
</p>
|
|
7
9
|
|
|
8
10
|
**MCPBox** is a lightweight gateway that exposes local stdio-based [MCP](https://modelcontextprotocol.io) servers via Streamable HTTP, enabling Claude and other AI agents to connect from anywhere.
|
|
@@ -49,7 +51,6 @@ Add to your MCP client config:
|
|
|
49
51
|
{
|
|
50
52
|
"mcpServers": {
|
|
51
53
|
"mcpbox": {
|
|
52
|
-
"type": "http",
|
|
53
54
|
"url": "http://localhost:8080"
|
|
54
55
|
}
|
|
55
56
|
}
|
package/dist/auth/oauth.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Context } from "hono";
|
|
|
2
2
|
import type { OAuthClient } from "../config/types.js";
|
|
3
3
|
import type { StateStore } from "../storage/types.js";
|
|
4
4
|
import type { IdentityProvider } from "./providers/identity-provider.js";
|
|
5
|
-
|
|
5
|
+
interface OAuthConfig {
|
|
6
6
|
issuer: string;
|
|
7
7
|
providers: IdentityProvider[];
|
|
8
8
|
clients?: OAuthClient[];
|
|
@@ -35,3 +35,4 @@ export declare class OAuthServer {
|
|
|
35
35
|
};
|
|
36
36
|
sendUnauthorized(c: Context, error?: string): Response;
|
|
37
37
|
}
|
|
38
|
+
export {};
|
package/dist/auth/oauth.js
CHANGED
|
@@ -406,7 +406,10 @@ export class OAuthServer {
|
|
|
406
406
|
box-sizing: border-box;
|
|
407
407
|
}
|
|
408
408
|
body {
|
|
409
|
-
font-family:
|
|
409
|
+
font-family:
|
|
410
|
+
system-ui,
|
|
411
|
+
-apple-system,
|
|
412
|
+
sans-serif;
|
|
410
413
|
background: #fafaf9;
|
|
411
414
|
margin: 0;
|
|
412
415
|
padding: 20px;
|
|
@@ -426,8 +429,8 @@ export class OAuthServer {
|
|
|
426
429
|
max-width: 380px;
|
|
427
430
|
}
|
|
428
431
|
h1 {
|
|
429
|
-
font-family:
|
|
430
|
-
monospace;
|
|
432
|
+
font-family:
|
|
433
|
+
ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
|
|
431
434
|
font-size: 28px;
|
|
432
435
|
font-weight: 600;
|
|
433
436
|
color: #1c1917;
|
|
@@ -562,11 +565,7 @@ export class OAuthServer {
|
|
|
562
565
|
${hasForm && hasRedirect ? html `<div class="divider">or</div>` : ""}
|
|
563
566
|
${hasForm
|
|
564
567
|
? html `<form method="POST" action="${formAction}">
|
|
565
|
-
<input
|
|
566
|
-
type="hidden"
|
|
567
|
-
name="session_id"
|
|
568
|
-
value="${sessionId}"
|
|
569
|
-
/>
|
|
568
|
+
<input type="hidden" name="session_id" value="${sessionId}" />
|
|
570
569
|
<div class="field">
|
|
571
570
|
<label for="username">Username</label>
|
|
572
571
|
<input
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -19,28 +19,6 @@ export declare const OAuthUserSchema: z.ZodObject<{
|
|
|
19
19
|
username: z.ZodString;
|
|
20
20
|
password: z.ZodString;
|
|
21
21
|
}, z.core.$strict>;
|
|
22
|
-
/**
|
|
23
|
-
* Local identity provider — users defined in config.
|
|
24
|
-
* @package
|
|
25
|
-
*/
|
|
26
|
-
export declare const LocalIdPSchema: z.ZodObject<{
|
|
27
|
-
type: z.ZodLiteral<"local">;
|
|
28
|
-
users: z.ZodArray<z.ZodObject<{
|
|
29
|
-
username: z.ZodString;
|
|
30
|
-
password: z.ZodString;
|
|
31
|
-
}, z.core.$strict>>;
|
|
32
|
-
}, z.core.$strict>;
|
|
33
|
-
/**
|
|
34
|
-
* GitHub identity provider — OAuth web flow.
|
|
35
|
-
* @package
|
|
36
|
-
*/
|
|
37
|
-
export declare const GitHubIdPSchema: z.ZodObject<{
|
|
38
|
-
type: z.ZodLiteral<"github">;
|
|
39
|
-
clientId: z.ZodString;
|
|
40
|
-
clientSecret: z.ZodString;
|
|
41
|
-
allowedOrgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
-
allowedUsers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
-
}, z.core.$strict>;
|
|
44
22
|
/**
|
|
45
23
|
* Identity provider configuration — discriminated union.
|
|
46
24
|
* @package
|
|
@@ -292,17 +270,9 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
292
270
|
prompts: z.ZodOptional<z.ZodBoolean>;
|
|
293
271
|
}, z.core.$strip>>;
|
|
294
272
|
}, z.core.$strip>;
|
|
295
|
-
export type McpServerEntry = z.infer<typeof McpServerEntrySchema>;
|
|
296
|
-
export type OAuthUser = z.infer<typeof OAuthUserSchema>;
|
|
297
273
|
export type OAuthClient = z.infer<typeof OAuthClientSchema>;
|
|
298
|
-
export type IdentityProviderConfig = z.infer<typeof IdentityProviderSchema>;
|
|
299
|
-
export type LocalIdPConfig = z.infer<typeof LocalIdPSchema>;
|
|
300
|
-
export type GitHubIdPConfig = z.infer<typeof GitHubIdPSchema>;
|
|
301
|
-
export type AuthConfig = z.infer<typeof AuthConfigSchema>;
|
|
302
|
-
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
303
274
|
export type LogConfig = z.infer<typeof LogConfigSchema>;
|
|
304
|
-
export type
|
|
305
|
-
export type RawConfig = z.infer<typeof RawConfigSchema>;
|
|
275
|
+
export type McpServerEntry = z.infer<typeof McpServerEntrySchema>;
|
|
306
276
|
export type McpConfig = z.infer<typeof McpConfigSchema>;
|
|
307
277
|
export type Config = z.infer<typeof ConfigSchema>;
|
|
308
278
|
export interface LoadConfigResult {
|
package/dist/config/schema.js
CHANGED
|
@@ -35,7 +35,7 @@ export const OAuthUserSchema = z
|
|
|
35
35
|
* Local identity provider — users defined in config.
|
|
36
36
|
* @package
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
const LocalIdPSchema = z
|
|
39
39
|
.object({
|
|
40
40
|
type: z.literal("local"),
|
|
41
41
|
users: z.array(OAuthUserSchema).min(1, "At least one user is required"),
|
|
@@ -45,7 +45,7 @@ export const LocalIdPSchema = z
|
|
|
45
45
|
* GitHub identity provider — OAuth web flow.
|
|
46
46
|
* @package
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
const GitHubIdPSchema = z
|
|
49
49
|
.object({
|
|
50
50
|
type: z.literal("github"),
|
|
51
51
|
clientId: z.string().min(1, "GitHub clientId is required"),
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type GrantType = "authorization_code" | "client_credentials";
|
|
3
|
-
export type McpServersConfig = {
|
|
4
|
-
mcpServers: Record<string, import("./schema.js").McpServerEntry>;
|
|
5
|
-
};
|
|
1
|
+
export type { Config, LogConfig, McpConfig, OAuthClient } from "./schema.js";
|
package/dist/mcp/manager.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
|
-
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
1
|
import type { CallToolRequestParams, CallToolResult, CompleteRequestParams, CompleteResult, GetPromptRequestParams, GetPromptResult, Prompt, ReadResourceRequestParams, ReadResourceResult, Resource, Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
4
2
|
import type { LogConfig, McpConfig } from "../config/types.js";
|
|
5
|
-
export interface ManagedMcp {
|
|
6
|
-
name: string;
|
|
7
|
-
client: Client;
|
|
8
|
-
transport: StdioClientTransport;
|
|
9
|
-
tools: Tool[];
|
|
10
|
-
resources: Resource[];
|
|
11
|
-
prompts: Prompt[];
|
|
12
|
-
}
|
|
13
3
|
export declare class McpManager {
|
|
14
4
|
private mcps;
|
|
15
5
|
private toolToMcp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpbox",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "A lightweight gateway that exposes local stdio-based MCP servers via Streamable HTTP",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
"test:conformance:mcp": "node --disable-warning=ExperimentalWarning --import tsx test/conformance-mcp/run.ts",
|
|
18
18
|
"test:conformance:oauth": "node --disable-warning=ExperimentalWarning --import tsx --test --test-concurrency=1 'test/conformance-oauth/**/*.test.ts'",
|
|
19
19
|
"test:coverage": "node --experimental-test-coverage --disable-warning=ExperimentalWarning --import tsx --test --test-concurrency=1 'test/unit/**/*.test.ts' 'test/integration/**/*.test.ts' 'test/conformance-oauth/**/*.test.ts'",
|
|
20
|
+
"test:mutation": "stryker run",
|
|
20
21
|
"format": "biome check --write .",
|
|
21
22
|
"check": "biome check .",
|
|
23
|
+
"knip": "knip",
|
|
22
24
|
"docs:dev": "vitepress dev docs",
|
|
23
25
|
"docs:build": "vitepress build docs",
|
|
24
26
|
"docs:preview": "vitepress preview docs"
|
|
@@ -53,18 +55,23 @@
|
|
|
53
55
|
"type": "module",
|
|
54
56
|
"dependencies": {
|
|
55
57
|
"@hono/node-server": "^1.19.9",
|
|
56
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
58
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
57
59
|
"bcryptjs": "^3.0.0",
|
|
58
|
-
"hono": "^4.
|
|
60
|
+
"hono": "^4.12.7",
|
|
59
61
|
"pino": "^10.3.0",
|
|
60
62
|
"pino-pretty": "^13.1.3",
|
|
61
63
|
"zod": "^4.3.6"
|
|
62
64
|
},
|
|
63
65
|
"devDependencies": {
|
|
64
|
-
"@biomejs/biome": "^2.
|
|
66
|
+
"@biomejs/biome": "^2.4.7",
|
|
67
|
+
"@stryker-mutator/core": "^9.6.0",
|
|
68
|
+
"@stryker-mutator/tap-runner": "^9.6.0",
|
|
69
|
+
"@stryker-mutator/typescript-checker": "^9.6.0",
|
|
65
70
|
"@types/node": "^25.1.0",
|
|
71
|
+
"knip": "^5.86.0",
|
|
66
72
|
"tsx": "^4.21.0",
|
|
67
73
|
"typescript": "^5.9.3",
|
|
68
|
-
"vitepress": "^1.6.4"
|
|
74
|
+
"vitepress": "^1.6.4",
|
|
75
|
+
"vitepress-plugin-llms": "^1.11.0"
|
|
69
76
|
}
|
|
70
77
|
}
|