vaiz-mcp 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,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Vaiz
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.
22
+
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # vaiz-mcp
2
+
3
+ MCP (Model Context Protocol) client for Vaiz — connect Cursor/Claude to your Vaiz workspace.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g vaiz-mcp
9
+ ```
10
+
11
+ Or use directly via npx:
12
+
13
+ ```bash
14
+ npx vaiz-mcp
15
+ ```
16
+
17
+ ## Configuration
18
+
19
+ ### Environment Variables
20
+
21
+ | Variable | Required | Description |
22
+ |----------|----------|-------------|
23
+ | `VAIZ_API_TOKEN` | ✅ | Your Vaiz API key (Bearer token) |
24
+ | `VAIZ_SPACE_ID` | ✅ | Your Vaiz Space ID |
25
+ | `VAIZ_API_URL` | ❌ | MCP API URL (default: `https://api.vaiz.com/mcp`) |
26
+ | `VAIZ_DEBUG` | ❌ | Set to `true` for debug output to stderr |
27
+
28
+ ### Cursor Configuration
29
+
30
+ Create or edit `~/.cursor/mcp.json`:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "vaiz": {
36
+ "command": "npx",
37
+ "args": ["vaiz-mcp"],
38
+ "env": {
39
+ "VAIZ_API_TOKEN": "your-api-key",
40
+ "VAIZ_SPACE_ID": "your-space-id"
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ Or after global installation (`npm install -g vaiz-mcp`):
48
+
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "vaiz": {
53
+ "command": "vaiz-mcp",
54
+ "env": {
55
+ "VAIZ_API_TOKEN": "your-api-key",
56
+ "VAIZ_SPACE_ID": "your-space-id"
57
+ }
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ ### Claude Desktop Configuration
64
+
65
+ Add to `claude_desktop_config.json`:
66
+
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "vaiz": {
71
+ "command": "npx",
72
+ "args": ["vaiz-mcp"],
73
+ "env": {
74
+ "VAIZ_API_TOKEN": "your-api-key",
75
+ "VAIZ_SPACE_ID": "your-space-id"
76
+ }
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Usage
83
+
84
+ After configuration, Cursor/Claude will automatically connect to your Vaiz workspace and gain access to:
85
+
86
+ - 🔍 Search tasks, projects, users
87
+ - 📋 Task management (create, edit, comments)
88
+ - 📊 View boards and projects
89
+ - 👥 Team member information
90
+ - 📝 Work with documents and milestones
91
+
92
+ ## Debugging
93
+
94
+ To enable debug output, add the `VAIZ_DEBUG` variable:
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "vaiz": {
100
+ "command": "vaiz-mcp",
101
+ "env": {
102
+ "VAIZ_API_TOKEN": "your-api-key",
103
+ "VAIZ_SPACE_ID": "your-space-id",
104
+ "VAIZ_DEBUG": "true"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ Debug messages will be output to stderr.
112
+
113
+ ## Programmatic Usage
114
+
115
+ You can also use the library programmatically:
116
+
117
+ ```typescript
118
+ import { createVaizMCPClient } from 'vaiz-mcp';
119
+
120
+ const client = createVaizMCPClient({
121
+ apiKey: 'your-api-key',
122
+ spaceId: 'your-space-id',
123
+ });
124
+
125
+ // Initialize connection
126
+ const initResult = await client.initialize();
127
+
128
+ // Get list of tools
129
+ const tools = await client.listTools();
130
+
131
+ // Call a tool
132
+ const result = await client.callTool('search', {
133
+ query: 'important task',
134
+ entityType: 'task'
135
+ });
136
+ ```
137
+
138
+ ## Development
139
+
140
+ ```bash
141
+ # Clone the repository
142
+ git clone https://github.com/vaiz/vaiz-mcp.git
143
+ cd vaiz-mcp
144
+
145
+ # Install dependencies
146
+ npm install
147
+
148
+ # Build the project
149
+ npm run build
150
+
151
+ # Run in development mode
152
+ npm run dev
153
+ ```
154
+
155
+ ## License
156
+
157
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const proxy_server_js_1 = require("./proxy-server.js");
5
+ function printHelp() {
6
+ console.log(`
7
+ vaiz-mcp - MCP proxy server for Vaiz
8
+
9
+ Usage:
10
+ vaiz-mcp [options]
11
+
12
+ Environment Variables:
13
+ VAIZ_API_TOKEN Required. Your Vaiz API key (Bearer token)
14
+ VAIZ_SPACE_ID Required. Your Vaiz Space ID
15
+ VAIZ_API_URL Optional. Vaiz MCP API URL (default: https://api.vaiz.com/mcp)
16
+ VAIZ_DEBUG Optional. Set to 'true' to enable debug logging to stderr
17
+
18
+ Options:
19
+ --help, -h Show this help message
20
+ --version, -v Show version number
21
+
22
+ Example Cursor configuration (~/.cursor/mcp.json):
23
+ {
24
+ "mcpServers": {
25
+ "vaiz": {
26
+ "command": "npx",
27
+ "args": ["vaiz-mcp"],
28
+ "env": {
29
+ "VAIZ_API_TOKEN": "your-api-key",
30
+ "VAIZ_SPACE_ID": "your-space-id"
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ Or after global installation:
37
+ {
38
+ "mcpServers": {
39
+ "vaiz": {
40
+ "command": "vaiz-mcp",
41
+ "env": {
42
+ "VAIZ_API_TOKEN": "your-api-key",
43
+ "VAIZ_SPACE_ID": "your-space-id"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ `);
49
+ }
50
+ function printVersion() {
51
+ console.log('vaiz-mcp v0.1.0');
52
+ }
53
+ function main() {
54
+ const args = process.argv.slice(2);
55
+ if (args.includes('--help') || args.includes('-h')) {
56
+ printHelp();
57
+ process.exit(0);
58
+ }
59
+ if (args.includes('--version') || args.includes('-v')) {
60
+ printVersion();
61
+ process.exit(0);
62
+ }
63
+ // Check for required environment variables
64
+ if (!process.env.VAIZ_API_TOKEN) {
65
+ console.error('Error: VAIZ_API_TOKEN environment variable is required');
66
+ console.error('Run "vaiz-mcp --help" for usage information');
67
+ process.exit(1);
68
+ }
69
+ if (!process.env.VAIZ_SPACE_ID) {
70
+ console.error('Error: VAIZ_SPACE_ID environment variable is required');
71
+ console.error('Run "vaiz-mcp --help" for usage information');
72
+ process.exit(1);
73
+ }
74
+ const server = (0, proxy_server_js_1.createVaizMCPProxyServer)();
75
+ server.start();
76
+ }
77
+ main();
78
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,uDAA6D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B,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { VaizConfig, MCPRequest, MCPResponse } from './types.js';
2
+ export declare class VaizMCPClient {
3
+ private apiKey;
4
+ private spaceId;
5
+ private apiUrl;
6
+ private sessionId;
7
+ constructor(config?: VaizConfig);
8
+ private getHeaders;
9
+ /**
10
+ * Send a JSON-RPC request to the Vaiz MCP server
11
+ */
12
+ sendRequest(request: MCPRequest): Promise<MCPResponse>;
13
+ /**
14
+ * Handle Server-Sent Events response from the MCP server
15
+ */
16
+ private handleSSEResponse;
17
+ /**
18
+ * Initialize the MCP connection
19
+ */
20
+ initialize(): Promise<MCPResponse>;
21
+ /**
22
+ * List available tools from the MCP server
23
+ */
24
+ listTools(): Promise<MCPResponse>;
25
+ /**
26
+ * Call a tool on the MCP server
27
+ */
28
+ callTool(name: string, args?: Record<string, unknown>): Promise<MCPResponse>;
29
+ /**
30
+ * List available resources from the MCP server
31
+ */
32
+ listResources(): Promise<MCPResponse>;
33
+ /**
34
+ * Read a resource from the MCP server
35
+ */
36
+ readResource(uri: string): Promise<MCPResponse>;
37
+ }
38
+ export declare function createVaizMCPClient(config?: VaizConfig): VaizMCPClient;
39
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAc,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIlF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAuB;gBAE5B,MAAM,GAAE,UAAe;IAkBnC,OAAO,CAAC,UAAU;IASlB;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAsC5D;;OAEG;YACW,iBAAiB;IA6D/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC;IAgBxC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC;IAQvC;;OAEG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAYtF;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;IAQ3C;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAQtD;AAED,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,aAAa,CAEtE"}
package/dist/client.js ADDED
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VaizMCPClient = void 0;
4
+ exports.createVaizMCPClient = createVaizMCPClient;
5
+ const DEFAULT_API_URL = 'https://api.vaiz.com/mcp';
6
+ class VaizMCPClient {
7
+ apiKey;
8
+ spaceId;
9
+ apiUrl;
10
+ sessionId = null;
11
+ constructor(config = {}) {
12
+ this.apiKey = config.apiKey || process.env.VAIZ_API_TOKEN || '';
13
+ this.spaceId = config.spaceId || process.env.VAIZ_SPACE_ID || '';
14
+ this.apiUrl = config.apiUrl || process.env.VAIZ_API_URL || DEFAULT_API_URL;
15
+ if (!this.apiKey) {
16
+ throw new Error('Vaiz API key is required. Set VAIZ_API_TOKEN environment variable or pass apiKey in config.');
17
+ }
18
+ if (!this.spaceId) {
19
+ throw new Error('Vaiz Space ID is required. Set VAIZ_SPACE_ID environment variable or pass spaceId in config.');
20
+ }
21
+ }
22
+ getHeaders() {
23
+ return {
24
+ 'Authorization': `Bearer ${this.apiKey}`,
25
+ 'Current-Space-Id': this.spaceId,
26
+ 'Content-Type': 'application/json',
27
+ ...(this.sessionId ? { 'Mcp-Session-Id': this.sessionId } : {}),
28
+ };
29
+ }
30
+ /**
31
+ * Send a JSON-RPC request to the Vaiz MCP server
32
+ */
33
+ async sendRequest(request) {
34
+ const response = await fetch(this.apiUrl, {
35
+ method: 'POST',
36
+ headers: this.getHeaders(),
37
+ body: JSON.stringify(request),
38
+ });
39
+ // Store session ID from response if present
40
+ const newSessionId = response.headers.get('Mcp-Session-Id');
41
+ if (newSessionId) {
42
+ this.sessionId = newSessionId;
43
+ }
44
+ if (!response.ok) {
45
+ const errorText = await response.text();
46
+ return {
47
+ jsonrpc: '2.0',
48
+ id: request.id,
49
+ error: {
50
+ code: -32000,
51
+ message: `HTTP ${response.status}: ${response.statusText}`,
52
+ data: errorText,
53
+ },
54
+ };
55
+ }
56
+ const contentType = response.headers.get('content-type') || '';
57
+ // Handle SSE responses
58
+ if (contentType.includes('text/event-stream')) {
59
+ return this.handleSSEResponse(response, request.id);
60
+ }
61
+ // Handle regular JSON responses
62
+ const result = await response.json();
63
+ return result;
64
+ }
65
+ /**
66
+ * Handle Server-Sent Events response from the MCP server
67
+ */
68
+ async handleSSEResponse(response, requestId) {
69
+ const reader = response.body?.getReader();
70
+ if (!reader) {
71
+ return {
72
+ jsonrpc: '2.0',
73
+ id: requestId,
74
+ error: {
75
+ code: -32000,
76
+ message: 'No response body available',
77
+ },
78
+ };
79
+ }
80
+ const decoder = new TextDecoder();
81
+ let buffer = '';
82
+ let result = null;
83
+ try {
84
+ while (true) {
85
+ const { done, value } = await reader.read();
86
+ if (done)
87
+ break;
88
+ buffer += decoder.decode(value, { stream: true });
89
+ const lines = buffer.split('\n');
90
+ buffer = lines.pop() || '';
91
+ for (const line of lines) {
92
+ if (line.startsWith('data: ')) {
93
+ const data = line.slice(6).trim();
94
+ if (data && data !== '[DONE]') {
95
+ try {
96
+ const parsed = JSON.parse(data);
97
+ if ('id' in parsed && parsed.id === requestId) {
98
+ result = parsed;
99
+ }
100
+ }
101
+ catch {
102
+ // Skip invalid JSON lines
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ finally {
110
+ reader.releaseLock();
111
+ }
112
+ return (result || {
113
+ jsonrpc: '2.0',
114
+ id: requestId,
115
+ error: {
116
+ code: -32000,
117
+ message: 'No valid response received from SSE stream',
118
+ },
119
+ });
120
+ }
121
+ /**
122
+ * Initialize the MCP connection
123
+ */
124
+ async initialize() {
125
+ return this.sendRequest({
126
+ jsonrpc: '2.0',
127
+ id: 'init-1',
128
+ method: 'initialize',
129
+ params: {
130
+ protocolVersion: '2024-11-05',
131
+ capabilities: {},
132
+ clientInfo: {
133
+ name: 'vaiz-mcp',
134
+ version: '0.1.0',
135
+ },
136
+ },
137
+ });
138
+ }
139
+ /**
140
+ * List available tools from the MCP server
141
+ */
142
+ async listTools() {
143
+ return this.sendRequest({
144
+ jsonrpc: '2.0',
145
+ id: 'list-tools-1',
146
+ method: 'tools/list',
147
+ });
148
+ }
149
+ /**
150
+ * Call a tool on the MCP server
151
+ */
152
+ async callTool(name, args = {}) {
153
+ return this.sendRequest({
154
+ jsonrpc: '2.0',
155
+ id: `call-${Date.now()}`,
156
+ method: 'tools/call',
157
+ params: {
158
+ name,
159
+ arguments: args,
160
+ },
161
+ });
162
+ }
163
+ /**
164
+ * List available resources from the MCP server
165
+ */
166
+ async listResources() {
167
+ return this.sendRequest({
168
+ jsonrpc: '2.0',
169
+ id: 'list-resources-1',
170
+ method: 'resources/list',
171
+ });
172
+ }
173
+ /**
174
+ * Read a resource from the MCP server
175
+ */
176
+ async readResource(uri) {
177
+ return this.sendRequest({
178
+ jsonrpc: '2.0',
179
+ id: `read-${Date.now()}`,
180
+ method: 'resources/read',
181
+ params: { uri },
182
+ });
183
+ }
184
+ }
185
+ exports.VaizMCPClient = VaizMCPClient;
186
+ function createVaizMCPClient(config) {
187
+ return new VaizMCPClient(config);
188
+ }
189
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAmNA,kDAEC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EAAE,EAAE,QAAQ,IAAI,CAAC,GAAG,EAAE,EAAE;YACxB,MAAM,EAAE,gBAAgB;YACxB,MAAM,EAAE,EAAE,GAAG,EAAE;SAChB,CAAC,CAAC;IACL,CAAC;CACF;AA7MD,sCA6MC;AAED,SAAgB,mBAAmB,CAAC,MAAmB;IACrD,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { VaizMCPClient, createVaizMCPClient } from './client.js';
2
+ export type { VaizConfig } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createVaizMCPClient = exports.VaizMCPClient = void 0;
4
+ var client_js_1 = require("./client.js");
5
+ Object.defineProperty(exports, "VaizMCPClient", { enumerable: true, get: function () { return client_js_1.VaizMCPClient; } });
6
+ Object.defineProperty(exports, "createVaizMCPClient", { enumerable: true, get: function () { return client_js_1.createVaizMCPClient; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAiE;AAAxD,0GAAA,aAAa,OAAA;AAAE,gHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,35 @@
1
+ import type { VaizConfig } from './types.js';
2
+ /**
3
+ * MCP Proxy Server that forwards stdio JSON-RPC messages to Vaiz HTTP MCP API
4
+ */
5
+ export declare class VaizMCPProxyServer {
6
+ private apiKey;
7
+ private spaceId;
8
+ private apiUrl;
9
+ private sessionId;
10
+ private rl;
11
+ private initialized;
12
+ private debug;
13
+ constructor(config?: VaizConfig & {
14
+ debug?: boolean;
15
+ });
16
+ private log;
17
+ private logError;
18
+ private getHeaders;
19
+ private sendResponse;
20
+ private proxyRequest;
21
+ private handleSSEResponse;
22
+ private handleNotification;
23
+ /**
24
+ * Start the proxy server, listening on stdin and writing to stdout
25
+ */
26
+ start(): void;
27
+ /**
28
+ * Stop the proxy server
29
+ */
30
+ stop(): void;
31
+ }
32
+ export declare function createVaizMCPProxyServer(config?: VaizConfig & {
33
+ debug?: boolean;
34
+ }): VaizMCPProxyServer;
35
+ //# sourceMappingURL=proxy-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy-server.d.ts","sourceRoot":"","sources":["../src/proxy-server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAA4C,MAAM,YAAY,CAAC;AAIvF;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,EAAE,CAAmC;IAC7C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAU;gBAEX,MAAM,GAAE,UAAU,GAAG;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO;IAqBzD,OAAO,CAAC,GAAG;IAMX,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,YAAY;YAMN,YAAY;YAyDZ,iBAAiB;IA+D/B,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IACH,KAAK,IAAI,IAAI;IA8Cb;;OAEG;IACH,IAAI,IAAI,IAAI;CAMb;AAED,wBAAgB,wBAAwB,CACtC,MAAM,CAAC,EAAE,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACxC,kBAAkB,CAEpB"}
@@ -0,0 +1,269 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.VaizMCPProxyServer = void 0;
37
+ exports.createVaizMCPProxyServer = createVaizMCPProxyServer;
38
+ const readline = __importStar(require("readline"));
39
+ const DEFAULT_API_URL = 'https://api.vaiz.com/mcp';
40
+ /**
41
+ * MCP Proxy Server that forwards stdio JSON-RPC messages to Vaiz HTTP MCP API
42
+ */
43
+ class VaizMCPProxyServer {
44
+ apiKey;
45
+ spaceId;
46
+ apiUrl;
47
+ sessionId = null;
48
+ rl = null;
49
+ initialized = false;
50
+ debug;
51
+ constructor(config = {}) {
52
+ this.apiKey = config.apiKey || process.env.VAIZ_API_TOKEN || '';
53
+ this.spaceId = config.spaceId || process.env.VAIZ_SPACE_ID || '';
54
+ this.apiUrl = config.apiUrl || process.env.VAIZ_API_URL || DEFAULT_API_URL;
55
+ this.debug = config.debug || process.env.VAIZ_DEBUG === 'true';
56
+ if (!this.apiKey) {
57
+ this.logError('Vaiz API key is required. Set VAIZ_API_TOKEN environment variable.');
58
+ process.exit(1);
59
+ }
60
+ if (!this.spaceId) {
61
+ this.logError('Vaiz Space ID is required. Set VAIZ_SPACE_ID environment variable.');
62
+ process.exit(1);
63
+ }
64
+ }
65
+ log(message) {
66
+ if (this.debug) {
67
+ process.stderr.write(`[vaiz-mcp] ${message}\n`);
68
+ }
69
+ }
70
+ logError(message) {
71
+ process.stderr.write(`[vaiz-mcp] ERROR: ${message}\n`);
72
+ }
73
+ getHeaders() {
74
+ return {
75
+ 'Authorization': `Bearer ${this.apiKey}`,
76
+ 'Current-Space-Id': this.spaceId,
77
+ 'Content-Type': 'application/json',
78
+ 'Accept': 'application/json, text/event-stream',
79
+ ...(this.sessionId ? { 'Mcp-Session-Id': this.sessionId } : {}),
80
+ };
81
+ }
82
+ sendResponse(response) {
83
+ const json = JSON.stringify(response);
84
+ process.stdout.write(json + '\n');
85
+ this.log(`→ ${json}`);
86
+ }
87
+ async proxyRequest(request) {
88
+ this.log(`← ${JSON.stringify(request)}`);
89
+ try {
90
+ const response = await fetch(this.apiUrl, {
91
+ method: 'POST',
92
+ headers: this.getHeaders(),
93
+ body: JSON.stringify(request),
94
+ });
95
+ // Store session ID from response if present
96
+ const newSessionId = response.headers.get('Mcp-Session-Id');
97
+ if (newSessionId) {
98
+ this.sessionId = newSessionId;
99
+ this.log(`Session ID: ${newSessionId}`);
100
+ }
101
+ if (!response.ok) {
102
+ const errorText = await response.text();
103
+ this.logError(`HTTP ${response.status}: ${errorText}`);
104
+ this.sendResponse({
105
+ jsonrpc: '2.0',
106
+ id: request.id,
107
+ error: {
108
+ code: -32000,
109
+ message: `HTTP ${response.status}: ${response.statusText}`,
110
+ data: errorText,
111
+ },
112
+ });
113
+ return;
114
+ }
115
+ const contentType = response.headers.get('content-type') || '';
116
+ // Handle SSE responses
117
+ if (contentType.includes('text/event-stream')) {
118
+ await this.handleSSEResponse(response, request.id);
119
+ return;
120
+ }
121
+ // Handle regular JSON responses
122
+ const result = await response.json();
123
+ this.sendResponse(result);
124
+ }
125
+ catch (error) {
126
+ const errorMessage = error instanceof Error ? error.message : String(error);
127
+ this.logError(`Request failed: ${errorMessage}`);
128
+ this.sendResponse({
129
+ jsonrpc: '2.0',
130
+ id: request.id,
131
+ error: {
132
+ code: -32000,
133
+ message: `Request failed: ${errorMessage}`,
134
+ },
135
+ });
136
+ }
137
+ }
138
+ async handleSSEResponse(response, requestId) {
139
+ const reader = response.body?.getReader();
140
+ if (!reader) {
141
+ this.sendResponse({
142
+ jsonrpc: '2.0',
143
+ id: requestId,
144
+ error: {
145
+ code: -32000,
146
+ message: 'No response body available',
147
+ },
148
+ });
149
+ return;
150
+ }
151
+ const decoder = new TextDecoder();
152
+ let buffer = '';
153
+ let responseSent = false;
154
+ try {
155
+ while (true) {
156
+ const { done, value } = await reader.read();
157
+ if (done)
158
+ break;
159
+ buffer += decoder.decode(value, { stream: true });
160
+ const lines = buffer.split('\n');
161
+ buffer = lines.pop() || '';
162
+ for (const line of lines) {
163
+ if (line.startsWith('data: ')) {
164
+ const data = line.slice(6).trim();
165
+ if (data && data !== '[DONE]') {
166
+ try {
167
+ const parsed = JSON.parse(data);
168
+ this.sendResponse(parsed);
169
+ if ('id' in parsed && parsed.id === requestId) {
170
+ responseSent = true;
171
+ }
172
+ }
173
+ catch {
174
+ // Skip invalid JSON lines
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ finally {
182
+ reader.releaseLock();
183
+ }
184
+ if (!responseSent) {
185
+ this.sendResponse({
186
+ jsonrpc: '2.0',
187
+ id: requestId,
188
+ error: {
189
+ code: -32000,
190
+ message: 'No valid response received from SSE stream',
191
+ },
192
+ });
193
+ }
194
+ }
195
+ handleNotification(notification) {
196
+ this.log(`← Notification: ${JSON.stringify(notification)}`);
197
+ // Handle initialized notification
198
+ if (notification.method === 'notifications/initialized') {
199
+ this.initialized = true;
200
+ this.log('Client initialized');
201
+ }
202
+ // Forward notifications to the remote server (fire-and-forget)
203
+ fetch(this.apiUrl, {
204
+ method: 'POST',
205
+ headers: this.getHeaders(),
206
+ body: JSON.stringify(notification),
207
+ }).catch((error) => {
208
+ this.log(`Failed to forward notification: ${error}`);
209
+ });
210
+ }
211
+ /**
212
+ * Start the proxy server, listening on stdin and writing to stdout
213
+ */
214
+ start() {
215
+ this.log(`Starting Vaiz MCP proxy server`);
216
+ this.log(`API URL: ${this.apiUrl}`);
217
+ this.log(`Space ID: ${this.spaceId}`);
218
+ this.rl = readline.createInterface({
219
+ input: process.stdin,
220
+ output: process.stdout,
221
+ terminal: false,
222
+ });
223
+ this.rl.on('line', async (line) => {
224
+ if (!line.trim())
225
+ return;
226
+ try {
227
+ const message = JSON.parse(line);
228
+ // Check if it's a request (has 'id') or notification (no 'id')
229
+ if ('id' in message) {
230
+ await this.proxyRequest(message);
231
+ }
232
+ else {
233
+ this.handleNotification(message);
234
+ }
235
+ }
236
+ catch (error) {
237
+ const errorMessage = error instanceof Error ? error.message : String(error);
238
+ this.logError(`Failed to parse message: ${errorMessage}`);
239
+ this.logError(`Raw message: ${line}`);
240
+ }
241
+ });
242
+ this.rl.on('close', () => {
243
+ this.log('stdin closed, shutting down');
244
+ process.exit(0);
245
+ });
246
+ process.on('SIGINT', () => {
247
+ this.log('Received SIGINT, shutting down');
248
+ process.exit(0);
249
+ });
250
+ process.on('SIGTERM', () => {
251
+ this.log('Received SIGTERM, shutting down');
252
+ process.exit(0);
253
+ });
254
+ }
255
+ /**
256
+ * Stop the proxy server
257
+ */
258
+ stop() {
259
+ if (this.rl) {
260
+ this.rl.close();
261
+ this.rl = null;
262
+ }
263
+ }
264
+ }
265
+ exports.VaizMCPProxyServer = VaizMCPProxyServer;
266
+ function createVaizMCPProxyServer(config) {
267
+ return new VaizMCPProxyServer(config);
268
+ }
269
+ //# sourceMappingURL=proxy-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy-server.js","sourceRoot":"","sources":["../src/proxy-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuQA,4DAIC;AA3QD,mDAAqC;AAGrC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD;;GAEG;AACH,MAAa,kBAAkB;IACrB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,SAAS,GAAkB,IAAI,CAAC;IAChC,EAAE,GAA8B,IAAI,CAAC;IACrC,WAAW,GAAG,KAAK,CAAC;IACpB,KAAK,CAAU;IAEvB,YAAY,SAA2C,EAAE;QACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;QAChE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,eAAe,CAAC;QAC3E,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC;QAE/D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,QAAQ,CACX,oEAAoE,CACrE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CACX,oEAAoE,CACrE,CAAC;YACF,OAAO,CAAC,IA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*/
6
+ apiKey?: string;
7
+ /**
8
+ * Current Space ID for Vaiz workspace
9
+ * Can be set via VAIZ_SPACE_ID environment variable
10
+ */
11
+ spaceId?: string;
12
+ /**
13
+ * Vaiz MCP API URL
14
+ * Defaults to https://api.vaiz.com/mcp
15
+ * Can be set via VAIZ_API_URL environment variable
16
+ */
17
+ apiUrl?: string;
18
+ }
19
+ export interface MCPRequest {
20
+ jsonrpc: '2.0';
21
+ id: string | number;
22
+ method: string;
23
+ params?: Record<string, unknown>;
24
+ }
25
+ export interface MCPResponse {
26
+ jsonrpc: '2.0';
27
+ id: string | number;
28
+ result?: unknown;
29
+ error?: {
30
+ code: number;
31
+ message: string;
32
+ data?: unknown;
33
+ };
34
+ }
35
+ export interface MCPNotification {
36
+ jsonrpc: '2.0';
37
+ method: string;
38
+ params?: Record<string, unknown>;
39
+ }
40
+ export type MCPMessage = MCPRequest | MCPResponse | MCPNotification;
41
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,eAAe,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "vaiz-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP (Model Context Protocol) client for Vaiz - connect Cursor/Claude to your Vaiz workspace",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "vaiz-mcp": "dist/cli.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "start": "node dist/cli.js",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "vaiz",
19
+ "cursor",
20
+ "claude",
21
+ "ai",
22
+ "model-context-protocol"
23
+ ],
24
+ "author": "",
25
+ "license": "MIT",
26
+ "engines": {
27
+ "node": ">=18.0.0"
28
+ },
29
+ "dependencies": {
30
+ "@modelcontextprotocol/sdk": "^1.0.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^20.10.0",
34
+ "typescript": "^5.3.0"
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "README.md"
39
+ ],
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/vaiz/vaiz-mcp"
43
+ }
44
+ }
45
+