Connecting to a Real Service
This is a member-only chapter. Log in with your Signal Over Noise membership email to continue.
Log in to readModule 4 · Section 6 of 9
Connecting to a Real Service
Here’s the pattern from mcp-fantastical, simplified. The server calls a macOS shortcut that Fantastical exposes, parses the result, and returns formatted calendar events:
import { execSync } from "child_process";
function getEvents(startDate: string, endDate: string): string {
try {
const result = execSync(
`shortcuts run "Get Calendar Events" --input-path /dev/null`,
{ encoding: "utf8" }
);
return parseEvents(result);
} catch (error) {
throw new Error(`Failed to fetch events: ${error}`);
}
}
The key point: the server is a thin wrapper. It calls the actual service, handles errors, formats results, and returns them. The MCP layer is just the interface between that logic and Claude.