@hcu-lab.me/mcp-device 1.0.3 → 1.0.4
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 +14 -0
- package/dist/device/gateway-pairing.d.ts +1 -0
- package/dist/device/gateway-pairing.js +0 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -21,6 +21,12 @@ mcp-device install
|
|
|
21
21
|
mcp-device status
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
`mcp-device login` stays terminal-only: it prints the pairing URL, user code, and QR code, and never opens a browser automatically.
|
|
25
|
+
|
|
26
|
+
## Limited hosted access
|
|
27
|
+
|
|
28
|
+
The public source package remains MIT licensed, but access to the hosted `device.hcu-lab.me` gateway is intentionally limited. New hosted accounts are admitted through a small, controlled supply of invite codes rather than open registration. Invite availability may be capped, paused, expired, or revoked as the service capacity and security policy change. Installing the package does not by itself grant a hosted-service account or guarantee that an invite code will be available.
|
|
29
|
+
|
|
24
30
|
The hosted Pair/Help pages render their gateway URL and navigation from the deployment that served the page, so staging or custom deployments do not need a production-host rewrite. For the canonical package, `https://device.hcu-lab.me` is the default gateway; `MCP_GATEWAY_URL` is only needed when intentionally using another gateway.
|
|
25
31
|
|
|
26
32
|
## Commands
|
|
@@ -63,6 +69,14 @@ npm run build
|
|
|
63
69
|
node dist/mcp-device.js --help
|
|
64
70
|
```
|
|
65
71
|
|
|
72
|
+
Normal development pushes do not publish npm. After reviewed development work is committed on a clean `main`, a release is intentionally created with:
|
|
73
|
+
|
|
74
|
+
```powershell
|
|
75
|
+
npm run release
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
That command runs the test suite, bumps the patch version, synchronizes project version files, creates the release commit and `vX.Y.Z` tag, then atomically pushes `main` and the tag. The tag-triggered GitHub Actions workflow performs the npm publish through trusted OIDC publishing. Use `npm run release:minor` or `npm run release:major` only when that version change is intentional.
|
|
79
|
+
|
|
66
80
|
For a custom development gateway, set `MCP_GATEWAY_URL`. Supply `MCP_GATEWAY_APP_CA_PATH` from an independent trusted source when using protocol v2. Non-loopback plaintext gateway URLs are rejected.
|
|
67
81
|
|
|
68
82
|
## Upstream execution engine
|
|
@@ -16,6 +16,7 @@ export interface GatewayPairingOptions {
|
|
|
16
16
|
deviceName?: string;
|
|
17
17
|
fetchFn?: typeof fetch;
|
|
18
18
|
proxyAgent?: Agent;
|
|
19
|
+
/** @deprecated Pairing is intentionally terminal-only; this hook is ignored. */
|
|
19
20
|
openBrowser?: (url: string) => Promise<unknown>;
|
|
20
21
|
renderQr?: (value: string) => void;
|
|
21
22
|
sleep?: (ms: number) => Promise<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createHash, randomBytes } from 'crypto';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import os from 'os';
|
|
4
|
-
import open from 'open';
|
|
5
4
|
import fetch from 'cross-fetch';
|
|
6
5
|
import { gatewayHttpBase } from './gateway-url-policy.js';
|
|
7
6
|
const CLIENT_ID = 'mcp-device';
|
|
@@ -34,7 +33,6 @@ async function jsonResponse(response) {
|
|
|
34
33
|
export async function pairGatewayDevice(options) {
|
|
35
34
|
const baseUrl = gatewayHttpBase(options.gatewayUrl);
|
|
36
35
|
const fetchFn = options.fetchFn || fetch;
|
|
37
|
-
const openBrowser = options.openBrowser || (url => open(url));
|
|
38
36
|
const renderQr = options.renderQr || defaultQrRenderer;
|
|
39
37
|
const sleep = options.sleep || (ms => new Promise(resolve => setTimeout(resolve, ms)));
|
|
40
38
|
const log = options.log || (value => console.log(value));
|
|
@@ -62,10 +60,6 @@ export async function pairGatewayDevice(options) {
|
|
|
62
60
|
log(`Pair this device: ${verificationUrl}`);
|
|
63
61
|
log(`Code: ${start.user_code}`);
|
|
64
62
|
renderQr(verificationUrl);
|
|
65
|
-
try {
|
|
66
|
-
await openBrowser(verificationUrl);
|
|
67
|
-
}
|
|
68
|
-
catch { /* URL + QR remain usable */ }
|
|
69
63
|
const intervalMs = Math.max(1000, Math.min(30000, Number(start.interval || 2) * 1000));
|
|
70
64
|
const deadline = Date.now() + Math.max(1, Number(start.expires_in || 600)) * 1000;
|
|
71
65
|
while (Date.now() < deadline) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
1
|
+
export declare const VERSION = "1.0.4";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.0.
|
|
1
|
+
export const VERSION = '1.0.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hcu-lab.me/mcp-device",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "MCP Device securely connects a user-owned computer to an authenticated Model Context Protocol gateway.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hirohimeow",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"device:start": "tsx src/device/device.ts",
|
|
27
27
|
"device:start:dev": "nodemon --watch src/device --exec tsx src/device/device.ts",
|
|
28
28
|
"sync-version": "node scripts/sync-version.js",
|
|
29
|
+
"version": "node scripts/sync-version.js && git add server.json src/version.ts package-lock.json",
|
|
30
|
+
"release": "node scripts/release.js patch",
|
|
31
|
+
"release:minor": "node scripts/release.js minor",
|
|
32
|
+
"release:major": "node scripts/release.js major",
|
|
29
33
|
"bump": "node scripts/sync-version.js --bump",
|
|
30
34
|
"bump:minor": "node scripts/sync-version.js --bump --minor",
|
|
31
35
|
"bump:major": "node scripts/sync-version.js --bump --major",
|