@qontoctl/mcp 0.0.0 → 0.1.0

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.
Files changed (57) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +69 -0
  3. package/dist/client.d.ts +13 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +21 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/errors.d.ts +10 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +64 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/index.js +14 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/server.d.ts +5 -1
  14. package/dist/server.d.ts.map +1 -1
  15. package/dist/server.js +16 -2
  16. package/dist/server.js.map +1 -1
  17. package/dist/stdio.d.ts +2 -1
  18. package/dist/stdio.d.ts.map +1 -1
  19. package/dist/stdio.js +2 -2
  20. package/dist/stdio.js.map +1 -1
  21. package/dist/testing/index.d.ts +2 -0
  22. package/dist/testing/index.d.ts.map +1 -0
  23. package/dist/testing/index.js +4 -0
  24. package/dist/testing/index.js.map +1 -0
  25. package/dist/testing/mcp-helpers.d.ts +15 -0
  26. package/dist/testing/mcp-helpers.d.ts.map +1 -0
  27. package/dist/testing/mcp-helpers.js +23 -0
  28. package/dist/testing/mcp-helpers.js.map +1 -0
  29. package/dist/tools/accounts.d.ts +4 -0
  30. package/dist/tools/accounts.d.ts.map +1 -0
  31. package/dist/tools/accounts.js +24 -0
  32. package/dist/tools/accounts.js.map +1 -0
  33. package/dist/tools/index.d.ts +7 -0
  34. package/dist/tools/index.d.ts.map +1 -0
  35. package/dist/tools/index.js +9 -0
  36. package/dist/tools/index.js.map +1 -0
  37. package/dist/tools/label.d.ts +4 -0
  38. package/dist/tools/label.d.ts.map +1 -0
  39. package/dist/tools/label.js +45 -0
  40. package/dist/tools/label.js.map +1 -0
  41. package/dist/tools/membership.d.ts +4 -0
  42. package/dist/tools/membership.d.ts.map +1 -0
  43. package/dist/tools/membership.js +29 -0
  44. package/dist/tools/membership.js.map +1 -0
  45. package/dist/tools/org.d.ts +4 -0
  46. package/dist/tools/org.d.ts.map +1 -0
  47. package/dist/tools/org.js +12 -0
  48. package/dist/tools/org.js.map +1 -0
  49. package/dist/tools/statement.d.ts +7 -0
  50. package/dist/tools/statement.d.ts.map +1 -0
  51. package/dist/tools/statement.js +62 -0
  52. package/dist/tools/statement.js.map +1 -0
  53. package/dist/tools/transactions.d.ts +4 -0
  54. package/dist/tools/transactions.d.ts.map +1 -0
  55. package/dist/tools/transactions.js +76 -0
  56. package/dist/tools/transactions.js.map +1 -0
  57. package/package.json +28 -13
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # @qontoctl/mcp
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@qontoctl/mcp?logo=npm)](https://www.npmjs.com/package/@qontoctl/mcp)
4
+
5
+ [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server for [Qonto](https://qonto.com) API integration — lets AI assistants interact with Qonto banking data.
6
+
7
+ Part of the [QontoCtl](https://github.com/alexey-pelykh/qontoctl) project.
8
+
9
+ > **Note:** For end-user usage with Claude Desktop or other MCP clients, install the [`qontoctl`](https://www.npmjs.com/package/qontoctl) umbrella package instead. This package is for programmatic access to the MCP server.
10
+
11
+ ## Installation
12
+
13
+ ```sh
14
+ npm install @qontoctl/mcp
15
+ ```
16
+
17
+ ## Usage with Claude Desktop
18
+
19
+ Add to your Claude Desktop configuration (`claude_desktop_config.json`):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "qontoctl": {
25
+ "command": "npx",
26
+ "args": ["qontoctl", "mcp"]
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Available Tools
33
+
34
+ | Tool | Description |
35
+ | ------------------ | ----------------------------------------------- |
36
+ | `org_show` | Show organization details |
37
+ | `account_list` | List all bank accounts |
38
+ | `account_show` | Show account details by ID |
39
+ | `transaction_list` | List transactions with filtering and pagination |
40
+ | `transaction_show` | Show transaction details by ID |
41
+ | `label_list` | List labels with pagination |
42
+ | `label_show` | Show label details by ID |
43
+ | `membership_list` | List memberships with pagination |
44
+ | `statement_list` | List bank statements with filtering |
45
+ | `statement_show` | Show statement details by ID |
46
+
47
+ ## Programmatic Usage
48
+
49
+ ```ts
50
+ import { createServer } from "@qontoctl/mcp";
51
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
52
+
53
+ const server = createServer({
54
+ getClient: async () => {
55
+ // Return a configured HttpClient instance
56
+ },
57
+ });
58
+
59
+ const transport = new StdioServerTransport();
60
+ await server.connect(transport);
61
+ ```
62
+
63
+ ## Requirements
64
+
65
+ - Node.js >= 24
66
+
67
+ ## License
68
+
69
+ [AGPL-3.0-only](https://github.com/alexey-pelykh/qontoctl/blob/main/LICENSE) — For commercial licensing, contact the maintainer.
@@ -0,0 +1,13 @@
1
+ import { HttpClient } from "@qontoctl/core";
2
+ export interface ClientOptions {
3
+ readonly profile?: string | undefined;
4
+ }
5
+ /**
6
+ * Build an authenticated HttpClient from the user's qontoctl configuration.
7
+ *
8
+ * Resolution order follows @qontoctl/core: profile file → default file → env vars.
9
+ * Endpoint is resolved from config (endpoint field, sandbox flag, or default production).
10
+ */
11
+ export declare function buildClient(options?: ClientOptions): Promise<HttpClient>;
12
+ export type ClientFactory = () => Promise<HttpClient>;
13
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAmE,MAAM,gBAAgB,CAAC;AAE7G,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAY9E;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC"}
package/dist/client.js ADDED
@@ -0,0 +1,21 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { HttpClient, resolveConfig, buildApiKeyAuthorization } from "@qontoctl/core";
4
+ /**
5
+ * Build an authenticated HttpClient from the user's qontoctl configuration.
6
+ *
7
+ * Resolution order follows @qontoctl/core: profile file → default file → env vars.
8
+ * Endpoint is resolved from config (endpoint field, sandbox flag, or default production).
9
+ */
10
+ export async function buildClient(options) {
11
+ const { config, endpoint } = await resolveConfig({ profile: options?.profile });
12
+ // resolveConfig() guarantees apiKey is present (throws ConfigError otherwise)
13
+ const apiKey = config.apiKey;
14
+ const authorization = buildApiKeyAuthorization(apiKey);
15
+ const clientOptions = {
16
+ baseUrl: endpoint,
17
+ authorization,
18
+ };
19
+ return new HttpClient(clientOptions);
20
+ }
21
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,wBAAwB,EAA0B,MAAM,gBAAgB,CAAC;AAM7G;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAuB;IACvD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAChF,8EAA8E;IAC9E,MAAM,MAAM,GAAG,MAAM,CAAC,MAA2C,CAAC;IAClE,MAAM,aAAa,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAEvD,MAAM,aAAa,GAAsB;QACvC,OAAO,EAAE,QAAQ;QACjB,aAAa;KACd,CAAC;IAEF,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type HttpClient } from "@qontoctl/core";
2
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
+ /**
4
+ * Wraps a tool handler with consistent error handling.
5
+ *
6
+ * Resolves the HttpClient lazily and converts known error types
7
+ * into MCP-compliant `isError: true` results.
8
+ */
9
+ export declare function withClient(getClient: () => Promise<HttpClient>, handler: (client: HttpClient) => Promise<CallToolResult>): Promise<CallToolResult>;
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAA8D,MAAM,gBAAgB,CAAC;AAE7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AA+CzE;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,EACpC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,cAAc,CAAC,GACvD,OAAO,CAAC,cAAc,CAAC,CAazB"}
package/dist/errors.js ADDED
@@ -0,0 +1,64 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { ConfigError, AuthError, QontoApiError, QontoRateLimitError } from "@qontoctl/core";
4
+ function textError(message) {
5
+ return {
6
+ content: [{ type: "text", text: message }],
7
+ isError: true,
8
+ };
9
+ }
10
+ function formatConfigError(error) {
11
+ return textError([
12
+ `Configuration error: ${error.message}`,
13
+ "",
14
+ "To configure credentials, create ~/.qontoctl.yaml:",
15
+ "",
16
+ "api-key:",
17
+ " organization-slug: <your-org-slug>",
18
+ " secret-key: <your-secret-key>",
19
+ "",
20
+ "Or set environment variables:",
21
+ " QONTOCTL_ORGANIZATION_SLUG=<your-org-slug>",
22
+ " QONTOCTL_SECRET_KEY=<your-secret-key>",
23
+ ].join("\n"));
24
+ }
25
+ function formatAuthError(error) {
26
+ return textError([
27
+ `Authentication error: ${error.message}`,
28
+ "",
29
+ "Verify your API key credentials in ~/.qontoctl.yaml or environment variables.",
30
+ ].join("\n"));
31
+ }
32
+ function formatApiError(error) {
33
+ const details = error.errors.map((e) => ` - ${e.code}: ${e.detail}`).join("\n");
34
+ return textError(`Qonto API error (HTTP ${error.status}):\n${details}`);
35
+ }
36
+ function formatRateLimitError(error) {
37
+ const retryHint = error.retryAfter !== undefined ? ` Retry after ${error.retryAfter} seconds.` : "";
38
+ return textError(`Rate limit exceeded.${retryHint} Please wait before retrying.`);
39
+ }
40
+ /**
41
+ * Wraps a tool handler with consistent error handling.
42
+ *
43
+ * Resolves the HttpClient lazily and converts known error types
44
+ * into MCP-compliant `isError: true` results.
45
+ */
46
+ export async function withClient(getClient, handler) {
47
+ try {
48
+ const client = await getClient();
49
+ return await handler(client);
50
+ }
51
+ catch (error) {
52
+ if (error instanceof ConfigError)
53
+ return formatConfigError(error);
54
+ if (error instanceof AuthError)
55
+ return formatAuthError(error);
56
+ if (error instanceof QontoApiError)
57
+ return formatApiError(error);
58
+ if (error instanceof QontoRateLimitError)
59
+ return formatRateLimitError(error);
60
+ const message = error instanceof Error ? error.message : String(error);
61
+ return textError(`Unexpected error: ${message}`);
62
+ }
63
+ }
64
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAmB,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI7G,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,SAAS,iB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QACxB,IAAI,KAAK,YAAY,WAAW;YAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAClE,IAAI,KAAK,YAAY,SAAS;YAAE,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAC9D,IAAI,KAAK,YAAY,aAAa;YAAE,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,KAAK,YAAY,mBAAmB;YAAE,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,SAAS,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  // SPDX-License-Identifier: AGPL-3.0-only
3
3
  // Copyright (C) 2026 Oleksii PELYKH
4
+ import { HttpClient, buildApiKeyAuthorization, resolveConfig } from "@qontoctl/core";
4
5
  import { runStdioServer } from "./stdio.js";
5
- await runStdioServer();
6
+ await runStdioServer({
7
+ getClient: async () => {
8
+ const { config, endpoint } = await resolveConfig();
9
+ if (config.apiKey === undefined) {
10
+ throw new Error("No API key credentials found in configuration");
11
+ }
12
+ const authorization = buildApiKeyAuthorization(config.apiKey);
13
+ return new HttpClient({
14
+ baseUrl: endpoint,
15
+ authorization,
16
+ });
17
+ },
18
+ });
6
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,cAAc,CAAC;IACnB,SAAS,EAAE,KAAK,IAAI,EAAE;QACpB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,aAAa,EAAE,CAAC;QACnD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,aAAa,GAAG,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,UAAU,CAAC;YACpB,OAAO,EAAE,QAAQ;YACjB,aAAa;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
package/dist/server.d.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function createServer(): McpServer;
2
+ import type { HttpClient } from "@qontoctl/core";
3
+ export interface CreateServerOptions {
4
+ readonly getClient: () => Promise<HttpClient>;
5
+ }
6
+ export declare function createServer(options?: CreateServerOptions): McpServer;
3
7
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,wBAAgB,YAAY,IAAI,SAAS,CAOxC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAajD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CAC/C;AAED,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAoBrE"}
package/dist/server.js CHANGED
@@ -1,11 +1,25 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-only
2
2
  // Copyright (C) 2026 Oleksii PELYKH
3
+ import { createRequire } from "node:module";
3
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- export function createServer() {
5
+ import { registerAccountTools, registerLabelTools, registerMembershipTools, registerOrgTools, registerStatementTools, registerTransactionTools, } from "./tools/index.js";
6
+ const require = createRequire(import.meta.url);
7
+ const packageJson = require("../package.json");
8
+ export function createServer(options) {
5
9
  const server = new McpServer({
6
10
  name: "qontoctl",
7
- version: "0.0.0",
11
+ version: packageJson.version,
8
12
  });
13
+ const getClient = options?.getClient ??
14
+ (() => {
15
+ throw new Error("No credentials configured. Run 'qontoctl profile add' first.");
16
+ });
17
+ registerAccountTools(server, getClient);
18
+ registerLabelTools(server, getClient);
19
+ registerMembershipTools(server, getClient);
20
+ registerOrgTools(server, getClient);
21
+ registerStatementTools(server, getClient);
22
+ registerTransactionTools(server, getClient);
9
23
  return server;
10
24
  }
11
25
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAMtE,MAAM,UAAU,YAAY,CAAC,OAA6B;IACxD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,WAAW,CAAC,OAAO;KAC7B,CAAC,CAAC;IAEH,MAAM,SAAS,GACb,OAAO,EAAE,SAAS;QAClB,CAAC,GAAG,EAAE;YACJ,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;IAEL,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtC,uBAAuB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3C,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACpC,sBAAsB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAE5C,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/stdio.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import { type CreateServerOptions } from "./server.js";
1
2
  /**
2
3
  * Start the MCP server on stdio and register signal handlers for
3
4
  * graceful shutdown. This function does not return under normal
4
5
  * operation — the process stays alive until SIGINT/SIGTERM.
5
6
  */
6
- export declare function runStdioServer(): Promise<void>;
7
+ export declare function runStdioServer(options?: CreateServerOptions): Promise<void>;
7
8
  //# sourceMappingURL=stdio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA4BpD"}
1
+ {"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,mBAAmB,EAAgB,MAAM,aAAa,CAAC;AAErE;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BjF"}
package/dist/stdio.js CHANGED
@@ -7,8 +7,8 @@ import { createServer } from "./server.js";
7
7
  * graceful shutdown. This function does not return under normal
8
8
  * operation — the process stays alive until SIGINT/SIGTERM.
9
9
  */
10
- export async function runStdioServer() {
11
- const server = createServer();
10
+ export async function runStdioServer(options) {
11
+ const server = createServer(options);
12
12
  const transport = new StdioServerTransport();
13
13
  try {
14
14
  await server.connect(transport);
package/dist/stdio.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stdio.js","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,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,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,OAAO,IAAI,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAE/D,SAAS,QAAQ;QACf,MAAM;aACH,KAAK,EAAE;aACP,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,OAAO,IAAI,CAAC,CAAC;QAC9D,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { connectInMemory, type McpTestContext } from "./mcp-helpers.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ export { connectInMemory } from "./mcp-helpers.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ export interface McpTestContext {
4
+ readonly mcpClient: Client;
5
+ readonly server: McpServer;
6
+ readonly fetchSpy: ReturnType<typeof import("vitest").vi.fn>;
7
+ }
8
+ /**
9
+ * Set up an in-memory MCP client + server pair for integration testing.
10
+ * Stubs global `fetch` with the provided spy.
11
+ */
12
+ export declare function connectInMemory(fetchSpy: ReturnType<typeof import("vitest").vi.fn>, options?: {
13
+ maxRetries?: number;
14
+ }): Promise<McpTestContext>;
15
+ //# sourceMappingURL=mcp-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-helpers.d.ts","sourceRoot":"","sources":["../../src/testing/mcp-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAInE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,cAAc,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC9D;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,UAAU,CAAC,cAAc,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EACnD,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,OAAO,CAAC,cAAc,CAAC,CAczB"}
@@ -0,0 +1,23 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
4
+ import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
5
+ import { HttpClient } from "@qontoctl/core";
6
+ import { createServer } from "../server.js";
7
+ /**
8
+ * Set up an in-memory MCP client + server pair for integration testing.
9
+ * Stubs global `fetch` with the provided spy.
10
+ */
11
+ export async function connectInMemory(fetchSpy, options) {
12
+ const httpClient = new HttpClient({
13
+ baseUrl: "https://thirdparty.qonto.com",
14
+ authorization: "slug:secret",
15
+ ...options,
16
+ });
17
+ const server = createServer({ getClient: () => Promise.resolve(httpClient) });
18
+ const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
19
+ const mcpClient = new Client({ name: "test", version: "0.0.0" });
20
+ await Promise.all([mcpClient.connect(clientTransport), server.connect(serverTransport)]);
21
+ return { mcpClient, server, fetchSpy };
22
+ }
23
+ //# sourceMappingURL=mcp-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-helpers.js","sourceRoot":"","sources":["../../src/testing/mcp-helpers.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAS5C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAmD,EACnD,OAAiC;IAEjC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;QAChC,OAAO,EAAE,8BAA8B;QACvC,aAAa,EAAE,aAAa;QAC5B,GAAG,OAAO;KACX,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC9E,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;IAEhF,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACjE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAEzF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACzC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { HttpClient } from "@qontoctl/core";
3
+ export declare function registerAccountTools(server: McpServer, getClient: () => Promise<HttpClient>): void;
4
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CA0BlG"}
@@ -0,0 +1,24 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { z } from "zod";
4
+ import { withClient } from "../errors.js";
5
+ export function registerAccountTools(server, getClient) {
6
+ server.registerTool("account_list", { description: "List all bank accounts for the organization" }, async () => withClient(getClient, async (client) => {
7
+ const response = await client.get("/v2/bank_accounts");
8
+ return {
9
+ content: [{ type: "text", text: JSON.stringify(response.bank_accounts, null, 2) }],
10
+ };
11
+ }));
12
+ server.registerTool("account_show", {
13
+ description: "Show details of a specific bank account",
14
+ inputSchema: {
15
+ id: z.string().describe("Bank account UUID"),
16
+ },
17
+ }, async ({ id }) => withClient(getClient, async (client) => {
18
+ const response = await client.get(`/v2/bank_accounts/${encodeURIComponent(id)}`);
19
+ return {
20
+ content: [{ type: "text", text: JSON.stringify(response.bank_account, null, 2) }],
21
+ };
22
+ }));
23
+ }
24
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,SAAoC;IAC1F,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAE,EAAE,KAAK,IAAI,EAAE,CAC7G,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAA+B,mBAAmB,CAAC,CAAC;QACrF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAC5F,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,WAAW,EAAE,yCAAyC;QACtD,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;SAC7C;KACF,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CACf,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAA4B,qBAAqB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5G,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAC3F,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { registerAccountTools } from "./accounts.js";
2
+ export { registerLabelTools } from "./label.js";
3
+ export { registerMembershipTools } from "./membership.js";
4
+ export { registerOrgTools } from "./org.js";
5
+ export { registerStatementTools } from "./statement.js";
6
+ export { registerTransactionTools } from "./transactions.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ export { registerAccountTools } from "./accounts.js";
4
+ export { registerLabelTools } from "./label.js";
5
+ export { registerMembershipTools } from "./membership.js";
6
+ export { registerOrgTools } from "./org.js";
7
+ export { registerStatementTools } from "./statement.js";
8
+ export { registerTransactionTools } from "./transactions.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { HttpClient } from "@qontoctl/core";
3
+ export declare function registerLabelTools(server: McpServer, getClient: () => Promise<HttpClient>): void;
4
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/tools/label.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,gBAAgB,CAAC;AAYxE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAsDhG"}
@@ -0,0 +1,45 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { z } from "zod";
4
+ import { withClient } from "../errors.js";
5
+ export function registerLabelTools(server, getClient) {
6
+ server.registerTool("label_list", {
7
+ description: "List all labels in the organization",
8
+ inputSchema: {
9
+ current_page: z.number().int().positive().optional().describe("Page number"),
10
+ per_page: z.number().int().positive().max(100).optional().describe("Items per page (max 100)"),
11
+ },
12
+ }, async ({ current_page, per_page }) => withClient(getClient, async (client) => {
13
+ const params = {};
14
+ if (current_page !== undefined)
15
+ params["current_page"] = String(current_page);
16
+ if (per_page !== undefined)
17
+ params["per_page"] = String(per_page);
18
+ const response = await client.get("/v2/labels", Object.keys(params).length > 0 ? params : undefined);
19
+ return {
20
+ content: [
21
+ {
22
+ type: "text",
23
+ text: JSON.stringify({ labels: response.labels, meta: response.meta }, null, 2),
24
+ },
25
+ ],
26
+ };
27
+ }));
28
+ server.registerTool("label_show", {
29
+ description: "Show details of a specific label",
30
+ inputSchema: {
31
+ id: z.string().describe("Label ID (UUID)"),
32
+ },
33
+ }, async ({ id }) => withClient(getClient, async (client) => {
34
+ const response = await client.get(`/v2/labels/${encodeURIComponent(id)}`);
35
+ return {
36
+ content: [
37
+ {
38
+ type: "text",
39
+ text: JSON.stringify(response.label, null, 2),
40
+ },
41
+ ],
42
+ };
43
+ }));
44
+ }
45
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/tools/label.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAW1C,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,SAAoC;IACxF,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,WAAW,EAAE,qCAAqC;QAClD,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,CAA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C,iBAAiB,CAAC;SAC3C;KACF,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CACf,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAsB,cAAc,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAE/F,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC9C;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { HttpClient } from "@qontoctl/core";
3
+ export declare function registerMembershipTools(server: McpServer, getClient: () => Promise<HttpClient>): void;
4
+ //# sourceMappingURL=membership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../src/tools/membership.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,gBAAgB,CAAC;AAQ7E,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CA+BrG"}
@@ -0,0 +1,29 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { z } from "zod";
4
+ import { withClient } from "../errors.js";
5
+ export function registerMembershipTools(server, getClient) {
6
+ server.registerTool("membership_list", {
7
+ description: "List all memberships in the organization",
8
+ inputSchema: {
9
+ current_page: z.number().int().positive().optional().describe("Page number"),
10
+ per_page: z.number().int().positive().max(100).optional().describe("Items per page (max 100)"),
11
+ },
12
+ }, async ({ current_page, per_page }) => withClient(getClient, async (client) => {
13
+ const params = {};
14
+ if (current_page !== undefined)
15
+ params["current_page"] = String(current_page);
16
+ if (per_page !== undefined)
17
+ params["per_page"] = String(per_page);
18
+ const response = await client.get("/v2/memberships", Object.keys(params).length > 0 ? params : undefined);
19
+ return {
20
+ content: [
21
+ {
22
+ type: "text",
23
+ text: JSON.stringify({ memberships: response.memberships, meta: response.meta }, null, 2),
24
+ },
25
+ ],
26
+ };
27
+ }));
28
+ }
29
+ //# sourceMappingURL=membership.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"membership.js","sourceRoot":"","sources":["../../src/tools/membership.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAEpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,SAAoC;IAC7F,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EAAE,0CAA0C;QACvD,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC5E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;SAC/F;KACF,EACD,KAAK,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,CACnC,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAI,YAAY,KAAK,SAAS;YAAE,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9E,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAC/B,iBAAiB,EACjB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CACpD,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC1F;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { HttpClient } from "@qontoctl/core";
3
+ export declare function registerOrgTools(server: McpServer, getClient: () => Promise<HttpClient>): void;
4
+ //# sourceMappingURL=org.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/tools/org.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAY9F"}
@@ -0,0 +1,12 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (C) 2026 Oleksii PELYKH
3
+ import { withClient } from "../errors.js";
4
+ export function registerOrgTools(server, getClient) {
5
+ server.registerTool("org_show", { description: "Show organization details including name, slug, and bank accounts" }, async () => withClient(getClient, async (client) => {
6
+ const response = await client.get("/v2/organization");
7
+ return {
8
+ content: [{ type: "text", text: JSON.stringify(response.organization, null, 2) }],
9
+ };
10
+ }));
11
+ }
12
+ //# sourceMappingURL=org.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org.js","sourceRoot":"","sources":["../../src/tools/org.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oCAAoC;AAIpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,SAAoC;IACtF,MAAM,CAAC,YAAY,CACjB,UAAU,EACV,EAAE,WAAW,EAAE,mEAAmE,EAAE,EACpF,KAAK,IAAI,EAAE,CACT,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAA4B,kBAAkB,CAAC,CAAC;QACjF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAC3F,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { HttpClient } from "@qontoctl/core";
3
+ /**
4
+ * Register statement-related MCP tools on the server.
5
+ */
6
+ export declare function registerStatementTools(server: McpServer, getClient: () => Promise<HttpClient>): void;
7
+ //# sourceMappingURL=statement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement.d.ts","sourceRoot":"","sources":["../../src/tools/statement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,gBAAgB,CAAC;AAQ5E;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAuEpG"}