/**
 * The MCP server, in-house: the stdio transport and the server side of the
 * protocol this package uses, so a customer's install carries no MCP library
 * (and none of the HTTP framework one brings).
 *
 * Framing is newline-delimited JSON-RPC 2.0 on stdin and stdout; stdout
 * carries nothing else. The server answers `initialize`, `ping`,
 * `tools/list` and `tools/call`, accepts notifications without answering,
 * and answers any other request with `-32601`. Tool argument and result
 * problems are ordinary tool results, never protocol errors, as the MCP SDK
 * this replaced answered them.
 */
import type { Readable, Writable } from "node:stream";
import { type StrictSchema } from "./input-guard.js";
import { type AnySchema } from "./schema.js";
/** Newest first: the version a client gets when it asks for one this server does not know. */
export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"];
export declare const JSONRPC_PARSE_ERROR = -32700;
export declare const JSONRPC_INVALID_REQUEST = -32600;
export declare const JSONRPC_METHOD_NOT_FOUND = -32601;
export declare const JSONRPC_INVALID_PARAMS = -32602;
type JsonRpcId = string | number;
export interface JsonRpcResponse {
    jsonrpc: "2.0";
    id: JsonRpcId | null;
    result?: unknown;
    error?: {
        code: number;
        message: string;
        data?: unknown;
    };
}
export interface ToolResult {
    content: Array<{
        type: "text";
        text: string;
    }>;
    structuredContent?: unknown;
    isError?: boolean;
}
export declare class McpServer {
    #private;
    readonly info: {
        name: string;
        version: string;
    };
    constructor(info: {
        name: string;
        version: string;
    });
    /** The same call shape the MCP SDK's `registerTool` had, so the registrations in `index.ts` read as before. */
    registerTool<S extends StrictSchema>(name: string, config: {
        description: string;
        inputSchema: S;
        outputSchema: AnySchema;
    }, handler: (args: S["_output"]) => ToolResult | Promise<ToolResult>): void;
    /** The tool names, in registration order. */
    toolNames(): string[];
    /**
     * One decoded JSON-RPC message in, the response out; `undefined` for a
     * notification or a client response, which are never answered.
     */
    handle(message: unknown): Promise<JsonRpcResponse | undefined>;
    /**
     * Serve newline-delimited JSON-RPC on `input` and `output` until `input`
     * ends; resolves once every call in flight has answered.
     */
    listen(input: Readable, output: Writable): Promise<void>;
}
export {};
//# sourceMappingURL=mcp-server.d.ts.map