/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import type { CallToolResult, CallToolRequest, Root } from '@modelcontextprotocol/sdk/types.js';
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
export type { Server } from '@modelcontextprotocol/sdk/server/index.js';
export type { Tool, CallToolResult, CallToolRequest, Root } from '@modelcontextprotocol/sdk/types.js';
import type { Server as ServerType } from '@modelcontextprotocol/sdk/server/index.js';
import type { ToolSchema } from './tool';
export type ClientInfo = {
    cwd: string;
    clientName: string;
};
export interface ServerBackend {
    initialize?(clientInfo: ClientInfo): Promise<void>;
    callTool(name: string, args: CallToolRequest['params']['arguments'], signal: AbortSignal): Promise<CallToolResult & {
        isClose?: boolean;
    }>;
    dispose?(): Promise<void>;
}
export type ServerBackendFactory = {
    name: string;
    nameInConfig: string;
    version: string;
    toolSchemas: ToolSchema<any>[];
    create: (clientInfo: ClientInfo) => Promise<ServerBackend>;
    disposed: (backend: ServerBackend) => Promise<void>;
};
export declare function connect(factory: ServerBackendFactory, transport: Transport, runHeartbeat: boolean): Promise<void>;
export declare function createServer(name: string, version: string, factory: ServerBackendFactory, runHeartbeat: boolean): ServerType;
export declare function start(serverBackendFactory: ServerBackendFactory, options?: {
    host?: string;
    port?: number;
    allowedHosts?: string[];
    socketPath?: string;
}): Promise<void>;
export declare function firstRootPath(roots: Root[]): string;
export declare function allRootPaths(roots: Root[]): string[];
//# sourceMappingURL=server.d.ts.map