# Function createServer

MCP exports - MCP server implementation Split from index.ts for file size compliance (Issue #285) Updated Issue #538: Added missing tool registration exports

- createServer(config?: ServerConfig): Result<ServerInstance, ServerError>

  Creates a new MCP server instance.

  #### Parameters

  - `Optional` config: ServerConfig

    Optional server configuration

  #### Returns Result<ServerInstance, ServerError>

  Result containing the server instance or an error

  #### Example

      const result = createServer({ name: 'my-server' });
      if (result.ok) {
        const { server, logger } = result.value;
        // Register tools on server
      }

  - Defined in packages/nexus-agents/src/mcp/server.ts:90