INNER CODE UNIT · TypeScript
makeRequest
jasonjmcghee/claude-debugs-for-you · mcp/src/index.ts:40
async function makeRequest(payload: any): Promise<any> {
const port = getPortFromConfig();
return new Promise((resolve, reject) => {
const data = JSON.stringify(payload);
const req = http.request({
hostname: 'localhost',
port,
path: '/tcp',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)
}
}, res => {
let body = '';
res.on('data', chunk => body += chunk);