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

Function propsForPrincipal

apps/cloud/src/mcp/agent-handler.ts:122–139  ·  view source on GitHub ↗
(
  request: Request,
  principal: Extract<AuthOutcome, { readonly _tag: "Authenticated" }>["principal"],
  resource: McpResource,
)

Source from the content-addressed store, hash-verified

120};
121
122const propsForPrincipal = (
123 request: Request,
124 principal: Extract<AuthOutcome, { readonly _tag: "Authenticated" }>["principal"],
125 resource: McpResource,
126): Effect.Effect<McpSessionProps> =>
127 Effect.gen(function* () {
128 const propagation = yield* currentPropagationHeaders(request);
129 return {
130 session: {
131 organizationId: principal.organizationId,
132 userId: principal.accountId,
133 elicitationMode: readElicitationMode(request),
134 resource,
135 webOrigin: new URL(request.url).origin,
136 },
137 propagation,
138 };
139 });
140
141export const makeCloudMcpAgentHandler = () => {
142 const serveOptions = {

Callers 1

makeCloudMcpAgentHandlerFunction · 0.70

Calls 2

readElicitationModeFunction · 0.85

Tested by

no test coverage detected