MCPcopy
hub / github.com/VibiumDev/vibium / start

Method start

tests/mcp/server.test.js:25–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 }
24
25 start() {
26 return new Promise((resolve, reject) => {
27 this.proc = spawn(VIBIUM, ['mcp'], {
28 stdio: ['pipe', 'pipe', 'pipe'],
29 });
30
31 this.proc.stdout.on('data', (data) => {
32 this.buffer += data.toString();
33 // Process complete JSON lines
34 const lines = this.buffer.split('\n');
35 this.buffer = lines.pop(); // Keep incomplete line in buffer
36 for (const line of lines) {
37 if (line.trim()) {
38 try {
39 const response = JSON.parse(line);
40 if (this.resolvers.length > 0) {
41 const resolver = this.resolvers.shift();
42 resolver(response);
43 } else {
44 this.responses.push(response);
45 }
46 } catch (e) {
47 // Ignore parse errors for non-JSON output
48 }
49 }
50 }
51 });
52
53 this.proc.on('error', reject);
54
55 // Give process a moment to start
56 setTimeout(resolve, 100);
57 });
58 }
59
60 send(method, params = {}, id = null) {
61 const msg = {

Callers 15

saucedemo-e2e.mjsFile · 0.45
two-tabs.mjsFile · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
runTutorialFunction · 0.45
selectors.test.jsFile · 0.45

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected