@gpsglobal-ai/gpsglobal 1.4.4 → 1.4.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog — gpsglobal
2
2
 
3
+ ## 1.4.5 — 2026-06-21
4
+
5
+ - **Production defaults:** `setup` and `login` use `https://lp.gpsglobal.ai` (not `localhost:8080`)
6
+ - **`setup` default mode:** `oauth` — Cursor/VS Code/GitHub get URL-only `https://lp.gpsglobal.ai/mcp`
7
+ - **Claude Desktop:** still gets stdio + `envFile` when mode is `oauth` (Desktop has no reliable HTTP OAuth)
8
+ - **`doctor`:** probes `${apiBase}/mcp` → expects 401 on production (not localhost:3100)
9
+ - Local dev: `GPS_API_BASE=http://localhost:8080 npx @gpsglobal-ai/gpsglobal setup --mode=stdio`
10
+
3
11
  ## 1.4.4 — 2026-06-18
4
12
 
5
13
  - CI: disable npm provenance (private GitHub repo — OIDC publish still works)
package/README.md CHANGED
@@ -28,21 +28,27 @@ Data never leaves GPS infrastructure except through your authenticated session
28
28
 
29
29
  ## Quick start (recommended)
30
30
 
31
- One command — browser sign-in, credentials saved locally, configs merged for major AI hosts:
31
+ One command — browser sign-in at **production**, credentials saved locally, configs merged for major AI hosts:
32
32
 
33
33
  ```bash
34
34
  npx @gpsglobal-ai/gpsglobal setup
35
35
  ```
36
36
 
37
- This writes `~/.gps/mcp.env` (mode `600`) and updates **Cursor**, **VS Code**, and **Claude Desktop** configs.
37
+ This opens `https://lp.gpsglobal.ai` for OAuth, writes `~/.gps/mcp.env` (mode `600`), and updates **Cursor** (OAuth URL), **VS Code**, **GitHub Copilot**, and **Claude Desktop** (stdio) configs.
38
38
 
39
39
  **Restart your AI tool**, then ask: *"List my GPS funds using gpsglobal"*.
40
40
 
41
+ **Local Docker dev** (backend on `localhost:8080`):
42
+
43
+ ```bash
44
+ GPS_API_BASE=http://localhost:8080 npx @gpsglobal-ai/gpsglobal setup --mode=stdio
45
+ ```
46
+
41
47
  ### Other commands
42
48
 
43
49
  | Goal | Command |
44
50
  |------|---------|
45
- | OAuth Connect (URL-only, no token in config) | `npx @gpsglobal-ai/gpsglobal setup --mode=oauth` |
51
+ | stdio-only (all hosts) | `npx @gpsglobal-ai/gpsglobal setup --mode=stdio` |
46
52
  | Verify install + backend reachability | `npx @gpsglobal-ai/gpsglobal doctor` |
47
53
  | Print config snippets for all hosts | `npx @gpsglobal-ai/gpsglobal print-config` |
48
54
  | Refresh credentials | `npx @gpsglobal-ai/gpsglobal login --browser --refresh` |
@@ -60,9 +66,9 @@ gpsglobal setup
60
66
 
61
67
  | Host | Setup mode | Config key |
62
68
  |------|------------|------------|
63
- | **Cursor** | `setup` or `setup --mode=oauth` | `gpsglobal` |
69
+ | **Cursor** | `setup` (default oauth) | `gpsglobal` |
64
70
  | **VS Code / GitHub Copilot** | `setup` | `gpsglobal` |
65
- | **Claude Desktop** | `setup` (stdio) | `gpsglobal` |
71
+ | **Claude Desktop** | `setup` (stdio via envFile) | `gpsglobal` |
66
72
  | **Claude Code** | `claude mcp add --transport http gpsglobal https://lp.gpsglobal.ai/mcp` | `gpsglobal` |
67
73
 
68
74
  **OAuth Connect (production):** hosts discover auth via `https://lp.gpsglobal.ai/mcp` — no manual JWT paste.
@@ -129,7 +135,7 @@ gpsglobal setup
129
135
  |-------|-----|
130
136
  | Tools return 401 | `npx @gpsglobal-ai/gpsglobal login --browser --refresh` |
131
137
  | Host shows disconnected | Restart the AI app after `setup` |
132
- | `doctor` fails | Ensure backend is running; check `GPS_API_BASE` in `~/.gps/mcp.env` |
138
+ | `doctor` fails | Ensure you are whitelisted on prod; check `GPS_API_BASE` in `~/.gps/mcp.env` (should be `https://lp.gpsglobal.ai`) |
133
139
  | OAuth Connect loop | Confirm Cursor/VS Code config is URL-only (no stale Bearer header) |
134
140
 
135
141
  ---
@@ -2,6 +2,7 @@ import axios from 'axios';
2
2
  import { GpsApiClient } from '../clients/gps-api.js';
3
3
  import { loadGpsConfig, normalizeApiBase, DEFAULT_ENV_PATH } from '../config/env.js';
4
4
  import { decodeGpsJwt } from '../lib/jwt.js';
5
+ import { resolveMcpPublicUrl } from '../lib/host-config.js';
5
6
  export async function runDoctor() {
6
7
  const checks = [];
7
8
  let config;
@@ -53,22 +54,29 @@ export async function runDoctor() {
53
54
  detail: err instanceof Error ? err.message : String(err),
54
55
  });
55
56
  }
56
- const mcpUrl = process.env.GPS_MCP_PUBLIC_URL ?? 'http://localhost:3100';
57
+ const mcpUrl = resolveMcpPublicUrl(config.apiBase);
57
58
  try {
58
- const mcpHealth = await axios.get(`${mcpUrl}/health`, { timeout: 5_000, validateStatus: () => true });
59
- if (mcpHealth.status === 404) {
60
- checks.push({ name: 'mcp-http', ok: true, detail: 'not running (stdio mode OK)' });
59
+ const mcpProbe = await axios.get(`${mcpUrl}/mcp`, {
60
+ timeout: 10_000,
61
+ validateStatus: () => true,
62
+ maxRedirects: 0,
63
+ });
64
+ if (mcpProbe.status === 401) {
65
+ checks.push({ name: 'mcp-http', ok: true, detail: `${mcpUrl}/mcp → 401 (discovery OK)` });
66
+ }
67
+ else if (mcpProbe.status === 404) {
68
+ checks.push({ name: 'mcp-http', ok: true, detail: 'stdio mode (no remote /mcp)' });
61
69
  }
62
70
  else {
63
71
  checks.push({
64
72
  name: 'mcp-http',
65
- ok: mcpHealth.status === 200,
66
- detail: `${mcpUrl}/health → ${mcpHealth.status}`,
73
+ ok: mcpProbe.status === 200,
74
+ detail: `${mcpUrl}/mcp → ${mcpProbe.status}`,
67
75
  });
68
76
  }
69
77
  }
70
78
  catch {
71
- checks.push({ name: 'mcp-http', ok: true, detail: 'not running (stdio mode OK)' });
79
+ checks.push({ name: 'mcp-http', ok: true, detail: 'remote MCP unreachable (stdio mode OK)' });
72
80
  }
73
81
  return { ok: checks.every((c) => c.ok), checks };
74
82
  }
package/dist/cli/setup.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { browserLogin } from './browser-login.js';
2
- import { DEFAULT_ENV_PATH, normalizeApiBase } from '../config/env.js';
2
+ import { DEFAULT_ENV_PATH, LOCAL_GPS_API_BASE, normalizeApiBase, resolveDefaultApiBase } from '../config/env.js';
3
3
  import { MCP_SERVER_KEY, PACKAGE, claudeCodeAddCommand, mergeVsCodeConfig, mergeVsCodeWorkspaceConfig, mergeClaudeDesktopConfig, mergeCursorConfig, buildOAuthConnectEntry, buildRemoteEntry, buildStdioEntry, resolveMcpPublicUrl, writeAllHostConfigs, } from '../lib/host-config.js';
4
4
  export async function runSetup(options) {
5
- const apiBase = normalizeApiBase(options.apiBase ?? process.env.GPS_API_BASE ?? 'http://localhost:8080');
5
+ const apiBase = normalizeApiBase(options.apiBase ?? resolveDefaultApiBase());
6
6
  const host = options.host ?? 'all';
7
7
  const useBrowser = options.useBrowser ?? true;
8
- const mode = options.mode ?? 'stdio';
8
+ const mode = options.mode ?? 'oauth';
9
9
  const mcpPublic = resolveMcpPublicUrl(apiBase);
10
- console.log(`GPS MCP setup — configure ${MCP_SERVER_KEY} for your AI tools\n`);
10
+ console.log(`GPS MCP setup — configure ${MCP_SERVER_KEY} for your AI tools`);
11
+ console.log(` API: ${apiBase} · MCP: ${mcpPublic}/mcp · mode: ${mode}\n`);
11
12
  if (useBrowser) {
12
13
  const result = await browserLogin(apiBase);
13
14
  console.log(`\n✓ Signed in as ${result.username} (${result.lpId})`);
@@ -48,5 +49,6 @@ export async function runSetup(options) {
48
49
  console.log(`\nRun:\n ${claudeCodeAddCommand(mcpPublic, mode === 'oauth' ? 'oauth' : 'remote')}`);
49
50
  }
50
51
  console.log(`\nVerify: npx ${PACKAGE} doctor`);
52
+ console.log(`Local dev: GPS_API_BASE=${LOCAL_GPS_API_BASE} npx ${PACKAGE} setup --mode=stdio`);
51
53
  console.log(`Done. Ask your AI: "list my GPS funds using ${MCP_SERVER_KEY}"`);
52
54
  }
package/dist/cli.js CHANGED
@@ -2,14 +2,14 @@
2
2
  import readline from 'node:readline/promises';
3
3
  import { stdin as input, stdout as output } from 'node:process';
4
4
  import { GpsApiClient } from './clients/gps-api.js';
5
- import { DEFAULT_ENV_PATH, loadGpsConfig, normalizeApiBase, writeGpsEnvFile, } from './config/env.js';
5
+ import { DEFAULT_ENV_PATH, loadGpsConfig, resolveDefaultApiBase, writeGpsEnvFile, } from './config/env.js';
6
6
  import { startStdioServer, startHttpFromEnv } from './index.js';
7
7
  import { browserLogin } from './cli/browser-login.js';
8
8
  import { runSetup } from './cli/setup.js';
9
9
  import { runDoctor, printDoctor } from './cli/doctor.js';
10
10
  import { MCP_SERVER_KEY, PACKAGE, buildMcpServersConfig, buildOAuthConnectEntry, buildRemoteEntry, buildStdioEntry, buildVsCodeServersConfig, resolveMcpPublicUrl, } from './lib/host-config.js';
11
11
  function printConfig(envPath) {
12
- const apiBase = normalizeApiBase(process.env.GPS_API_BASE ?? 'http://localhost:8080');
12
+ const apiBase = resolveDefaultApiBase();
13
13
  const mcpPublic = resolveMcpPublicUrl(apiBase);
14
14
  const stdio = buildStdioEntry(envPath);
15
15
  const remote = buildRemoteEntry(mcpPublic);
@@ -17,7 +17,7 @@ function printConfig(envPath) {
17
17
  console.log(`
18
18
  ═══ Easiest: one command (all major hosts) ═══
19
19
  npx ${PACKAGE} setup
20
- npx ${PACKAGE} setup --mode=oauthOAuth Connect (URL-only)
20
+ npx ${PACKAGE} setup --mode=stdiolocal dev / Claude Desktop stdio-only
21
21
 
22
22
  ═══ Cursor / Claude Desktop (mcpServers) ═══
23
23
  ${JSON.stringify(buildMcpServersConfig(stdio), null, 2)}
@@ -46,7 +46,7 @@ async function promptHidden(question) {
46
46
  }
47
47
  }
48
48
  async function runLogin(refresh, useBrowser) {
49
- const apiBase = normalizeApiBase(process.env.GPS_API_BASE ?? 'http://localhost:8080');
49
+ const apiBase = resolveDefaultApiBase();
50
50
  if (useBrowser) {
51
51
  const result = await browserLogin(apiBase);
52
52
  console.log(`\n✓ Credentials saved to ${DEFAULT_ENV_PATH}`);
@@ -109,8 +109,8 @@ async function main() {
109
109
  const cmd = args[0];
110
110
  if (!cmd || cmd === 'help' || args.includes('--help')) {
111
111
  console.log(`Usage:
112
- npx ${PACKAGE} setup ← easiest: all hosts (Cursor, VS Code, Claude Desktop)
113
- npx ${PACKAGE} setup --mode=oauthCursor Connect (URL-only, no envFile)
112
+ npx ${PACKAGE} setup ← production OAuth Connect (https://lp.gpsglobal.ai/mcp)
113
+ npx ${PACKAGE} setup --mode=stdiolocal dev (GPS_API_BASE=http://localhost:8080)
114
114
  npx ${PACKAGE} doctor ← verify credentials + backend
115
115
  npx ${PACKAGE} login [--browser] [--refresh]
116
116
  npx ${PACKAGE} status
@@ -128,7 +128,7 @@ async function main() {
128
128
  await runSetup({
129
129
  host: host ?? 'all',
130
130
  useBrowser: !args.includes('--no-browser'),
131
- mode: mode ?? 'stdio',
131
+ mode: mode ?? 'oauth',
132
132
  });
133
133
  return;
134
134
  }
@@ -1,4 +1,10 @@
1
1
  export declare const DEFAULT_ENV_PATH: string;
2
+ /** Production LP Workspace origin — default for published npm package. */
3
+ export declare const DEFAULT_GPS_API_BASE = "https://lp.gpsglobal.ai";
4
+ /** Local Docker backend — opt-in via GPS_API_BASE for developers only. */
5
+ export declare const LOCAL_GPS_API_BASE = "http://localhost:8080";
6
+ /** Resolve API base: explicit env → production (not localhost). */
7
+ export declare function resolveDefaultApiBase(): string;
2
8
  export interface GpsEnvConfig {
3
9
  apiBase: string;
4
10
  accessToken: string;
@@ -2,6 +2,14 @@ import fs from 'node:fs';
2
2
  import os from 'node:os';
3
3
  import path from 'node:path';
4
4
  export const DEFAULT_ENV_PATH = path.join(os.homedir(), '.gps', 'mcp.env');
5
+ /** Production LP Workspace origin — default for published npm package. */
6
+ export const DEFAULT_GPS_API_BASE = 'https://lp.gpsglobal.ai';
7
+ /** Local Docker backend — opt-in via GPS_API_BASE for developers only. */
8
+ export const LOCAL_GPS_API_BASE = 'http://localhost:8080';
9
+ /** Resolve API base: explicit env → production (not localhost). */
10
+ export function resolveDefaultApiBase() {
11
+ return normalizeApiBase(process.env.GPS_API_BASE ?? DEFAULT_GPS_API_BASE);
12
+ }
5
13
  export function parseEnvFile(content) {
6
14
  const out = {};
7
15
  for (const line of content.split('\n')) {
@@ -36,7 +44,7 @@ export function loadGpsConfig(envPath = process.env.GPS_MCP_ENV_PATH ?? DEFAULT_
36
44
  }
37
45
  const parsed = parseEnvFile(fs.readFileSync(envPath, 'utf8'));
38
46
  const merged = {
39
- apiBase: normalizeApiBase(parsed.GPS_API_BASE ?? 'http://localhost:8080'),
47
+ apiBase: normalizeApiBase(parsed.GPS_API_BASE ?? DEFAULT_GPS_API_BASE),
40
48
  accessToken: parsed.GPS_ACCESS_TOKEN ?? '',
41
49
  lpId: parsed.GPS_LP_ID ?? '',
42
50
  role: parsed.GPS_ROLE ?? 'lp',
package/dist/http.d.ts CHANGED
@@ -3,6 +3,9 @@ export interface HttpServerOptions {
3
3
  host: string;
4
4
  apiBase: string;
5
5
  publicBaseUrl: string;
6
+ /** Public GPS API origin for OAuth AS in PRM (defaults to publicBaseUrl). */
7
+ publicApiBase?: string;
6
8
  enabled: boolean;
9
+ version?: string;
7
10
  }
8
11
  export declare function startHttpServer(opts: HttpServerOptions): Promise<void>;
package/dist/http.js CHANGED
@@ -5,6 +5,7 @@ import { assertMcpEligibleRole } from './config/env.js';
5
5
  import { createGpsMcpServer } from './server/factory.js';
6
6
  import { decodeGpsJwt } from './lib/jwt.js';
7
7
  import { assertMcpHttpToken } from './lib/token-policy.js';
8
+ import { oauthAuthorizationServerUrl, resolvePublicApiBase } from './lib/public-api-base.js';
8
9
  function parseBearer(req) {
9
10
  const h = req.headers.authorization;
10
11
  if (!h?.startsWith('Bearer '))
@@ -28,15 +29,21 @@ function sendUnauthorized(res, resourceMetadataUrl, message) {
28
29
  export async function startHttpServer(opts) {
29
30
  const app = createMcpExpressApp({ host: opts.host });
30
31
  const resourceMetadataUrl = `${opts.publicBaseUrl}/.well-known/oauth-protected-resource`;
31
- const authServer = `${opts.apiBase}/api/v2/oauth/mcp-cli`;
32
+ const publicApiBase = resolvePublicApiBase(opts.publicApiBase, opts.publicBaseUrl);
33
+ const authServer = oauthAuthorizationServerUrl(publicApiBase);
34
+ const serviceVersion = opts.version ?? process.env.GPS_MCP_VERSION ?? '1.4.4';
32
35
  app.get('/health', (_req, res) => {
33
36
  if (!opts.enabled) {
34
37
  res.status(503).json({ status: 'disabled', message: 'GPS MCP HTTP is disabled' });
35
38
  return;
36
39
  }
37
- res.json({ status: 'ok', service: 'gpsglobal', version: '1.4.0' });
40
+ res.json({ status: 'ok', service: 'gpsglobal', version: serviceVersion });
38
41
  });
39
42
  app.get('/.well-known/oauth-protected-resource', (_req, res) => {
43
+ if (!opts.enabled) {
44
+ res.status(503).json({ error: 'GPS MCP is temporarily disabled' });
45
+ return;
46
+ }
40
47
  res.json({
41
48
  resource: `${opts.publicBaseUrl}/mcp`,
42
49
  authorization_servers: [authServer],
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
2
  import { GpsApiClient } from './clients/gps-api.js';
3
- import { loadGpsConfig, normalizeApiBase } from './config/env.js';
3
+ import { loadGpsConfig, normalizeApiBase, LOCAL_GPS_API_BASE } from './config/env.js';
4
4
  import { createGpsMcpServer } from './server/factory.js';
5
5
  import { startHttpServer } from './http.js';
6
6
  export async function startStdioServer() {
@@ -13,8 +13,17 @@ export async function startStdioServer() {
13
13
  export async function startHttpFromEnv() {
14
14
  const port = Number(process.env.PORT ?? 3100);
15
15
  const host = process.env.MCP_HOST ?? '0.0.0.0';
16
- const apiBase = normalizeApiBase(process.env.GPS_API_BASE ?? 'http://localhost:8080');
16
+ const apiBase = normalizeApiBase(process.env.GPS_API_BASE ?? LOCAL_GPS_API_BASE);
17
17
  const publicBaseUrl = normalizeApiBase(process.env.GPS_MCP_PUBLIC_URL ?? `http://localhost:${port}`);
18
+ const publicApiBase = normalizeApiBase(process.env.GPS_MCP_PUBLIC_API_BASE ?? publicBaseUrl);
18
19
  const enabled = process.env.GPS_MCP_ENABLED !== 'false';
19
- await startHttpServer({ port, host, apiBase, publicBaseUrl, enabled });
20
+ await startHttpServer({
21
+ port,
22
+ host,
23
+ apiBase,
24
+ publicBaseUrl,
25
+ publicApiBase,
26
+ enabled,
27
+ version: process.env.GPS_MCP_VERSION,
28
+ });
20
29
  }
@@ -5,6 +5,7 @@
5
5
  import fs from 'node:fs';
6
6
  import os from 'node:os';
7
7
  import path from 'node:path';
8
+ import { DEFAULT_GPS_API_BASE } from '../config/env.js';
8
9
  /** npm scoped package under org gpsglobal-ai (see docs/57-mcp/018-npm-publish-and-cicd.md). */
9
10
  export const NPM_PACKAGE = '@gpsglobal-ai/gpsglobal';
10
11
  /** MCP protocol server key in mcp.json — short, stable across hosts. */
@@ -133,7 +134,7 @@ export function resolveMcpPublicUrl(apiBase) {
133
134
  if (normalized.includes('localhost') || normalized.includes('127.0.0.1')) {
134
135
  return process.env.GPS_MCP_PUBLIC_URL ?? 'http://localhost:3100';
135
136
  }
136
- return process.env.GPS_MCP_PUBLIC_URL ?? 'https://lp.gpsglobal.ai';
137
+ return process.env.GPS_MCP_PUBLIC_URL ?? (normalized || DEFAULT_GPS_API_BASE);
137
138
  }
138
139
  export function claudeCodeAddCommand(mcpPublicUrl, mode = 'oauth') {
139
140
  const url = `${mcpPublicUrl.replace(/\/+$/, '')}/mcp`;
@@ -172,7 +173,8 @@ export function writeAllHostConfigs(envPath, mode, mcpPublicUrl, projectRoot = p
172
173
  catch {
173
174
  results.push({ host: 'vscode', path: vscodeUserMcpPath(), written: false });
174
175
  }
175
- if (mode === 'stdio') {
176
+ // Claude Desktop has no reliable remote HTTP + OAuth — always stdio + envFile.
177
+ if (mode === 'stdio' || mode === 'oauth') {
176
178
  try {
177
179
  results.push({
178
180
  host: 'claude-desktop',
@@ -0,0 +1,3 @@
1
+ /** Public GPS API origin for OAuth PRM (external clients). Internal GPS_API_BASE may differ in ECS. */
2
+ export declare function resolvePublicApiBase(publicApiBase: string | undefined, publicMcpUrl: string): string;
3
+ export declare function oauthAuthorizationServerUrl(publicApiBase: string): string;
@@ -0,0 +1,8 @@
1
+ /** Public GPS API origin for OAuth PRM (external clients). Internal GPS_API_BASE may differ in ECS. */
2
+ export function resolvePublicApiBase(publicApiBase, publicMcpUrl) {
3
+ const base = (publicApiBase ?? publicMcpUrl).replace(/\/+$/, '');
4
+ return base;
5
+ }
6
+ export function oauthAuthorizationServerUrl(publicApiBase) {
7
+ return `${publicApiBase.replace(/\/+$/, '')}/api/v2/oauth/mcp-cli`;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpsglobal-ai/gpsglobal",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "GPS LP fund wiki MCP server — list_funds and get_fund_wiki for Cursor, Copilot, Claude",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",