MCPcopy
hub / github.com/benjitaylor/agentation / createSessionHandler

Function createSessionHandler

mcp/src/server/http.ts:323–336  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

321 * POST /sessions - Create a new session.
322 */
323const createSessionHandler: RouteHandler = async (req, res) => {
324 try {
325 const body = await parseBody<{ url: string; projectId?: string }>(req);
326
327 if (!body.url) {
328 return sendError(res, 400, "url is required");
329 }
330
331 const session = createSession(body.url, body.projectId);
332 sendJson(res, 201, session);
333 } catch (err) {
334 sendError(res, 400, (err as Error).message);
335 }
336};
337
338/**
339 * GET /sessions - List all sessions.

Callers

nothing calls this directly

Calls 3

sendErrorFunction · 0.85
sendJsonFunction · 0.85
createSessionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…