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

Function propsForPrincipal

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

Source from the content-addressed store, hash-verified

95};
96
97const propsForPrincipal = (
98 request: Request,
99 principal: Extract<AuthOutcome, { readonly _tag: "Authenticated" }>["principal"],
100 resource: McpResource,
101): Effect.Effect<McpSessionProps> =>
102 Effect.gen(function* () {
103 const propagation = yield* currentPropagationHeaders(request);
104 return {
105 session: {
106 organizationId: principal.organizationId,
107 userId: principal.accountId,
108 elicitationMode: readElicitationMode(request),
109 resource,
110 webOrigin: new URL(request.url).origin,
111 },
112 propagation,
113 };
114 });
115
116export const makeCloudMcpAgentHandler = () => {
117 const serveOptions = {

Callers 1

makeCloudMcpAgentHandlerFunction · 0.70

Calls 2

readElicitationModeFunction · 0.85

Tested by

no test coverage detected