Skip to content

Function: startServer()

ts
function startServer<TContext>(options): Promise<StartServerResult>;

Defined in: packages/core/src/server/startServer.ts:99

Start an MCP Fusion server with a single call.

Handles all bootstrap boilerplate: Server creation, registry attachment, telemetry bus, and stdio transport connection.

Type Parameters

Type Parameter
TContext

Parameters

ParameterType
optionsStartServerOptions<TContext>

Returns

Promise<StartServerResult>

Example

typescript
import { startServer, autoDiscover } from '@vinkius-core/mcp-fusion';

const registry = f.registry();
await autoDiscover(registry, new URL('./tools', import.meta.url));

await startServer({
    name: 'my-server',
    registry,
    contextFactory: () => createContext(),
});