As in, how MCP client can access `git` command without stdio? You can run a wrapper server for that or use stdio instead
MCP clients don't access any commands. MCP clients access tools that MCP servers expose.
try {
const execPromise = promisify(exec);
const { stdout, stderr } = await execPromise(command);
if (stderr) {
return {
content: [{
type: "text",
text: `Error: ${stderr}`
}],
isError: true
};
}
return {
content: [{
type: "text",
text: stdout
}],
isError: false
};
} catch (error: any) {
return {
content: [{
type: "text",
text: `Error executing command: ${error.message}`
}],
isError: true
};
}
Yeah, if you want to be super technical, it's Node that does the actual command running, but in my opinion, that's as good as saying the MCP client is...That all said, the real underlying mistake here isn't the choice of SSE... it is trying to use JSON-RPC -- a protocol which very explicitly and very proudly is supposed to be stateless -- and to then use it in a way that is stateful in a ton of ways that aren't ignorable, which in turn causes all of this other insanity. If they had correctly factored out the state and not incorrectly attempted to pretend JSON-RPC was capable of state (which might have been more obvious if they used an off-the-shelf JSON-RPC library in their initial implementation, which clearly isn't ever going to be possible with what they threw together), they wouldn't have caused any of this mess, and the question about the transport wouldn't even be an issue.
SSE only gained traction after HTTP/2 came around with multiplexing.
Genuinely curious, I don’t know the answer. But intuitively JSON is nice for easy to read payloads for transport but to be able to provide rich context around specific parts of text seems right up XML’s alley?
Two simple but useful examples would be inline markup to define a series of numbers as a date or telephone number or a particular phrase tagged as being a different language from the main document. Inline semantic tags would let LLMs better understand the context of those tokens. JSON can't really do that while it's a native aspect of XML.