@alfe.ai/mcp-tools 0.1.2 → 0.1.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/dist/index.cjs CHANGED
@@ -41,7 +41,10 @@ const OAUTH_PROVIDERS = [
41
41
  * via `AgentApiClient.getRegistry()`.
42
42
  * - `integrations_start_oauth` — generates the public
43
43
  * `GET /<provider>/oauth/start` URL for the user to open in a browser.
44
- * Pure URL builder; no server-side call.
44
+ * Pure URL builder; no server-side call. Completion is confirmed out of
45
+ * band (the dashboard, or the hosted MCP server's
46
+ * `integrations_check_oauth_status`) — the local server intentionally has
47
+ * no status-check tool yet.
45
48
  */
46
49
  const registerIntegrationsTools = (server, ctx) => {
47
50
  server.registerTool("integrations_browse_registry", {
@@ -55,7 +58,7 @@ const registerIntegrationsTools = (server, ctx) => {
55
58
  }
56
59
  });
57
60
  server.registerTool("integrations_start_oauth", {
58
- description: "Start an OAuth connection flow for an integration. Returns a URL the user must open in their browser to authorize the connection. After authorization, use `integrations_check_oauth_status` (currently in services/mcp) to verify.",
61
+ description: "Start an OAuth connection flow for an integration. Returns a URL the user must open in their browser to authorize the connection. After the user authorizes, the connection appears in the Alfe dashboard — this local server does not expose a status-check tool, so confirm completion there.",
59
62
  inputSchema: {
60
63
  provider: zod.z.enum(OAUTH_PROVIDERS).describe("The OAuth provider to connect"),
61
64
  scopes: zod.z.string().optional().describe("Comma-separated scope groups (e.g. 'gmail,drive' for Google)")
package/dist/index.d.cts CHANGED
@@ -65,11 +65,13 @@ declare function err(message: string): ToolResult;
65
65
  * via `AgentApiClient.getRegistry()`.
66
66
  * - `integrations_start_oauth` — generates the public
67
67
  * `GET /<provider>/oauth/start` URL for the user to open in a browser.
68
- * Pure URL builder; no server-side call.
68
+ * Pure URL builder; no server-side call. Completion is confirmed out of
69
+ * band (the dashboard, or the hosted MCP server's
70
+ * `integrations_check_oauth_status`) — the local server intentionally has
71
+ * no status-check tool yet.
69
72
  */
70
73
  declare const registerIntegrationsTools: RegisterToolsFn;
71
74
  //# sourceMappingURL=integrations.d.ts.map
72
-
73
75
  //#endregion
74
76
  export { type RegisterToolsFn, type ToolContext, type ToolResult, err, ok, registerIntegrationsTools };
75
77
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/integrations.ts"],"mappings":";;;;;;;AAcA;AAgBA;;;;;AAYA;AAMA;AAMA;UAxCiB,WAAA;UACP;;ECcG,OAAA,EAAA,MAAA;;;;;;;;;;;;KDCD,eAAA,YAA2B,gBAAgB;;;;;;;;;;;UAYtC,UAAA;;;;;;;;iBAMD,EAAA,iBAAmB;iBAMnB,GAAA,mBAAsB;;;;;;;AAxCtC;AAgBA;;;;;AAYA;AAMA;AAMA;;;cCzBa,2BAA2B;AAAxC"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/integrations.ts"],"mappings":";;;;;;;AAcA;AAgBA;;;;;AAYA;AAMA;AAMA;UAxCiB,WAAA;UACP;;ECiBG,OAAA,EAAA,MAAA;;;;;;;;;;;;KDFD,eAAA,YAA2B,gBAAgB;;;;;;;;;;;UAYtC,UAAA;;;;;;;;iBAMD,EAAA,iBAAmB;iBAMnB,GAAA,mBAAsB;;;;;;;AAxCtC;AAgBA;;;;;AAYA;AAMA;AAMA;;;;ACtBA;;cAAa,2BAA2B"}
package/dist/index.d.ts CHANGED
@@ -65,11 +65,13 @@ declare function err(message: string): ToolResult;
65
65
  * via `AgentApiClient.getRegistry()`.
66
66
  * - `integrations_start_oauth` — generates the public
67
67
  * `GET /<provider>/oauth/start` URL for the user to open in a browser.
68
- * Pure URL builder; no server-side call.
68
+ * Pure URL builder; no server-side call. Completion is confirmed out of
69
+ * band (the dashboard, or the hosted MCP server's
70
+ * `integrations_check_oauth_status`) — the local server intentionally has
71
+ * no status-check tool yet.
69
72
  */
70
73
  declare const registerIntegrationsTools: RegisterToolsFn;
71
74
  //# sourceMappingURL=integrations.d.ts.map
72
-
73
75
  //#endregion
74
76
  export { type RegisterToolsFn, type ToolContext, type ToolResult, err, ok, registerIntegrationsTools };
75
77
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/integrations.ts"],"mappings":";;;;;;;AAcA;AAgBA;;;;;AAYA;AAMA;AAMA;UAxCiB,WAAA;UACP;;ECcG,OAAA,EAAA,MAAA;;;;;;;;;;;;KDCD,eAAA,YAA2B,gBAAgB;;;;;;;;;;;UAYtC,UAAA;;;;;;;;iBAMD,EAAA,iBAAmB;iBAMnB,GAAA,mBAAsB;;;;;;;AAxCtC;AAgBA;;;;;AAYA;AAMA;AAMA;;;cCzBa,2BAA2B;AAAxC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/integrations.ts"],"mappings":";;;;;;;AAcA;AAgBA;;;;;AAYA;AAMA;AAMA;UAxCiB,WAAA;UACP;;ECiBG,OAAA,EAAA,MAAA;;;;;;;;;;;;KDFD,eAAA,YAA2B,gBAAgB;;;;;;;;;;;UAYtC,UAAA;;;;;;;;iBAMD,EAAA,iBAAmB;iBAMnB,GAAA,mBAAsB;;;;;;;AAxCtC;AAgBA;;;;;AAYA;AAMA;AAMA;;;;ACtBA;;cAAa,2BAA2B"}
package/dist/index.js CHANGED
@@ -40,7 +40,10 @@ const OAUTH_PROVIDERS = [
40
40
  * via `AgentApiClient.getRegistry()`.
41
41
  * - `integrations_start_oauth` — generates the public
42
42
  * `GET /<provider>/oauth/start` URL for the user to open in a browser.
43
- * Pure URL builder; no server-side call.
43
+ * Pure URL builder; no server-side call. Completion is confirmed out of
44
+ * band (the dashboard, or the hosted MCP server's
45
+ * `integrations_check_oauth_status`) — the local server intentionally has
46
+ * no status-check tool yet.
44
47
  */
45
48
  const registerIntegrationsTools = (server, ctx) => {
46
49
  server.registerTool("integrations_browse_registry", {
@@ -54,7 +57,7 @@ const registerIntegrationsTools = (server, ctx) => {
54
57
  }
55
58
  });
56
59
  server.registerTool("integrations_start_oauth", {
57
- description: "Start an OAuth connection flow for an integration. Returns a URL the user must open in their browser to authorize the connection. After authorization, use `integrations_check_oauth_status` (currently in services/mcp) to verify.",
60
+ description: "Start an OAuth connection flow for an integration. Returns a URL the user must open in their browser to authorize the connection. After the user authorizes, the connection appears in the Alfe dashboard — this local server does not expose a status-check tool, so confirm completion there.",
58
61
  inputSchema: {
59
62
  provider: z.enum(OAUTH_PROVIDERS).describe("The OAuth provider to connect"),
60
63
  scopes: z.string().optional().describe("Comma-separated scope groups (e.g. 'gmail,drive' for Google)")
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/types.ts","../src/integrations.ts"],"sourcesContent":["import type { AgentApiClient } from '@alfe.ai/agent-api-client';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\n/**\n * Context every tool registration function receives. The same context is\n * used by the CLI-bundled local server (`@alfe.ai/mcp-server`) and the\n * eventual lift target for `services/mcp` once each domain's public\n * `/agent/...` endpoints land.\n *\n * `agentId` / `tenantId` are derived from `client.whoami()` at the local\n * server's startup. They're carried in the context so tools that need\n * them (e.g. OAuth-URL builders) don't have to re-issue a whoami call\n * per invocation.\n */\nexport interface ToolContext {\n client: AgentApiClient;\n apiUrl: string;\n agentId: string;\n tenantId: string;\n}\n\n/**\n * Tool registration function shape. Each domain module exports one of\n * these; the server calls them with the live `McpServer` and a\n * `ToolContext`. Implementations call `server.registerTool(name, …)` for\n * each subtool they own.\n *\n * Tool names follow the `<domain>_<verb>` convention (no `alfe_` prefix —\n * the bundler namespaces the surface as `mcp__alfe-platform__<name>`).\n */\nexport type RegisterToolsFn = (server: McpServer, ctx: ToolContext) => void;\n\n/**\n * Standard error-result envelope mirroring the existing `services/mcp`\n * shape so the lifted tool surface stays drop-in compatible for any\n * downstream MCP client.\n *\n * The index signature satisfies the MCP SDK's `CallToolResult` shape —\n * the SDK declares its result type with `[x: string]: unknown` so\n * callers can add transport-level metadata. We don't use any, but the\n * shape needs to be assignable for the registration callback to typecheck.\n */\nexport interface ToolResult {\n content: { type: 'text'; text: string }[];\n isError?: boolean;\n [key: string]: unknown;\n}\n\nexport function ok(data: unknown): ToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n}\n\nexport function err(message: string): ToolResult {\n return {\n content: [{ type: 'text', text: message }],\n isError: true,\n };\n}\n","import { z } from 'zod';\nimport { err, ok, type RegisterToolsFn, type ToolContext } from './types.js';\n\nconst OAUTH_PROVIDERS = [\n 'xero',\n 'google',\n 'notion',\n 'microsoft',\n 'atlassian',\n 'myob',\n 'github',\n 'discord',\n 'slack',\n] as const;\n\n/**\n * Thin-slice subset of the `services/mcp` `integrations` domain — only\n * the two subtools whose underlying calls already hit public\n * `/agent/...` (or unauthenticated public) endpoints today. The rest of\n * the domain stays in `services/mcp` until the per-domain endpoint\n * promotion workstream lifts it (see\n * `project_mcp_tool_lift_workstream.md`).\n *\n * - `integrations_browse_registry` — public `GET /integrations/registry`\n * via `AgentApiClient.getRegistry()`.\n * - `integrations_start_oauth` — generates the public\n * `GET /<provider>/oauth/start` URL for the user to open in a browser.\n * Pure URL builder; no server-side call.\n */\nexport const registerIntegrationsTools: RegisterToolsFn = (server, ctx: ToolContext): void => {\n server.registerTool(\n 'integrations_browse_registry',\n {\n description:\n 'Browse available integrations in the registry. Returns the catalogue of all published integrations with their manifests.',\n inputSchema: {},\n },\n async () => {\n try {\n const data = await ctx.client.getRegistry();\n return ok(data);\n } catch (error: unknown) {\n return err(error instanceof Error ? error.message : 'Failed to browse integrations');\n }\n },\n );\n\n server.registerTool(\n 'integrations_start_oauth',\n {\n description:\n 'Start an OAuth connection flow for an integration. Returns a URL the user must open in their browser to authorize the connection. After authorization, use `integrations_check_oauth_status` (currently in services/mcp) to verify.',\n inputSchema: {\n provider: z\n .enum(OAUTH_PROVIDERS)\n .describe('The OAuth provider to connect'),\n scopes: z\n .string()\n .optional()\n .describe(\"Comma-separated scope groups (e.g. 'gmail,drive' for Google)\"),\n },\n },\n ({ provider, scopes }: { provider: (typeof OAUTH_PROVIDERS)[number]; scopes?: string }) => {\n const params = new URLSearchParams({ agentId: ctx.agentId, tenantId: ctx.tenantId });\n if (scopes) params.set('scopes', scopes);\n const url = `${ctx.apiUrl}/${provider}/oauth/start?${params.toString()}`;\n return Promise.resolve(\n ok({\n url,\n provider,\n message: `Open this URL to connect ${provider}: ${url}`,\n }),\n );\n },\n );\n};\n"],"mappings":";;AAgDA,SAAgB,GAAG,MAA2B;AAC5C,QAAO,EACL,SAAS,CAAC;EAAE,MAAM;EAAQ,MAAM,KAAK,UAAU,MAAM,MAAM,EAAE;EAAE,CAAC,EACjE;;AAGH,SAAgB,IAAI,SAA6B;AAC/C,QAAO;EACL,SAAS,CAAC;GAAE,MAAM;GAAQ,MAAM;GAAS,CAAC;EAC1C,SAAS;EACV;;;;ACvDH,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;;;;;;AAgBD,MAAa,6BAA8C,QAAQ,QAA2B;AAC5F,QAAO,aACL,gCACA;EACE,aACE;EACF,aAAa,EAAE;EAChB,EACD,YAAY;AACV,MAAI;AAEF,UAAO,GADM,MAAM,IAAI,OAAO,aAAa,CAC5B;WACR,OAAgB;AACvB,UAAO,IAAI,iBAAiB,QAAQ,MAAM,UAAU,gCAAgC;;GAGzF;AAED,QAAO,aACL,4BACA;EACE,aACE;EACF,aAAa;GACX,UAAU,EACP,KAAK,gBAAgB,CACrB,SAAS,gCAAgC;GAC5C,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,+DAA+D;GAC5E;EACF,GACA,EAAE,UAAU,aAA8E;EACzF,MAAM,SAAS,IAAI,gBAAgB;GAAE,SAAS,IAAI;GAAS,UAAU,IAAI;GAAU,CAAC;AACpF,MAAI,OAAQ,QAAO,IAAI,UAAU,OAAO;EACxC,MAAM,MAAM,GAAG,IAAI,OAAO,GAAG,SAAS,eAAe,OAAO,UAAU;AACtE,SAAO,QAAQ,QACb,GAAG;GACD;GACA;GACA,SAAS,4BAA4B,SAAS,IAAI;GACnD,CAAC,CACH;GAEJ"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/types.ts","../src/integrations.ts"],"sourcesContent":["import type { AgentApiClient } from '@alfe.ai/agent-api-client';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\n/**\n * Context every tool registration function receives. The same context is\n * used by the CLI-bundled local server (`@alfe.ai/mcp-server`) and the\n * eventual lift target for `services/mcp` once each domain's public\n * `/agent/...` endpoints land.\n *\n * `agentId` / `tenantId` are derived from `client.whoami()` at the local\n * server's startup. They're carried in the context so tools that need\n * them (e.g. OAuth-URL builders) don't have to re-issue a whoami call\n * per invocation.\n */\nexport interface ToolContext {\n client: AgentApiClient;\n apiUrl: string;\n agentId: string;\n tenantId: string;\n}\n\n/**\n * Tool registration function shape. Each domain module exports one of\n * these; the server calls them with the live `McpServer` and a\n * `ToolContext`. Implementations call `server.registerTool(name, …)` for\n * each subtool they own.\n *\n * Tool names follow the `<domain>_<verb>` convention (no `alfe_` prefix —\n * the bundler namespaces the surface as `mcp__alfe-platform__<name>`).\n */\nexport type RegisterToolsFn = (server: McpServer, ctx: ToolContext) => void;\n\n/**\n * Standard error-result envelope mirroring the existing `services/mcp`\n * shape so the lifted tool surface stays drop-in compatible for any\n * downstream MCP client.\n *\n * The index signature satisfies the MCP SDK's `CallToolResult` shape —\n * the SDK declares its result type with `[x: string]: unknown` so\n * callers can add transport-level metadata. We don't use any, but the\n * shape needs to be assignable for the registration callback to typecheck.\n */\nexport interface ToolResult {\n content: { type: 'text'; text: string }[];\n isError?: boolean;\n [key: string]: unknown;\n}\n\nexport function ok(data: unknown): ToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],\n };\n}\n\nexport function err(message: string): ToolResult {\n return {\n content: [{ type: 'text', text: message }],\n isError: true,\n };\n}\n","import { z } from 'zod';\nimport { err, ok, type RegisterToolsFn, type ToolContext } from './types.js';\n\nconst OAUTH_PROVIDERS = [\n 'xero',\n 'google',\n 'notion',\n 'microsoft',\n 'atlassian',\n 'myob',\n 'github',\n 'discord',\n 'slack',\n] as const;\n\n/**\n * Thin-slice subset of the `services/mcp` `integrations` domain — only\n * the two subtools whose underlying calls already hit public\n * `/agent/...` (or unauthenticated public) endpoints today. The rest of\n * the domain stays in `services/mcp` until the per-domain endpoint\n * promotion workstream lifts it (see\n * `project_mcp_tool_lift_workstream.md`).\n *\n * - `integrations_browse_registry` — public `GET /integrations/registry`\n * via `AgentApiClient.getRegistry()`.\n * - `integrations_start_oauth` — generates the public\n * `GET /<provider>/oauth/start` URL for the user to open in a browser.\n * Pure URL builder; no server-side call. Completion is confirmed out of\n * band (the dashboard, or the hosted MCP server's\n * `integrations_check_oauth_status`) — the local server intentionally has\n * no status-check tool yet.\n */\nexport const registerIntegrationsTools: RegisterToolsFn = (server, ctx: ToolContext): void => {\n server.registerTool(\n 'integrations_browse_registry',\n {\n description:\n 'Browse available integrations in the registry. Returns the catalogue of all published integrations with their manifests.',\n inputSchema: {},\n },\n async () => {\n try {\n const data = await ctx.client.getRegistry();\n return ok(data);\n } catch (error: unknown) {\n return err(error instanceof Error ? error.message : 'Failed to browse integrations');\n }\n },\n );\n\n server.registerTool(\n 'integrations_start_oauth',\n {\n description:\n 'Start an OAuth connection flow for an integration. Returns a URL the user must open in their browser to authorize the connection. After the user authorizes, the connection appears in the Alfe dashboard — this local server does not expose a status-check tool, so confirm completion there.',\n inputSchema: {\n provider: z\n .enum(OAUTH_PROVIDERS)\n .describe('The OAuth provider to connect'),\n scopes: z\n .string()\n .optional()\n .describe(\"Comma-separated scope groups (e.g. 'gmail,drive' for Google)\"),\n },\n },\n ({ provider, scopes }: { provider: (typeof OAUTH_PROVIDERS)[number]; scopes?: string }) => {\n const params = new URLSearchParams({ agentId: ctx.agentId, tenantId: ctx.tenantId });\n if (scopes) params.set('scopes', scopes);\n const url = `${ctx.apiUrl}/${provider}/oauth/start?${params.toString()}`;\n return Promise.resolve(\n ok({\n url,\n provider,\n message: `Open this URL to connect ${provider}: ${url}`,\n }),\n );\n },\n );\n};\n"],"mappings":";;AAgDA,SAAgB,GAAG,MAA2B;AAC5C,QAAO,EACL,SAAS,CAAC;EAAE,MAAM;EAAQ,MAAM,KAAK,UAAU,MAAM,MAAM,EAAE;EAAE,CAAC,EACjE;;AAGH,SAAgB,IAAI,SAA6B;AAC/C,QAAO;EACL,SAAS,CAAC;GAAE,MAAM;GAAQ,MAAM;GAAS,CAAC;EAC1C,SAAS;EACV;;;;ACvDH,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;;;;;;;;;AAmBD,MAAa,6BAA8C,QAAQ,QAA2B;AAC5F,QAAO,aACL,gCACA;EACE,aACE;EACF,aAAa,EAAE;EAChB,EACD,YAAY;AACV,MAAI;AAEF,UAAO,GADM,MAAM,IAAI,OAAO,aAAa,CAC5B;WACR,OAAgB;AACvB,UAAO,IAAI,iBAAiB,QAAQ,MAAM,UAAU,gCAAgC;;GAGzF;AAED,QAAO,aACL,4BACA;EACE,aACE;EACF,aAAa;GACX,UAAU,EACP,KAAK,gBAAgB,CACrB,SAAS,gCAAgC;GAC5C,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,+DAA+D;GAC5E;EACF,GACA,EAAE,UAAU,aAA8E;EACzF,MAAM,SAAS,IAAI,gBAAgB;GAAE,SAAS,IAAI;GAAS,UAAU,IAAI;GAAU,CAAC;AACpF,MAAI,OAAQ,QAAO,IAAI,UAAU,OAAO;EACxC,MAAM,MAAM,GAAG,IAAI,OAAO,GAAG,SAAS,eAAe,OAAO,UAAU;AACtE,SAAO,QAAQ,QACb,GAAG;GACD;GACA;GACA,SAAS,4BAA4B,SAAS,IAAI;GACnD,CAAC,CACH;GAEJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/mcp-tools",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Shared MCP tool implementations for Alfe's local CLI-bundled MCP server and (later) the Fly-deployed services/mcp. All tools use AgentApiClient against public /agent/... endpoints — never InternalClient.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@modelcontextprotocol/sdk": "^1.29.0",
20
20
  "zod": "^3.25.0",
21
- "@alfe.ai/agent-api-client": "0.2.1"
21
+ "@alfe.ai/agent-api-client": "0.2.2"
22
22
  },
23
23
  "license": "UNLICENSED",
24
24
  "scripts": {