MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseStdioArgs

Function parseStdioArgs

packages/plugins/mcp/src/react/AddMcpSource.tsx:62–71  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

60// Splits the raw args field into tokens, honoring double-quoted groups so an
61// argument with spaces stays intact.
62function parseStdioArgs(raw: string): string[] {
63 if (!raw.trim()) return [];
64 const args: string[] = [];
65 const regex = /[^\s"]+|"([^"]*)"/g;
66 let match;
67 while ((match = regex.exec(raw)) !== null) {
68 args.push(match[1] ?? match[0]);
69 }
70 return args;
71}
72
73// ---------------------------------------------------------------------------
74// State machine (remote flow)

Callers 1

AddMcpSourceFunction · 0.85

Calls 2

execMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected