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

Function makeMcpBuildServer

packages/core/api/src/server/mcp-build.ts:40–58  ·  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.map(({ engine }) => engine),
46 // Pin browser-handoff URLs to the principal's org slug when present;
47 // absent slug leaves the service unprovided and the URL stays bare.
48 principal.organizationSlug !== undefined
49 ? Effect.provideService(RequestOrgSlug, { slug: principal.organizationSlug })
50 : (effect) => effect,
51 Effect.provide(executionStack),
52 Effect.mapError((cause) => new McpEngineBuildError({ cause })),
53 Effect.flatMap((engine) =>
54 createExecutorMcpServer({ engine, ...(options ?? {}) }).pipe(
55 Effect.map((mcpServer) => ({ mcpServer, engine })),
56 ),
57 ),
58 );
59
60/**
61 * 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