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

Function makeMcpBuildServer

packages/core/api/src/server/mcp-build.ts:40–60  ·  view source on GitHub ↗
(executionStack: McpExecutionStackLayer)

Source from the content-addressed store, hash-verified

38 */
39export const makeMcpBuildServer =
40 (executionStack: McpExecutionStackLayer): McpBuildServer =>
41 (principal: Principal, options?: McpBuildServerOptions) =>
42 makeExecutionStack(principal.accountId, principal.organizationId, principal.organizationName, {
43 mcpResource: options?.resource,
44 }).pipe(
45 Effect.withSpan("mcp.execution_stack.build"),
46 Effect.map(({ engine }) => engine),
47 // Pin browser-handoff URLs to the principal's org slug when present;
48 // absent slug leaves the service unprovided and the URL stays bare.
49 principal.organizationSlug !== undefined
50 ? Effect.provideService(RequestOrgSlug, { slug: principal.organizationSlug })
51 : (effect) => effect,
52 Effect.provide(executionStack),
53 Effect.mapError((cause) => new McpEngineBuildError({ cause })),
54 Effect.flatMap((engine) =>
55 createExecutorMcpServer({ engine, ...(options ?? {}) }).pipe(
56 Effect.withSpan("mcp.server.create"),
57 Effect.map((mcpServer) => ({ mcpServer, engine })),
58 ),
59 ),
60 );
61
62/**
63 * The standard console `McpErrorReporter` seam: route an orchestration defect

Callers 1

Calls 2

makeExecutionStackFunction · 0.90
createExecutorMcpServerFunction · 0.90

Tested by

no test coverage detected