@pipeworx/mcp-quickbooks 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pipeworx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # mcp-quickbooks
2
+
3
+ QuickBooks MCP Pack — query customers, invoices, and accounts via QuickBooks Online API.
4
+
5
+ Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `qb_query` | Run a SQL-like query against QuickBooks Online data. Supports queries like "SELECT * FROM Customer WHERE DisplayName LIKE \'%Smith%\'" or "SELECT * FROM Invoice WHERE TotalAmt > 1000". |
12
+ | `qb_get_customer` | Get a single QuickBooks customer by ID. Returns full customer details including name, email, phone, and balance. |
13
+ | `qb_list_invoices` | List recent invoices from QuickBooks. Returns invoice number, customer, amount, due date, and status. |
14
+ | `qb_get_invoice` | Get a single QuickBooks invoice by ID. Returns full invoice details including line items. |
15
+ | `qb_list_accounts` | List chart of accounts from QuickBooks. Returns account name, type, balance, and classification. |
16
+
17
+ ## Quick Start
18
+
19
+ Add to your MCP client config:
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "quickbooks": {
25
+ "url": "https://gateway.pipeworx.io/quickbooks/mcp"
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ Or use the CLI:
32
+
33
+ ```bash
34
+ npx pipeworx use quickbooks
35
+ ```
36
+
37
+ ## License
38
+
39
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-quickbooks",
3
+ "version": "0.1.0",
4
+ "description": "QuickBooks MCP Pack — query customers, invoices, and accounts via QuickBooks Online API.",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "quickbooks"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-quickbooks"
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0"
19
+ }
20
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/quickbooks",
4
+ "title": "quickuooks",
5
+ "description": "QuickBooks MCP Pack — query customers, invoices, and accounts via QuickBooks Online API.",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/quickbooks",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-quickbooks",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/quickbooks/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,137 @@
1
+ interface McpToolDefinition {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: 'object';
6
+ properties: Record<string, unknown>;
7
+ required?: string[];
8
+ };
9
+ }
10
+
11
+ interface McpToolExport {
12
+ tools: McpToolDefinition[];
13
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
14
+ }
15
+
16
+ /**
17
+ * QuickBooks MCP Pack — query customers, invoices, and accounts via QuickBooks Online API.
18
+ *
19
+ * OAuth: uses _context.quickbooks.accessToken and _context.quickbooks.realmId.
20
+ * API: https://quickbooks.api.intuit.com/v3/company/{realmId}
21
+ */
22
+
23
+
24
+ interface QuickBooksContext {
25
+ quickbooks?: { accessToken: string; realmId: string };
26
+ }
27
+
28
+ const BASE_URL = 'https://quickbooks.api.intuit.com/v3/company';
29
+
30
+ async function qbFetch(ctx: QuickBooksContext, path: string) {
31
+ if (!ctx.quickbooks) {
32
+ return { error: 'connection_required', message: 'Connect your QuickBooks account at https://pipeworx.io/account' };
33
+ }
34
+ const { accessToken, realmId } = ctx.quickbooks;
35
+ const res = await fetch(`${BASE_URL}/${realmId}${path}`, {
36
+ headers: {
37
+ Authorization: `Bearer ${accessToken}`,
38
+ Accept: 'application/json',
39
+ },
40
+ });
41
+ if (!res.ok) {
42
+ const text = await res.text();
43
+ throw new Error(`QuickBooks API error (${res.status}): ${text}`);
44
+ }
45
+ return res.json();
46
+ }
47
+
48
+ const tools: McpToolExport['tools'] = [
49
+ {
50
+ name: 'qb_query',
51
+ description: 'Run a SQL-like query against QuickBooks Online data. Supports queries like "SELECT * FROM Customer WHERE DisplayName LIKE \'%Smith%\'" or "SELECT * FROM Invoice WHERE TotalAmt > 1000".',
52
+ inputSchema: {
53
+ type: 'object' as const,
54
+ properties: {
55
+ query: {
56
+ type: 'string',
57
+ description: 'QuickBooks SQL-like query string (e.g., "SELECT * FROM Customer MAXRESULTS 10")',
58
+ },
59
+ },
60
+ required: ['query'],
61
+ },
62
+ },
63
+ {
64
+ name: 'qb_get_customer',
65
+ description: 'Get a single QuickBooks customer by ID. Returns full customer details including name, email, phone, and balance.',
66
+ inputSchema: {
67
+ type: 'object' as const,
68
+ properties: {
69
+ id: { type: 'string', description: 'QuickBooks Customer ID' },
70
+ },
71
+ required: ['id'],
72
+ },
73
+ },
74
+ {
75
+ name: 'qb_list_invoices',
76
+ description: 'List recent invoices from QuickBooks. Returns invoice number, customer, amount, due date, and status.',
77
+ inputSchema: {
78
+ type: 'object' as const,
79
+ properties: {
80
+ max_results: { type: 'number', description: 'Maximum number of invoices to return (default 25, max 1000)' },
81
+ start_position: { type: 'number', description: 'Starting position for pagination (default 1)' },
82
+ },
83
+ },
84
+ },
85
+ {
86
+ name: 'qb_get_invoice',
87
+ description: 'Get a single QuickBooks invoice by ID. Returns full invoice details including line items.',
88
+ inputSchema: {
89
+ type: 'object' as const,
90
+ properties: {
91
+ id: { type: 'string', description: 'QuickBooks Invoice ID' },
92
+ },
93
+ required: ['id'],
94
+ },
95
+ },
96
+ {
97
+ name: 'qb_list_accounts',
98
+ description: 'List chart of accounts from QuickBooks. Returns account name, type, balance, and classification.',
99
+ inputSchema: {
100
+ type: 'object' as const,
101
+ properties: {
102
+ max_results: { type: 'number', description: 'Maximum number of accounts to return (default 100, max 1000)' },
103
+ },
104
+ },
105
+ },
106
+ ];
107
+
108
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
109
+ const context = (args._context ?? {}) as QuickBooksContext;
110
+ delete args._context;
111
+
112
+ switch (name) {
113
+ case 'qb_query': {
114
+ const query = encodeURIComponent(args.query as string);
115
+ return qbFetch(context, `/query?query=${query}`);
116
+ }
117
+ case 'qb_get_customer':
118
+ return qbFetch(context, `/customer/${args.id}`);
119
+ case 'qb_list_invoices': {
120
+ const maxResults = Math.min(1000, (args.max_results as number) ?? 25);
121
+ const startPos = (args.start_position as number) ?? 1;
122
+ const query = encodeURIComponent(`SELECT * FROM Invoice STARTPOSITION ${startPos} MAXRESULTS ${maxResults}`);
123
+ return qbFetch(context, `/query?query=${query}`);
124
+ }
125
+ case 'qb_get_invoice':
126
+ return qbFetch(context, `/invoice/${args.id}`);
127
+ case 'qb_list_accounts': {
128
+ const maxResults = Math.min(1000, (args.max_results as number) ?? 100);
129
+ const query = encodeURIComponent(`SELECT * FROM Account MAXRESULTS ${maxResults}`);
130
+ return qbFetch(context, `/query?query=${query}`);
131
+ }
132
+ default:
133
+ throw new Error(`Unknown tool: ${name}`);
134
+ }
135
+ }
136
+
137
+ export default { tools, callTool, meter: { credits: 10 }, provider: 'quickbooks' } satisfies McpToolExport;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src",
11
+ "declaration": true
12
+ },
13
+ "include": ["src"]
14
+ }