@entergram/mcp 0.1.4 → 0.1.6

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
@@ -75,7 +75,7 @@ args = ["serve"]
75
75
  [mcp_servers.entergram.env]
76
76
  ENTERGRAM_MCP_ENV = "production"
77
77
  ENTERGRAM_MCP_CLIENT_ID = "entergram-ws-your-client-id"
78
- ENTERGRAM_MCP_SCOPE = "workspace.read members.read accounts.read contacts.read chats.read messages.read messages.write custom_fields.read custom_fields.write tickets.read offline_access"
78
+ ENTERGRAM_MCP_SCOPE = "workspace.read members.read accounts.read contacts.read chats.read chats.write messages.read messages.write custom_fields.read custom_fields.write tickets.read tickets.write offline_access"
79
79
  ```
80
80
 
81
81
  ## Defaults
@@ -102,6 +102,13 @@ Use a workspace client if you need broader scopes such as:
102
102
  - `custom_fields.read`
103
103
  - `custom_fields.write`
104
104
 
105
+ When `ENTERGRAM_MCP_CLIENT_ID` starts with `entergram-personal-`, the CLI uses a safer personal default scope that includes:
106
+
107
+ - `chat_custom_fields.read`
108
+ - `chat_custom_fields.write`
109
+
110
+ and excludes workspace-admin scopes such as `members.read` and `custom_fields.write`.
111
+
105
112
  If the consent screen does not show the scopes you expect, update that OAuth client's `allowedScopes` in Entergram first, then run login again.
106
113
 
107
114
  ## Troubleshooting
package/dist/cli/bin.js CHANGED
File without changes
@@ -1,6 +1,6 @@
1
1
  import os from "node:os";
2
2
  import path from "node:path";
3
- import { DEFAULT_CALLBACK_HOST, DEFAULT_CALLBACK_PATH, DEFAULT_CALLBACK_PORT, DEFAULT_CONFIG_DIRECTORY_NAME, DEFAULT_SCOPE, } from "./constants.js";
3
+ import { DEFAULT_CALLBACK_HOST, DEFAULT_CALLBACK_PATH, DEFAULT_CALLBACK_PORT, DEFAULT_CONFIG_DIRECTORY_NAME, DEFAULT_PERSONAL_SCOPE, DEFAULT_WORKSPACE_SCOPE, } from "./constants.js";
4
4
  const ENVIRONMENT_PRESETS = {
5
5
  dev: {
6
6
  clientId: "entergram-dev-mcp-client",
@@ -40,6 +40,12 @@ function parsePositiveInteger(value, fallback) {
40
40
  function sanitizeFileSegment(value) {
41
41
  return value.replace(/[^a-zA-Z0-9._-]+/g, "-");
42
42
  }
43
+ function defaultScopeForClientId(clientId) {
44
+ if (clientId.startsWith("entergram-personal-")) {
45
+ return DEFAULT_PERSONAL_SCOPE;
46
+ }
47
+ return DEFAULT_WORKSPACE_SCOPE;
48
+ }
43
49
  export function resolveCliRuntimeConfig(flags) {
44
50
  const environment = getEnvironmentName(flags);
45
51
  const preset = ENVIRONMENT_PRESETS[environment];
@@ -52,9 +58,10 @@ export function resolveCliRuntimeConfig(flags) {
52
58
  const oauthIssuerUrl = getStringFlag(flags, "oauth-issuer-url") ||
53
59
  process.env.ENTERGRAM_MCP_OAUTH_ISSUER_URL?.trim() ||
54
60
  preset.oauthIssuerUrl;
61
+ const defaultScope = defaultScopeForClientId(clientId);
55
62
  const scope = getStringFlag(flags, "scope") ||
56
63
  process.env.ENTERGRAM_MCP_SCOPE?.trim() ||
57
- DEFAULT_SCOPE;
64
+ defaultScope;
58
65
  const callbackPort = parsePositiveInteger(getStringFlag(flags, "callback-port") ||
59
66
  process.env.ENTERGRAM_MCP_CALLBACK_PORT?.trim(), DEFAULT_CALLBACK_PORT);
60
67
  const configDir = getStringFlag(flags, "config-dir") ||
@@ -1,5 +1,6 @@
1
1
  export const CLI_VERSION = "0.1.0";
2
- export const DEFAULT_SCOPE = "workspace.read members.read accounts.read contacts.read chats.read messages.read messages.write custom_fields.read custom_fields.write tickets.read offline_access";
2
+ export const DEFAULT_WORKSPACE_SCOPE = "workspace.read members.read accounts.read contacts.read chats.read chats.write messages.read messages.write custom_fields.read custom_fields.write tickets.read tickets.write offline_access";
3
+ export const DEFAULT_PERSONAL_SCOPE = "workspace.read accounts.read contacts.read chats.read chat_custom_fields.read chat_custom_fields.write messages.read tickets.read tickets.write offline_access";
3
4
  export const DEFAULT_CALLBACK_HOST = "127.0.0.1";
4
5
  export const DEFAULT_CALLBACK_PORT = 8787;
5
6
  export const DEFAULT_CALLBACK_PATH = "/oauth/callback";
@@ -50,19 +50,12 @@ export class EntergramRemoteClient {
50
50
  if (!(error instanceof UnauthorizedError) || !options.interactive) {
51
51
  throw error;
52
52
  }
53
- await client.close().catch(() => undefined);
54
- ({ client, transport } = createPair());
55
53
  const callbackPromise = waitForOAuthCallback(this.config.callbackUrl, 5 * 60 * 1000, () => this.authProvider.expectedState());
56
- try {
57
- await client.connect(transport);
58
- }
59
- catch (interactiveError) {
60
- if (!(interactiveError instanceof UnauthorizedError)) {
61
- throw interactiveError;
62
- }
63
- }
64
54
  const code = await callbackPromise;
65
55
  await transport.finishAuth(code);
56
+ await client.close().catch(() => undefined);
57
+ await transport.close().catch(() => undefined);
58
+ ({ client, transport } = createPair());
66
59
  await client.connect(transport);
67
60
  }
68
61
  this.client = client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entergram/mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "description": "Official Entergram MCP CLI for local MCP hosts with OAuth login, stdio bridging, and host config helpers.",
6
6
  "type": "module",
@@ -37,7 +37,10 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@modelcontextprotocol/sdk": "1.29.0",
40
- "jose": "^6.1.0"
40
+ "dotenv": "^17.4.2",
41
+ "fastify": "^5.8.5",
42
+ "jose": "^6.1.0",
43
+ "zod": "^4.3.6"
41
44
  },
42
45
  "devDependencies": {
43
46
  "@types/node": "^24.6.0",