@ebowwa/claude-code-mcp 1.0.0 → 1.0.2

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 (48) hide show
  1. package/dist/__tests__/advanced.test.d.ts +6 -0
  2. package/dist/__tests__/advanced.test.d.ts.map +1 -0
  3. package/dist/__tests__/advanced.test.js +354 -0
  4. package/dist/__tests__/advanced.test.js.map +1 -0
  5. package/dist/advanced.d.ts +109 -0
  6. package/dist/advanced.d.ts.map +1 -0
  7. package/dist/advanced.js +427 -0
  8. package/dist/advanced.js.map +1 -0
  9. package/dist/cli-wrapper.d.ts +202 -0
  10. package/dist/cli-wrapper.d.ts.map +1 -0
  11. package/dist/cli-wrapper.js +347 -0
  12. package/dist/cli-wrapper.js.map +1 -0
  13. package/dist/cli-wrapper.test.d.ts +12 -0
  14. package/dist/cli-wrapper.test.d.ts.map +1 -0
  15. package/dist/cli-wrapper.test.js +354 -0
  16. package/dist/cli-wrapper.test.js.map +1 -0
  17. package/dist/cli.d.ts +16 -0
  18. package/dist/cli.d.ts.map +1 -0
  19. package/dist/cli.js +354 -0
  20. package/dist/cli.js.map +1 -0
  21. package/dist/index.d.ts +10 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +561 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/integration.test.d.ts +12 -0
  26. package/dist/integration.test.d.ts.map +1 -0
  27. package/dist/integration.test.js +716 -0
  28. package/dist/integration.test.js.map +1 -0
  29. package/dist/queue.d.ts +87 -0
  30. package/dist/queue.d.ts.map +1 -0
  31. package/dist/queue.js +273 -0
  32. package/dist/queue.js.map +1 -0
  33. package/dist/teammates-integration.d.ts +128 -0
  34. package/dist/teammates-integration.d.ts.map +1 -0
  35. package/dist/teammates-integration.js +353 -0
  36. package/dist/teammates-integration.js.map +1 -0
  37. package/dist/test-config.d.ts +104 -0
  38. package/dist/test-config.d.ts.map +1 -0
  39. package/dist/test-config.js +439 -0
  40. package/dist/test-config.js.map +1 -0
  41. package/dist/tools.d.ts +97 -0
  42. package/dist/tools.d.ts.map +1 -0
  43. package/dist/tools.js +627 -0
  44. package/dist/tools.js.map +1 -0
  45. package/package.json +7 -1
  46. package/ARCHITECTURE.md +0 -1802
  47. package/DOCUMENTATION.md +0 -747
  48. package/TESTING.md +0 -318
@@ -0,0 +1,439 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * Test Configuration and Utilities
4
+ *
5
+ * Shared test utilities and mock helpers for the Claude Code MCP server tests.
6
+ */
7
+ import { mkdir, writeFile, rm } from 'node:fs/promises';
8
+ import { join } from 'node:path';
9
+ /**
10
+ * Test environment configuration
11
+ */
12
+ export const TEST_CONFIG = {
13
+ // Temporary directory for test artifacts
14
+ testDir: '/tmp/claude-code-mcp-tests',
15
+ // Mock Claude binary path
16
+ mockClaudePath: '/tmp/mock-claude-binary.sh',
17
+ // Test project path
18
+ testProjectPath: '/tmp/test-claude-project',
19
+ // Default timeout for tests (ms)
20
+ defaultTimeout: 5000,
21
+ // Session cleanup age (ms)
22
+ sessionCleanupAge: 86400000, // 24 hours
23
+ };
24
+ /**
25
+ * Mock session data
26
+ */
27
+ export const MOCK_SESSIONS = {
28
+ active: {
29
+ id: 'test-session-active-123',
30
+ projectPath: '/path/to/project',
31
+ status: 'running',
32
+ startTime: Date.now(),
33
+ pid: 12345,
34
+ messages: [],
35
+ output: ['Starting session...', 'Processing task...'],
36
+ },
37
+ completed: {
38
+ id: 'test-session-completed-456',
39
+ projectPath: '/path/to/project',
40
+ status: 'completed',
41
+ startTime: Date.now() - 3600000,
42
+ endTime: Date.now() - 3000000,
43
+ pid: 12346,
44
+ messages: [
45
+ { role: 'user', content: 'Complete this task', timestamp: Date.now() - 3500000 },
46
+ { role: 'assistant', content: 'Task completed', timestamp: Date.now() - 3400000 }
47
+ ],
48
+ output: ['Starting...', 'Processing...', 'Complete!'],
49
+ },
50
+ error: {
51
+ id: 'test-session-error-789',
52
+ projectPath: '/path/to/project',
53
+ status: 'error',
54
+ startTime: Date.now() - 1800000,
55
+ endTime: Date.now() - 1700000,
56
+ error: 'Simulated error condition',
57
+ output: ['Starting...', 'Error: Something went wrong'],
58
+ },
59
+ };
60
+ /**
61
+ * Doppler test configurations
62
+ */
63
+ export const DOPPLER_TEST_CONFIGS = {
64
+ valid: {
65
+ project: 'test-project',
66
+ config: 'dev',
67
+ token: 'dp.st.test-token-123',
68
+ },
69
+ missingProject: {
70
+ project: undefined,
71
+ config: 'dev',
72
+ token: 'dp.st.test-token-123',
73
+ },
74
+ missingConfig: {
75
+ project: 'test-project',
76
+ config: undefined,
77
+ token: 'dp.st.test-token-123',
78
+ },
79
+ missingToken: {
80
+ project: 'test-project',
81
+ config: 'dev',
82
+ token: undefined,
83
+ },
84
+ };
85
+ /**
86
+ * Mock API keys for testing rolling keys feature
87
+ */
88
+ export const MOCK_API_KEYS = {
89
+ single: 'sk-ant-test-key-123',
90
+ multiple: '["sk-ant-key1","sk-ant-key2","sk-ant-key3"]',
91
+ empty: '[]',
92
+ malformed: '[not-valid-json]',
93
+ };
94
+ /**
95
+ * Setup test environment
96
+ */
97
+ export async function setupTestEnvironment() {
98
+ // Create test directory
99
+ await mkdir(TEST_CONFIG.testDir, { recursive: true });
100
+ await mkdir(TEST_CONFIG.testProjectPath, { recursive: true });
101
+ // Create mock CLAUDE.md in test project
102
+ await writeFile(join(TEST_CONFIG.testProjectPath, '.claude', 'CLAUDE.md'), '# Test Project Instructions\n\nThis is a test project for Claude Code MCP server tests.');
103
+ }
104
+ /**
105
+ * Cleanup test environment
106
+ */
107
+ export async function cleanupTestEnvironment() {
108
+ try {
109
+ await rm(TEST_CONFIG.testDir, { recursive: true, force: true });
110
+ await rm(TEST_CONFIG.testProjectPath, { recursive: true, force: true });
111
+ }
112
+ catch {
113
+ // Ignore cleanup errors
114
+ }
115
+ }
116
+ /**
117
+ * Create a mock Claude binary for testing
118
+ */
119
+ export async function createMockClaudeBinary(customScript) {
120
+ const script = customScript || `#!/bin/bash
121
+ # Mock Claude Binary for Testing
122
+
123
+ echo "[Mock Claude] Called with: $@" >&2
124
+
125
+ case "$1" in
126
+ --version)
127
+ echo "claude version 1.0.0 (mock)"
128
+ exit 0
129
+ ;;
130
+ --help)
131
+ echo "Mock Claude Code CLI"
132
+ echo "Usage: claude [options] [message]"
133
+ echo ""
134
+ echo "Options:"
135
+ echo " --version Show version"
136
+ echo " --help Show help"
137
+ echo " --resume UUID Resume session"
138
+ exit 0
139
+ ;;
140
+ --resume)
141
+ UUID="$2"
142
+ echo "[Mock Claude] Resuming session: $UUID" >&2
143
+ sleep 0.05
144
+ echo '{"status":"resumed","sessionId":"'"$UUID"'","output":"Session resumed"}'
145
+ exit 0
146
+ ;;
147
+ *)
148
+ # Simulate starting a new session
149
+ echo "[Mock Claude] Starting new session..." >&2
150
+ sleep 0.05
151
+ SESSION_ID="mock-session-$(date +%s%N)"
152
+ echo '{"status":"started","sessionId":"'"$SESSION_ID"'","output":"Session started"}'
153
+ exit 0
154
+ ;;
155
+ esac
156
+ `;
157
+ await writeFile(TEST_CONFIG.mockClaudePath, script, { mode: 0o755 });
158
+ return TEST_CONFIG.mockClaudePath;
159
+ }
160
+ /**
161
+ * Create a mock doppler command for testing
162
+ */
163
+ export async function createMockDoppler() {
164
+ const mockPath = '/tmp/mock-doppler.sh';
165
+ const script = `#!/bin/bash
166
+ # Mock Doppler CLI for Testing
167
+
168
+ echo "[Mock Doppler] Called with: $@" >&2
169
+
170
+ case "$1" in
171
+ run)
172
+ # Mock doppler run - inject environment and run command
173
+ export ANTHROPIC_API_KEY="sk-ant-mock-test-key"
174
+ export DOPPLER_PROJECT="${DOPPLER_PROJECT;
175
+ -test - project;
176
+ }
177
+ ";
178
+ DOPPLER_CONFIG = "${DOPPLER_CONFIG:-dev}";
179
+ #;
180
+ Extract;
181
+ command;
182
+ after--;
183
+ or--;
184
+ command;
185
+ shift;
186
+ while ([[$, # - gt, 0]])
187
+ ;
188
+ do
189
+ ;
190
+ while ();
191
+ "$1" in
192
+ --project | --config;
193
+ shift;
194
+ 2;
195
+ ;
196
+ --command;
197
+ shift;
198
+ eval;
199
+ "$1";
200
+ exit;
201
+ $ ?
202
+ :
203
+ ;
204
+ ;
205
+ --;
206
+ shift;
207
+ eval;
208
+ "$@";
209
+ exit;
210
+ $ ?
211
+ :
212
+ ;
213
+ ;
214
+ * ;
215
+ shift;
216
+ ;
217
+ esac;
218
+ done;
219
+ ;
220
+ secrets;
221
+ #;
222
+ Mock;
223
+ doppler;
224
+ secrets;
225
+ commands;
226
+ "$2" in
227
+ list;
228
+ echo;
229
+ 'NAME VALUE';
230
+ echo;
231
+ 'anthropic_api_key sk-ant-mock-test-key';
232
+ echo;
233
+ 'doppler_token dp.st.test-token-123';
234
+ ;
235
+ set;
236
+ echo;
237
+ "[Mock Doppler] Secret set: $3";
238
+ ;
239
+ esac;
240
+ ;
241
+ * ;
242
+ echo;
243
+ "[Mock Doppler] Unknown command: $1" > & 2;
244
+ exit;
245
+ 1;
246
+ ;
247
+ esac `;
248
+
249
+ await writeFile(mockPath, script, { mode: 0o755 });
250
+ return mockPath;
251
+ }
252
+
253
+ /**
254
+ * Mock MCP server for testing
255
+ */
256
+ export class MockMCPServer {
257
+ tools = new Map<string, Function>();
258
+ sessions = new Map<string, any>();
259
+ resources = new Map<string, any>();
260
+
261
+ registerTool(name: string, handler: Function): void {
262
+ this.tools.set(name, handler);
263
+ }
264
+
265
+ async callTool(name: string, args: any): Promise<any> {
266
+ const handler = this.tools.get(name);
267
+ if (!handler) {
268
+ return {
269
+ content: [{
270
+ type: 'text',
271
+ text: JSON.stringify({ error: `;
272
+ Tool;
273
+ not;
274
+ found: $;
275
+ {
276
+ name;
277
+ }
278
+ ` })
279
+ }],
280
+ isError: true
281
+ };
282
+ }
283
+ return await handler.call(this, args);
284
+ }
285
+
286
+ listTools(): string[] {
287
+ return Array.from(this.tools.keys());
288
+ }
289
+
290
+ // Session management helpers
291
+ addSession(session: any): void {
292
+ this.sessions.set(session.id, session);
293
+ }
294
+
295
+ getSession(id: string): any | undefined {
296
+ return this.sessions.get(id);
297
+ }
298
+
299
+ listSessions(filter?: { status?: string; projectPath?: string }): any[] {
300
+ let sessions = Array.from(this.sessions.values());
301
+
302
+ if (filter?.status) {
303
+ sessions = sessions.filter(s => s.status === filter.status);
304
+ }
305
+ if (filter?.projectPath) {
306
+ sessions = sessions.filter(s => s.projectPath === filter.projectPath);
307
+ }
308
+
309
+ return sessions;
310
+ }
311
+
312
+ removeSession(id: string): boolean {
313
+ return this.sessions.delete(id);
314
+ }
315
+
316
+ clear(): void {
317
+ this.tools.clear();
318
+ this.sessions.clear();
319
+ this.resources.clear();
320
+ }
321
+ }
322
+
323
+ /**
324
+ * Test assertion helpers
325
+ */
326
+ export const expect = {
327
+ success: (result: any) => {
328
+ if (result.isError) {
329
+ throw new Error(`;
330
+ Expected;
331
+ success;
332
+ but;
333
+ got;
334
+ error: $;
335
+ {
336
+ JSON.stringify(result);
337
+ }
338
+ `);
339
+ }
340
+ },
341
+
342
+ error: (result: any, expectedError?: string) => {
343
+ if (!result.isError) {
344
+ throw new Error(`;
345
+ Expected;
346
+ error;
347
+ but;
348
+ got;
349
+ success: $;
350
+ {
351
+ JSON.stringify(result);
352
+ }
353
+ `);
354
+ }
355
+ if (expectedError) {
356
+ const text = result.content[0]?.text || '';
357
+ if (!text.includes(expectedError)) {
358
+ throw new Error(`;
359
+ Expected;
360
+ error;
361
+ containing;
362
+ "${expectedError}";
363
+ but;
364
+ got: $;
365
+ {
366
+ text;
367
+ }
368
+ `);
369
+ }
370
+ }
371
+ },
372
+
373
+ sessionId: (result: any) => {
374
+ const data = JSON.parse(result.content[0]?.text || '{}');
375
+ if (!data.sessionId) {
376
+ throw new Error(`;
377
+ Expected;
378
+ sessionId in result;
379
+ $;
380
+ {
381
+ JSON.stringify(result);
382
+ }
383
+ `);
384
+ }
385
+ return data.sessionId;
386
+ },
387
+
388
+ contains: (text: string, substring: string) => {
389
+ if (!text.includes(substring)) {
390
+ throw new Error(`;
391
+ Expected;
392
+ "${text}";
393
+ to;
394
+ contain;
395
+ "${substring}" `);
396
+ }
397
+ }
398
+ };
399
+
400
+ /**
401
+ * Wait helper for async tests
402
+ */
403
+ export const wait = (ms: number): Promise<void> =>
404
+ new Promise(resolve => setTimeout(resolve, ms));
405
+
406
+ /**
407
+ * Retry helper for flaky tests
408
+ */
409
+ export async function retry<T>(
410
+ fn: () => T,
411
+ options: { maxAttempts?: number; delay?: number } = {}
412
+ ): Promise<T> {
413
+ const { maxAttempts = 3, delay = 100 } = options;
414
+
415
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
416
+ try {
417
+ return await fn();
418
+ } catch (error) {
419
+ if (attempt === maxAttempts) {
420
+ throw error;
421
+ }
422
+ await wait(delay * attempt);
423
+ }
424
+ }
425
+
426
+ throw new Error('Retry failed');
427
+ }
428
+
429
+ /**
430
+ * Performance timing helper
431
+ */
432
+ export async function time<T>(fn: () => T): Promise<{ result: T; duration: number }> {
433
+ const start = Date.now();
434
+ const result = await fn();
435
+ const duration = Date.now() - start;
436
+ return { result, duration };
437
+ }
438
+ ;
439
+ //# sourceMappingURL=test-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-config.js","sourceRoot":"","sources":["../src/test-config.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,yCAAyC;IACzC,OAAO,EAAE,4BAA4B;IAErC,0BAA0B;IAC1B,cAAc,EAAE,4BAA4B;IAE5C,oBAAoB;IACpB,eAAe,EAAE,0BAA0B;IAE3C,iCAAiC;IACjC,cAAc,EAAE,IAAI;IAEpB,2BAA2B;IAC3B,iBAAiB,EAAE,QAAQ,EAAE,WAAW;CACzC,CAAC;AAEF;;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AAC;AAAA;;;;;yBAKvD,CAAA;AAAA,QAAQ,CAAA;AAAC,KAAK,CAAA;AAAC,UAAU,CAAA;AAAC,kBAAkB,CAAA;AAAC,GAAG,CAAA;AAAC,GAAG,EAAE,CAAC,CAAA;AAAA,CAAC;IAAA,IAAI,CAAA;AAAA,CAAC;AAAA;;;;;;;;uBAQ/D,CAAA;AAAA,QAAQ,CAAA;AAAC,SAAS,IAAI,MAAM,CAAA;AAAE,CAAC,CAAA;AAAA,CAAC;IAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;AAAA,CAAC;AAAA;;;;;;;uBAOvD,CAAA;AAAA,QAAQ,CAAA;AAAC,SAAS,CAAA;AAAC,EAAE,CAAA;AAAC,OAAO,CAAA;AAAC,cAAc,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CnE,CAAA"}
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * Claude Code MCP Server - Control Tools
4
+ *
5
+ * MCP server for controlling Claude Code instances with Doppler integration.
6
+ * Provides tools for starting, resuming, listing, and killing Claude Code sessions.
7
+ *
8
+ * This complements claude-code-history MCP which focuses on READ operations.
9
+ * This package focuses on CONTROL operations.
10
+ */
11
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
12
+ /**
13
+ * Start a new Claude Code session
14
+ */
15
+ declare function startSession(args: unknown): Promise<{
16
+ isError?: boolean | undefined;
17
+ content: {
18
+ type: string;
19
+ text: string;
20
+ }[];
21
+ }>;
22
+ /**
23
+ * Resume an existing Claude Code session
24
+ */
25
+ declare function resumeSession(args: unknown): Promise<{
26
+ isError?: boolean | undefined;
27
+ content: {
28
+ type: string;
29
+ text: string;
30
+ }[];
31
+ }>;
32
+ /**
33
+ * List all Claude Code sessions
34
+ */
35
+ declare function listSessions(args: unknown): Promise<{
36
+ isError?: boolean | undefined;
37
+ content: {
38
+ type: string;
39
+ text: string;
40
+ }[];
41
+ }>;
42
+ /**
43
+ * Kill a Claude Code session
44
+ */
45
+ declare function killSession(args: unknown): Promise<{
46
+ isError?: boolean | undefined;
47
+ content: {
48
+ type: string;
49
+ text: string;
50
+ }[];
51
+ }>;
52
+ /**
53
+ * Get session status
54
+ */
55
+ declare function getSessionStatus(args: unknown): Promise<{
56
+ isError?: boolean | undefined;
57
+ content: {
58
+ type: string;
59
+ text: string;
60
+ }[];
61
+ }>;
62
+ declare const server: Server<{
63
+ method: string;
64
+ params?: {
65
+ [x: string]: unknown;
66
+ _meta?: {
67
+ [x: string]: unknown;
68
+ progressToken?: string | number | undefined;
69
+ "io.modelcontextprotocol/related-task"?: {
70
+ taskId: string;
71
+ } | undefined;
72
+ } | undefined;
73
+ } | undefined;
74
+ }, {
75
+ method: string;
76
+ params?: {
77
+ [x: string]: unknown;
78
+ _meta?: {
79
+ [x: string]: unknown;
80
+ progressToken?: string | number | undefined;
81
+ "io.modelcontextprotocol/related-task"?: {
82
+ taskId: string;
83
+ } | undefined;
84
+ } | undefined;
85
+ } | undefined;
86
+ }, {
87
+ [x: string]: unknown;
88
+ _meta?: {
89
+ [x: string]: unknown;
90
+ progressToken?: string | number | undefined;
91
+ "io.modelcontextprotocol/related-task"?: {
92
+ taskId: string;
93
+ } | undefined;
94
+ } | undefined;
95
+ }>;
96
+ export { server, startSession, resumeSession, listSessions, killSession, getSessionStatus };
97
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAoOnE;;GAEG;AACH,iBAAe,YAAY,CAAC,IAAI,EAAE,OAAO;;;;;;GA6GxC;AAED;;GAEG;AACH,iBAAe,aAAa,CAAC,IAAI,EAAE,OAAO;;;;;;GAkFzC;AAED;;GAEG;AACH,iBAAe,YAAY,CAAC,IAAI,EAAE,OAAO;;;;;;GAqCxC;AAED;;GAEG;AACH,iBAAe,WAAW,CAAC,IAAI,EAAE,OAAO;;;;;;GA2EvC;AAED;;GAEG;AACH,iBAAe,gBAAgB,CAAC,IAAI,EAAE,OAAO;;;;;;GAmC5C;AAMD,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUX,CAAC;AAuKF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC"}