cbrowser 18.3.7 → 18.3.9
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CBrowser — Cognitive Browser Automation
|
|
2
2
|
|
|
3
|
-
> **The browser automation that thinks.**
|
|
3
|
+
> **The browser automation that thinks.** Achieved **Grade A+** in comprehensive stress testing—100% pass rate across 68+ tools, zero critical bugs, zero server crashes. [View Full Assessment →](docs/STRESS-TEST-v16.14.4.md)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/cbrowser)
|
|
6
6
|
[](https://cbrowser.ai/docs)
|
|
@@ -18,7 +18,7 @@ Sites that pass CBrowser's cognitive tests are easier for both humans **and** AI
|
|
|
18
18
|
|
|
19
19
|
## What Makes CBrowser Different
|
|
20
20
|
|
|
21
|
-
**68 tools,
|
|
21
|
+
**68 tools, 17 cognitive personas, 25 research-backed traits.** After rigorous stress testing across production sites including Airbnb and Hacker News:
|
|
22
22
|
|
|
23
23
|
| Capability | Status | Why It Matters |
|
|
24
24
|
|------------|--------|----------------|
|
|
@@ -460,23 +460,18 @@ See [Marketing Suite Wiki](https://github.com/alexandriashai/cbrowser/wiki/Marke
|
|
|
460
460
|
|
|
461
461
|
## License
|
|
462
462
|
|
|
463
|
-
**MIT License
|
|
463
|
+
**MIT License** — Free and open source.
|
|
464
464
|
|
|
465
|
-
|
|
466
|
-
- ✅ Read, modify, and contribute to the source
|
|
467
|
-
- ⚠️ Production use (including production testing pipelines) requires a commercial license
|
|
468
|
-
|
|
469
|
-
**Note:** Non-production use means evaluation of CBrowser itself, not using CBrowser as part of a production testing service.
|
|
470
|
-
|
|
471
|
-
Converts to **Apache 2.0** on February 5, 2030.
|
|
472
|
-
|
|
473
|
-
For commercial licensing: [alexandria.shai.eden@gmail.com](mailto:alexandria.shai.eden@gmail.com)
|
|
465
|
+
Use, modify, and distribute freely for any purpose, including commercial and production use. See [LICENSE](LICENSE) for full terms.
|
|
474
466
|
|
|
475
467
|
---
|
|
476
468
|
|
|
477
469
|
## Copyright
|
|
478
470
|
|
|
479
|
-
© 2026 Alexandria Eden
|
|
471
|
+
© 2026 Alexandria Eden
|
|
472
|
+
|
|
473
|
+
Contact: [alexandria.shai.eden@gmail.com](mailto:alexandria.shai.eden@gmail.com)
|
|
474
|
+
Website: [cbrowser.ai](https://cbrowser.ai)
|
|
480
475
|
|
|
481
476
|
---
|
|
482
477
|
|
|
@@ -494,4 +489,4 @@ For commercial licensing: [alexandria.shai.eden@gmail.com](mailto:alexandria.sha
|
|
|
494
489
|
- [Research Methodology](https://cbrowser.ai/docs/Research-Methodology) — How 25 traits were selected and validated
|
|
495
490
|
- [Trait Index](https://cbrowser.ai/docs/Trait-Index) — All cognitive traits with citations
|
|
496
491
|
- [Bibliography](https://cbrowser.ai/docs/Bibliography) — Complete academic references
|
|
497
|
-
- [Persona Index](https://cbrowser.ai/docs/Persona-Index) — All
|
|
492
|
+
- [Persona Index](https://cbrowser.ai/docs/Persona-Index) — All 17 built-in personas
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cbrowser",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cognitive browser automation that thinks like your users—and helps AI agents navigate too. Simulate real user cognition with abandonment detection, constitutional safety, chaos engineering, and UX friction discovery. Sites that pass CBrowser's cognitive tests are easier for both humans and AI agents to navigate.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CBrowser - Cognitive Browser Automation
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2026 WF Media (Alexandria Eden)
|
|
6
|
-
* Email: alexandria.shai.eden@gmail.com
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the Business Source License 1.1
|
|
9
|
-
* found in the LICENSE file in the root directory of this source tree.
|
|
10
|
-
*
|
|
11
|
-
* Non-production use is permitted. Production use requires a commercial license.
|
|
12
|
-
* See LICENSE for full terms.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* CBrowser MCP Server with Native SDK OAuth Authentication
|
|
16
|
-
*
|
|
17
|
-
* Uses the official MCP SDK auth router (Express-based) with ProxyOAuthServerProvider
|
|
18
|
-
* for RFC-compliant OAuth 2.1 integration with Auth0 or other providers.
|
|
19
|
-
*
|
|
20
|
-
* Run with: cbrowser mcp-native-auth
|
|
21
|
-
* Or: npx cbrowser mcp-native-auth
|
|
22
|
-
*
|
|
23
|
-
* Environment variables:
|
|
24
|
-
* PORT - Port to listen on (default: 3000)
|
|
25
|
-
* HOST - Host to bind to (default: 0.0.0.0)
|
|
26
|
-
* MCP_SERVER_URL - Public URL of this server (required for OAuth metadata)
|
|
27
|
-
*
|
|
28
|
-
* Auth0 OAuth Environment Variables:
|
|
29
|
-
* AUTH0_DOMAIN - Your Auth0 tenant domain (e.g., 'your-tenant.auth0.com')
|
|
30
|
-
* AUTH0_AUDIENCE - API audience/identifier (e.g., 'https://your-server.com')
|
|
31
|
-
* AUTH0_CLIENT_ID - Optional: Client ID for static registration
|
|
32
|
-
*/
|
|
33
|
-
import express from "express";
|
|
34
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
35
|
-
import { ProxyOAuthServerProvider } from "@modelcontextprotocol/sdk/server/auth/providers/proxyProvider.js";
|
|
36
|
-
declare function createMcpServer(): McpServer;
|
|
37
|
-
declare function createProxyOAuthProvider(): ProxyOAuthServerProvider | null;
|
|
38
|
-
declare function createApp(): express.Application;
|
|
39
|
-
export { createApp, createMcpServer, createProxyOAuthProvider };
|
|
40
|
-
//# sourceMappingURL=mcp-server-native-auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-native-auth.d.ts","sourceRoot":"","sources":["../src/mcp-server-native-auth.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,OAA4C,MAAM,SAAS,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,wBAAwB,EAAqB,MAAM,kEAAkE,CAAC;AAmJ/H,iBAAS,eAAe,IAAI,SAAS,CAoFpC;AAMD,iBAAS,wBAAwB,IAAI,wBAAwB,GAAG,IAAI,CAiCnE;AAMD,iBAAS,SAAS,IAAI,OAAO,CAAC,WAAW,CA2FxC;AA+DD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CBrowser - Cognitive Browser Automation
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2026 WF Media (Alexandria Eden)
|
|
6
|
-
* Email: alexandria.shai.eden@gmail.com
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the Business Source License 1.1
|
|
9
|
-
* found in the LICENSE file in the root directory of this source tree.
|
|
10
|
-
*
|
|
11
|
-
* Non-production use is permitted. Production use requires a commercial license.
|
|
12
|
-
* See LICENSE for full terms.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* CBrowser MCP Server with Native SDK OAuth Authentication
|
|
16
|
-
*
|
|
17
|
-
* Uses the official MCP SDK auth router (Express-based) with ProxyOAuthServerProvider
|
|
18
|
-
* for RFC-compliant OAuth 2.1 integration with Auth0 or other providers.
|
|
19
|
-
*
|
|
20
|
-
* Run with: cbrowser mcp-native-auth
|
|
21
|
-
* Or: npx cbrowser mcp-native-auth
|
|
22
|
-
*
|
|
23
|
-
* Environment variables:
|
|
24
|
-
* PORT - Port to listen on (default: 3000)
|
|
25
|
-
* HOST - Host to bind to (default: 0.0.0.0)
|
|
26
|
-
* MCP_SERVER_URL - Public URL of this server (required for OAuth metadata)
|
|
27
|
-
*
|
|
28
|
-
* Auth0 OAuth Environment Variables:
|
|
29
|
-
* AUTH0_DOMAIN - Your Auth0 tenant domain (e.g., 'your-tenant.auth0.com')
|
|
30
|
-
* AUTH0_AUDIENCE - API audience/identifier (e.g., 'https://your-server.com')
|
|
31
|
-
* AUTH0_CLIENT_ID - Optional: Client ID for static registration
|
|
32
|
-
*/
|
|
33
|
-
import express from "express";
|
|
34
|
-
import { createServer } from "node:http";
|
|
35
|
-
import { createRemoteJWKSet, jwtVerify } from "jose";
|
|
36
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
37
|
-
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
38
|
-
import { mcpAuthRouter } from "@modelcontextprotocol/sdk/server/auth/router.js";
|
|
39
|
-
import { ProxyOAuthServerProvider } from "@modelcontextprotocol/sdk/server/auth/providers/proxyProvider.js";
|
|
40
|
-
import { z } from "zod";
|
|
41
|
-
import { CBrowser } from "./browser.js";
|
|
42
|
-
import { ensureDirectories, getStatusInfo, getSessionId } from "./config.js";
|
|
43
|
-
// Version from package.json
|
|
44
|
-
const VERSION = "16.14.5";
|
|
45
|
-
// =========================================================================
|
|
46
|
-
// Configuration
|
|
47
|
-
// =========================================================================
|
|
48
|
-
const PORT = parseInt(process.env.PORT || "3000", 10);
|
|
49
|
-
const HOST = process.env.HOST || "0.0.0.0";
|
|
50
|
-
const SERVER_URL = process.env.MCP_SERVER_URL || `http://localhost:${PORT}`;
|
|
51
|
-
// Token cache to avoid hitting Auth0 rate limits
|
|
52
|
-
const tokenCache = new Map();
|
|
53
|
-
const TOKEN_CACHE_TTL = 30 * 60 * 1000; // 30 minutes
|
|
54
|
-
let auth0Config = null;
|
|
55
|
-
function getAuth0Config() {
|
|
56
|
-
const domain = process.env.AUTH0_DOMAIN;
|
|
57
|
-
const audience = process.env.AUTH0_AUDIENCE;
|
|
58
|
-
if (!domain || !audience) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
if (!auth0Config || auth0Config.domain !== domain) {
|
|
62
|
-
auth0Config = {
|
|
63
|
-
domain,
|
|
64
|
-
audience,
|
|
65
|
-
clientId: process.env.AUTH0_CLIENT_ID,
|
|
66
|
-
jwks: createRemoteJWKSet(new URL(`https://${domain}/.well-known/jwks.json`)),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
return auth0Config;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Validate Auth0 token - supports both JWT and opaque tokens with caching
|
|
73
|
-
*/
|
|
74
|
-
async function validateAuth0Token(token) {
|
|
75
|
-
const config = getAuth0Config();
|
|
76
|
-
if (!config) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
// Check cache first (use first 32 chars of token as key for security)
|
|
80
|
-
const cacheKey = token.substring(0, 32);
|
|
81
|
-
const cached = tokenCache.get(cacheKey);
|
|
82
|
-
if (cached && cached.expires > Date.now()) {
|
|
83
|
-
return {
|
|
84
|
-
token,
|
|
85
|
-
clientId: cached.payload.azp || "unknown",
|
|
86
|
-
scopes: cached.payload.scope?.split(" ") || [],
|
|
87
|
-
expiresAt: cached.payload.exp ? cached.payload.exp * 1000 : undefined,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const tokenParts = token.split(".");
|
|
91
|
-
// If it's a proper JWT (3 parts), validate locally
|
|
92
|
-
if (tokenParts.length === 3) {
|
|
93
|
-
try {
|
|
94
|
-
const { payload } = await jwtVerify(token, config.jwks, {
|
|
95
|
-
issuer: `https://${config.domain}/`,
|
|
96
|
-
audience: config.audience,
|
|
97
|
-
});
|
|
98
|
-
console.log("[Auth] JWT validated successfully for subject:", payload.sub);
|
|
99
|
-
// Cache the result
|
|
100
|
-
tokenCache.set(cacheKey, { payload, expires: Date.now() + TOKEN_CACHE_TTL });
|
|
101
|
-
return {
|
|
102
|
-
token,
|
|
103
|
-
clientId: payload.azp || "unknown",
|
|
104
|
-
scopes: payload.scope?.split(" ") || [],
|
|
105
|
-
expiresAt: payload.exp ? payload.exp * 1000 : undefined,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
console.error("[Auth] JWT validation failed:", error instanceof Error ? error.message : error);
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
// For opaque/JWE tokens, validate via Auth0's userinfo endpoint
|
|
114
|
-
console.log("[Auth] Opaque token detected, validating via Auth0 userinfo...");
|
|
115
|
-
try {
|
|
116
|
-
const response = await fetch(`https://${config.domain}/userinfo`, {
|
|
117
|
-
headers: {
|
|
118
|
-
Authorization: `Bearer ${token}`,
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
if (response.ok) {
|
|
122
|
-
const userinfo = await response.json();
|
|
123
|
-
console.log("[Auth] Token validated via userinfo for:", userinfo.sub || userinfo.email);
|
|
124
|
-
// Cache the result
|
|
125
|
-
tokenCache.set(cacheKey, { payload: userinfo, expires: Date.now() + TOKEN_CACHE_TTL });
|
|
126
|
-
return {
|
|
127
|
-
token,
|
|
128
|
-
clientId: userinfo.sub || "unknown",
|
|
129
|
-
scopes: [],
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
console.error("[Auth] Userinfo validation failed:", response.status, await response.text());
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
catch (error) {
|
|
138
|
-
console.error("[Auth] Userinfo request failed:", error instanceof Error ? error.message : error);
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
// =========================================================================
|
|
143
|
-
// Browser Instance Management
|
|
144
|
-
// =========================================================================
|
|
145
|
-
let browserInstance = null;
|
|
146
|
-
async function getBrowser() {
|
|
147
|
-
if (!browserInstance) {
|
|
148
|
-
browserInstance = new CBrowser({ headless: true });
|
|
149
|
-
await browserInstance.launch();
|
|
150
|
-
}
|
|
151
|
-
return browserInstance;
|
|
152
|
-
}
|
|
153
|
-
// =========================================================================
|
|
154
|
-
// Create MCP Server with Tools
|
|
155
|
-
// =========================================================================
|
|
156
|
-
function createMcpServer() {
|
|
157
|
-
const server = new McpServer({
|
|
158
|
-
name: "cbrowser",
|
|
159
|
-
version: VERSION,
|
|
160
|
-
});
|
|
161
|
-
// Register basic tools
|
|
162
|
-
server.tool("status", "Get CBrowser environment status", {}, async () => {
|
|
163
|
-
const info = await getStatusInfo(VERSION);
|
|
164
|
-
return {
|
|
165
|
-
content: [{ type: "text", text: JSON.stringify(info, null, 2) }],
|
|
166
|
-
};
|
|
167
|
-
});
|
|
168
|
-
server.tool("navigate", "Navigate to a URL", {
|
|
169
|
-
url: z.string().describe("URL to navigate to"),
|
|
170
|
-
}, async ({ url }) => {
|
|
171
|
-
const browser = await getBrowser();
|
|
172
|
-
await browser.navigate(url);
|
|
173
|
-
return {
|
|
174
|
-
content: [{ type: "text", text: `Navigated to ${url}` }],
|
|
175
|
-
};
|
|
176
|
-
});
|
|
177
|
-
server.tool("screenshot", "Take a screenshot of the current page", {
|
|
178
|
-
name: z.string().optional().describe("Screenshot filename"),
|
|
179
|
-
}, async ({ name }) => {
|
|
180
|
-
const browser = await getBrowser();
|
|
181
|
-
const paths = ensureDirectories();
|
|
182
|
-
const filename = name || `screenshot_${Date.now()}.png`;
|
|
183
|
-
const filepath = `${paths.screenshotsDir}/${filename}`;
|
|
184
|
-
await browser.screenshot(filepath);
|
|
185
|
-
return {
|
|
186
|
-
content: [{ type: "text", text: `Screenshot saved to ${filepath} (session: ${paths.sessionId})` }],
|
|
187
|
-
};
|
|
188
|
-
});
|
|
189
|
-
server.tool("click", "Click an element on the page", {
|
|
190
|
-
selector: z.string().describe("CSS selector or natural language description"),
|
|
191
|
-
}, async ({ selector }) => {
|
|
192
|
-
const browser = await getBrowser();
|
|
193
|
-
await browser.click(selector);
|
|
194
|
-
return {
|
|
195
|
-
content: [{ type: "text", text: `Clicked: ${selector}` }],
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
server.tool("fill", "Fill a form field", {
|
|
199
|
-
selector: z.string().describe("CSS selector or natural language description"),
|
|
200
|
-
value: z.string().describe("Value to fill"),
|
|
201
|
-
}, async ({ selector, value }) => {
|
|
202
|
-
const browser = await getBrowser();
|
|
203
|
-
await browser.fill(selector, value);
|
|
204
|
-
return {
|
|
205
|
-
content: [{ type: "text", text: `Filled ${selector} with value` }],
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
return server;
|
|
209
|
-
}
|
|
210
|
-
// =========================================================================
|
|
211
|
-
// Proxy OAuth Provider Setup
|
|
212
|
-
// =========================================================================
|
|
213
|
-
function createProxyOAuthProvider() {
|
|
214
|
-
const config = getAuth0Config();
|
|
215
|
-
if (!config) {
|
|
216
|
-
console.log("[Auth] No Auth0 configuration found, auth disabled");
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
const options = {
|
|
220
|
-
endpoints: {
|
|
221
|
-
authorizationUrl: `https://${config.domain}/authorize`,
|
|
222
|
-
tokenUrl: `https://${config.domain}/oauth/token`,
|
|
223
|
-
revocationUrl: `https://${config.domain}/oauth/revoke`,
|
|
224
|
-
registrationUrl: `https://${config.domain}/oidc/register`,
|
|
225
|
-
},
|
|
226
|
-
verifyAccessToken: async (token) => {
|
|
227
|
-
const result = await validateAuth0Token(token);
|
|
228
|
-
if (!result) {
|
|
229
|
-
throw new Error("Invalid access token");
|
|
230
|
-
}
|
|
231
|
-
return result;
|
|
232
|
-
},
|
|
233
|
-
getClient: async (clientId) => {
|
|
234
|
-
// For dynamic registration, we trust Auth0 to manage clients
|
|
235
|
-
// Return basic info for any client ID that Auth0 issued
|
|
236
|
-
return {
|
|
237
|
-
client_id: clientId,
|
|
238
|
-
client_name: "CBrowser Client",
|
|
239
|
-
redirect_uris: [],
|
|
240
|
-
};
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
return new ProxyOAuthServerProvider(options);
|
|
244
|
-
}
|
|
245
|
-
// =========================================================================
|
|
246
|
-
// Express App Setup
|
|
247
|
-
// =========================================================================
|
|
248
|
-
function createApp() {
|
|
249
|
-
const app = express();
|
|
250
|
-
// Trust proxy for accurate IP behind reverse proxy
|
|
251
|
-
app.set("trust proxy", true);
|
|
252
|
-
// CORS middleware
|
|
253
|
-
app.use((req, res, next) => {
|
|
254
|
-
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
255
|
-
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
|
256
|
-
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, MCP-Session-ID, X-API-Key");
|
|
257
|
-
res.setHeader("Access-Control-Expose-Headers", "MCP-Session-ID");
|
|
258
|
-
if (req.method === "OPTIONS") {
|
|
259
|
-
res.status(200).end();
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
next();
|
|
263
|
-
});
|
|
264
|
-
// Health check (always available)
|
|
265
|
-
app.get("/health", (_req, res) => {
|
|
266
|
-
res.json({
|
|
267
|
-
status: "ok",
|
|
268
|
-
version: VERSION,
|
|
269
|
-
session: getSessionId(),
|
|
270
|
-
timestamp: new Date().toISOString(),
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
// Server info (always available)
|
|
274
|
-
app.get("/info", (_req, res) => {
|
|
275
|
-
res.json({
|
|
276
|
-
name: "CBrowser MCP Server (Native Auth)",
|
|
277
|
-
version: VERSION,
|
|
278
|
-
description: "Cognitive Browser automation with native MCP SDK OAuth",
|
|
279
|
-
session: getSessionId(),
|
|
280
|
-
authEnabled: !!getAuth0Config(),
|
|
281
|
-
});
|
|
282
|
-
});
|
|
283
|
-
// Setup OAuth with native MCP SDK auth router
|
|
284
|
-
const provider = createProxyOAuthProvider();
|
|
285
|
-
if (provider) {
|
|
286
|
-
const serverUrl = new URL(SERVER_URL);
|
|
287
|
-
const config = getAuth0Config();
|
|
288
|
-
// Full OAuth server mode - proxies to Auth0
|
|
289
|
-
const authOptions = {
|
|
290
|
-
provider,
|
|
291
|
-
issuerUrl: new URL(`https://${config.domain}`),
|
|
292
|
-
baseUrl: serverUrl,
|
|
293
|
-
serviceDocumentationUrl: new URL("https://github.com/alexandriashai/cbrowser#readme"),
|
|
294
|
-
scopesSupported: ["openid", "profile", "cbrowser:read", "cbrowser:write"],
|
|
295
|
-
resourceName: "CBrowser MCP Server",
|
|
296
|
-
resourceServerUrl: serverUrl,
|
|
297
|
-
};
|
|
298
|
-
app.use(mcpAuthRouter(authOptions));
|
|
299
|
-
console.log("[Auth] Native MCP SDK OAuth router installed");
|
|
300
|
-
console.log(`[Auth] Authorization endpoint: ${serverUrl.href}authorize`);
|
|
301
|
-
console.log(`[Auth] Token endpoint: ${serverUrl.href}token`);
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
// No auth - expose protected resource metadata pointing to nothing
|
|
305
|
-
console.log("[Auth] No authentication configured - server is open");
|
|
306
|
-
}
|
|
307
|
-
// MCP endpoint
|
|
308
|
-
app.all("/mcp", express.raw({ type: "*/*" }), async (req, res) => {
|
|
309
|
-
try {
|
|
310
|
-
const transport = new StreamableHTTPServerTransport({
|
|
311
|
-
sessionIdGenerator: () => getSessionId(),
|
|
312
|
-
});
|
|
313
|
-
const server = createMcpServer();
|
|
314
|
-
await server.connect(transport);
|
|
315
|
-
// Handle the request
|
|
316
|
-
await transport.handleRequest(req, res, req.body);
|
|
317
|
-
}
|
|
318
|
-
catch (error) {
|
|
319
|
-
console.error("[MCP] Error handling request:", error);
|
|
320
|
-
res.status(500).json({ error: "Internal server error" });
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
// Root redirects to info
|
|
324
|
-
app.get("/", (_req, res) => {
|
|
325
|
-
res.redirect("/info");
|
|
326
|
-
});
|
|
327
|
-
return app;
|
|
328
|
-
}
|
|
329
|
-
// =========================================================================
|
|
330
|
-
// Main Entry Point
|
|
331
|
-
// =========================================================================
|
|
332
|
-
async function main() {
|
|
333
|
-
console.log(`
|
|
334
|
-
╔══════════════════════════════════════════════════════════════╗
|
|
335
|
-
║ CBrowser MCP Server (Native Auth) ║
|
|
336
|
-
║ v${VERSION} ║
|
|
337
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
338
|
-
`);
|
|
339
|
-
// Ensure directories exist
|
|
340
|
-
const paths = ensureDirectories();
|
|
341
|
-
console.log(`[Config] Data directory: ${paths.dataDir}`);
|
|
342
|
-
console.log(`[Config] Session ID: ${paths.sessionId}`);
|
|
343
|
-
console.log(`[Config] Screenshots: ${paths.screenshotsDir}`);
|
|
344
|
-
// Create and start Express app
|
|
345
|
-
const app = createApp();
|
|
346
|
-
const server = createServer(app);
|
|
347
|
-
server.listen(PORT, HOST, () => {
|
|
348
|
-
console.log(`
|
|
349
|
-
╔══════════════════════════════════════════════════════════════╗
|
|
350
|
-
║ MCP Server running at: http://${HOST}:${PORT}
|
|
351
|
-
║ Health check: http://${HOST}:${PORT}/health
|
|
352
|
-
║ MCP endpoint: http://${HOST}:${PORT}/mcp
|
|
353
|
-
║ Auth mode: ${getAuth0Config() ? "OAuth 2.1 (Auth0)" : "OPEN (no auth)"}
|
|
354
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
355
|
-
`);
|
|
356
|
-
});
|
|
357
|
-
// Graceful shutdown
|
|
358
|
-
process.on("SIGINT", async () => {
|
|
359
|
-
console.log("\n[Server] Shutting down...");
|
|
360
|
-
if (browserInstance) {
|
|
361
|
-
await browserInstance.close();
|
|
362
|
-
}
|
|
363
|
-
server.close();
|
|
364
|
-
process.exit(0);
|
|
365
|
-
});
|
|
366
|
-
process.on("SIGTERM", async () => {
|
|
367
|
-
console.log("\n[Server] Terminating...");
|
|
368
|
-
if (browserInstance) {
|
|
369
|
-
await browserInstance.close();
|
|
370
|
-
}
|
|
371
|
-
server.close();
|
|
372
|
-
process.exit(0);
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
// Run if executed directly
|
|
376
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
377
|
-
main().catch((error) => {
|
|
378
|
-
console.error("[Fatal]", error);
|
|
379
|
-
process.exit(1);
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
export { createApp, createMcpServer, createProxyOAuthProvider };
|
|
383
|
-
//# sourceMappingURL=mcp-server-native-auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-native-auth.js","sourceRoot":"","sources":["../src/mcp-server-native-auth.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,OAA4C,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAmB,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,aAAa,EAAiD,MAAM,iDAAiD,CAAC;AAC/H,OAAO,EAAE,wBAAwB,EAAqB,MAAM,kEAAkE,CAAC;AAG/H,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE7E,4BAA4B;AAC5B,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B,4EAA4E;AAC5E,gBAAgB;AAChB,4EAA4E;AAE5E,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;AACtD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,SAAS,CAAC;AAC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