@zivis/mcp 0.1.18 → 0.1.19

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.
@@ -5,4 +5,11 @@ export { keychainStore, keychainRead, keychainDelete } from "./keychain.js";
5
5
  export { loadTokens } from "./token-refresh.js";
6
6
  export { loadSessionIndex, saveSessionEntry, removeSessionEntry, listSessions } from "./sessions.js";
7
7
  export declare function resolveAuth(config?: ZivisConfig, forceMethod?: AuthMethod): Promise<AuthCredentials>;
8
+ export interface ApiKeyOrgProbe {
9
+ ok: boolean;
10
+ workosOrgId: string | null;
11
+ orgName?: string;
12
+ error?: string;
13
+ }
14
+ export declare function probeApiKeyOrg(config: ZivisConfig, apiKey: string): Promise<ApiKeyOrgProbe>;
8
15
  export declare function getAuthDescription(config?: ZivisConfig): Promise<string>;
@@ -39,6 +39,38 @@ export async function resolveAuth(config = DEFAULT_CONFIG, forceMethod) {
39
39
  }
40
40
  return { method: "none" };
41
41
  }
42
+ export async function probeApiKeyOrg(config, apiKey) {
43
+ let response;
44
+ try {
45
+ response = await fetch(`${config.apiBaseUrl}/api/mcp/session`, {
46
+ headers: {
47
+ "X-API-Key": apiKey,
48
+ "User-Agent": "@zivis/mcp",
49
+ },
50
+ });
51
+ }
52
+ catch (err) {
53
+ return {
54
+ ok: false,
55
+ workosOrgId: null,
56
+ error: err instanceof Error ? err.message : String(err),
57
+ };
58
+ }
59
+ if (!response.ok) {
60
+ const body = await response.text().catch(() => "");
61
+ return {
62
+ ok: false,
63
+ workosOrgId: null,
64
+ error: `HTTP ${response.status}: ${body.slice(0, 200)}`,
65
+ };
66
+ }
67
+ const payload = (await response.json());
68
+ return {
69
+ ok: true,
70
+ workosOrgId: payload.org?.workosOrgId ?? null,
71
+ orgName: payload.org?.name,
72
+ };
73
+ }
42
74
  export async function getAuthDescription(config = DEFAULT_CONFIG) {
43
75
  const creds = await resolveAuth(config);
44
76
  switch (creds.method) {
@@ -3,7 +3,7 @@
3
3
  "pack_id": "zivis-public",
4
4
  "pack_name": "ZIVIS Public Pattern Pack",
5
5
  "version": "0.2.0",
6
- "built_at": "2026-09-08T21:17:47.708Z",
6
+ "built_at": "2026-09-10T20:35:21.881Z",
7
7
  "tier": "customer_safe",
8
8
  "description": "ZIVIS-curated public pattern pack — capsules + inference prompts evaluated locally on the user's machine.",
9
9
  "capsules": [
package/dist/server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
3
  import { ApiClient } from "./api-client.js";
4
- import { resolveAuth } from "./auth/index.js";
4
+ import { probeApiKeyOrg, resolveAuth } from "./auth/index.js";
5
5
  import { detectProjectBinding, resolveConfigFromBinding, resolveMcpSessionForWorkspace, validateProjectBinding, } from "./project-binding.js";
6
6
  import { DEFAULT_CONFIG } from "./types.js";
7
7
  async function validateApiKeyMatchesBinding(binding, config) {
@@ -15,26 +15,12 @@ async function validateApiKeyMatchesBinding(binding, config) {
15
15
  console.error("[zivis] INTERNAL: org verification skipped — no API key (session gate should have prevented this)");
16
16
  return;
17
17
  }
18
- let response;
19
- try {
20
- response = await fetch(`${config.apiBaseUrl}/api/mcp/session`, {
21
- headers: {
22
- "X-API-Key": creds.apiKey,
23
- "User-Agent": "@zivis/mcp",
24
- },
25
- });
26
- }
27
- catch (err) {
28
- console.error(`[zivis] WARNING: Could not reach API to verify org (${err instanceof Error ? err.message : err})`);
29
- return;
30
- }
31
- if (!response.ok) {
32
- const body = await response.text().catch(() => "");
33
- console.error(`[zivis] WARNING: API key org probe failed (${response.status}): ${body.slice(0, 200)}`);
18
+ const probe = await probeApiKeyOrg(config, creds.apiKey);
19
+ if (!probe.ok) {
20
+ console.error(`[zivis] WARNING: API key org probe failed: ${probe.error}`);
34
21
  return;
35
22
  }
36
- const payload = (await response.json());
37
- const resolved = payload.org?.workosOrgId;
23
+ const resolved = probe.workosOrgId;
38
24
  if (resolved !== binding.workosOrgId) {
39
25
  const orgLabel = binding.orgName ? ` (${binding.orgName})` : "";
40
26
  console.error("[zivis] SECURITY ERROR: API key org does not match project binding!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zivis/mcp",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "ZIVIS MCP server — threat modeling, security scans, and AI red team tools for IDE integration",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://zivis.ai",