@decodo/mcp-server 1.2.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/auth/credential.js +4 -1
- package/build/auth/credential.js.map +1 -1
- package/build/clients/hosts.js +10 -0
- package/build/clients/hosts.js.map +1 -0
- package/build/clients/scraper-api-client.js +15 -5
- package/build/clients/scraper-api-client.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/oauth/backend.js +3 -0
- package/build/oauth/backend.js.map +1 -0
- package/build/oauth/backends/decodo/index.js +71 -0
- package/build/oauth/backends/decodo/index.js.map +1 -0
- package/build/oauth/backends/decodo/request-jwt.js +62 -0
- package/build/oauth/backends/decodo/request-jwt.js.map +1 -0
- package/build/oauth/backends/decodo/token-exchange.js +88 -0
- package/build/oauth/backends/decodo/token-exchange.js.map +1 -0
- package/build/oauth/backends/mock/dashboard.js +84 -0
- package/build/oauth/backends/mock/dashboard.js.map +1 -0
- package/build/oauth/backends/mock/index.js +42 -0
- package/build/oauth/backends/mock/index.js.map +1 -0
- package/build/oauth/backends/mock/subscription-api.js +130 -0
- package/build/oauth/backends/mock/subscription-api.js.map +1 -0
- package/build/oauth/bounded-body.js +29 -0
- package/build/oauth/bounded-body.js.map +1 -0
- package/build/oauth/clients-store.js +142 -0
- package/build/oauth/clients-store.js.map +1 -0
- package/build/oauth/config.js +77 -0
- package/build/oauth/config.js.map +1 -0
- package/build/oauth/cookies.js +25 -0
- package/build/oauth/cookies.js.map +1 -0
- package/build/oauth/index.js +46 -0
- package/build/oauth/index.js.map +1 -0
- package/build/oauth/provider.js +172 -0
- package/build/oauth/provider.js.map +1 -0
- package/build/oauth/redirect-uris.js +17 -0
- package/build/oauth/redirect-uris.js.map +1 -0
- package/build/oauth/router.js +68 -0
- package/build/oauth/router.js.map +1 -0
- package/build/oauth/sealer.js +55 -0
- package/build/oauth/sealer.js.map +1 -0
- package/build/oauth/token-exchange.js +17 -0
- package/build/oauth/token-exchange.js.map +1 -0
- package/build/oauth/ttl-store.js +47 -0
- package/build/oauth/ttl-store.js.map +1 -0
- package/build/server/app.js +77 -0
- package/build/server/app.js.map +1 -0
- package/build/server/revoked-credentials.js +25 -0
- package/build/server/revoked-credentials.js.map +1 -0
- package/build/server/sapi-base-server.js +2 -2
- package/build/server/sapi-base-server.js.map +1 -1
- package/build/server/sapi-http-server.js +2 -2
- package/build/server/sapi-http-server.js.map +1 -1
- package/build/server/trust-proxy.js +19 -0
- package/build/server/trust-proxy.js.map +1 -0
- package/build/server.js +6 -44
- package/build/server.js.map +1 -1
- package/package.json +3 -9
package/build/server.js
CHANGED
|
@@ -1,52 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
require("dotenv/config");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const auth_1 = require("./auth");
|
|
11
|
-
const cors_2 = require("./server/cors");
|
|
12
|
-
const sapi_http_server_1 = require("./server/sapi-http-server");
|
|
13
|
-
const utils_1 = require("./utils");
|
|
14
|
-
const app = (0, express_1.default)();
|
|
15
|
-
app.use((0, cors_1.default)(cors_2.corsOptions));
|
|
16
|
-
app.use(express_1.default.json());
|
|
17
|
-
app.get('/mcp', (_req, res) => {
|
|
18
|
-
res.status(200).send('server up, use POST /mcp to see available tools');
|
|
19
|
-
});
|
|
20
|
-
app.post('/mcp', async (req, res) => {
|
|
21
|
-
const auth = req.headers.authorization;
|
|
22
|
-
if (!auth) {
|
|
23
|
-
res.status(401).send('Unauthorized');
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const credential = (0, auth_1.credentialFromAuthHeader)(auth);
|
|
27
|
-
if (!credential) {
|
|
28
|
-
res.status(401).send("Valid 'Basic' or 'Bearer' authorization required");
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const toolsets = (0, utils_1.resolveToolsets)(req.query.toolsets);
|
|
32
|
-
const server = new sapi_http_server_1.ScraperAPIHttpServer({ toolsets, auth: credential });
|
|
33
|
-
const transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
|
|
34
|
-
sessionIdGenerator: undefined,
|
|
35
|
-
enableJsonResponse: false,
|
|
36
|
-
});
|
|
37
|
-
res.on('close', () => {
|
|
38
|
-
transport.close();
|
|
39
|
-
});
|
|
40
|
-
await server.connect(transport);
|
|
41
|
-
await transport.handleRequest(req, res, req.body);
|
|
42
|
-
});
|
|
43
|
-
app.get('/healthz', (_req, res) => {
|
|
44
|
-
res.status(200).send('ok');
|
|
45
|
-
});
|
|
4
|
+
const oauth_1 = require("./oauth");
|
|
5
|
+
const app_1 = require("./server/app");
|
|
6
|
+
const trust_proxy_1 = require("./server/trust-proxy");
|
|
46
7
|
const port = parseInt(process.env.PORT || '3000');
|
|
47
|
-
|
|
8
|
+
const oauth = (0, oauth_1.oauthConfigFromEnv)(process.env, port);
|
|
9
|
+
(0, app_1.createApp)({ oauth, trustProxy: (0, trust_proxy_1.trustProxyFromEnv)(process.env.TRUST_PROXY) })
|
|
48
10
|
.listen(port, () => {
|
|
49
|
-
console.log(`Demo MCP Server running on http://localhost:${port}/mcp`);
|
|
11
|
+
console.log(`Demo MCP Server running on http://localhost:${port}/mcp (issuer ${oauth.publicUrl.href})`);
|
|
50
12
|
})
|
|
51
13
|
.on('error', (error) => {
|
|
52
14
|
console.error('Server error:', error);
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AACvB,mCAA6C;AAC7C,sCAAyC;AACzC,sDAAyD;AAEzD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;AAElD,MAAM,KAAK,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAEpD,IAAA,eAAS,EAAC,EAAE,KAAK,EAAE,UAAU,EAAE,IAAA,+BAAiB,EAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;KACzE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,+CAA+C,IAAI,gBAAgB,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC;AAC1G,CAAC,CAAC;KACD,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decodo/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Decodo MCP Server",
|
|
5
5
|
"bin": {
|
|
6
6
|
"decodo-mcp": "./build/index.js"
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"start": "node build/server.js",
|
|
15
15
|
"inspect": "mcp-inspector",
|
|
16
16
|
"test": "jest",
|
|
17
|
-
"lint": "eslint src/"
|
|
18
|
-
"release": "semantic-release"
|
|
17
|
+
"lint": "eslint src/"
|
|
19
18
|
},
|
|
20
19
|
"keywords": [],
|
|
21
20
|
"author": "",
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
"build"
|
|
28
27
|
],
|
|
29
28
|
"dependencies": {
|
|
30
|
-
"@decodo/sdk-ts": "^2.
|
|
29
|
+
"@decodo/sdk-ts": "^2.4.0",
|
|
31
30
|
"@modelcontextprotocol/sdk": "^1.12.3",
|
|
32
31
|
"cors": "^2.8.5",
|
|
33
32
|
"dotenv": "^16.5.0",
|
|
@@ -38,10 +37,6 @@
|
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@eslint/js": "^10.0.1",
|
|
40
39
|
"@modelcontextprotocol/inspector": "^0.21.1",
|
|
41
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
42
|
-
"@semantic-release/git": "^10.0.1",
|
|
43
|
-
"@semantic-release/github": "^12.0.6",
|
|
44
|
-
"@semantic-release/npm": "^13.1.5",
|
|
45
40
|
"@types/cors": "^2.8.17",
|
|
46
41
|
"@types/express": "^5.0.1",
|
|
47
42
|
"@types/jest": "^30.0.0",
|
|
@@ -49,7 +44,6 @@
|
|
|
49
44
|
"eslint": "^10.2.1",
|
|
50
45
|
"jest": "^29.7.0",
|
|
51
46
|
"nodemon": "^3.1.14",
|
|
52
|
-
"semantic-release": "^25.0.3",
|
|
53
47
|
"ts-jest": "^29.4.9",
|
|
54
48
|
"typescript": "^5.8.3",
|
|
55
49
|
"typescript-eslint": "^8.58.2",
|