Files
SnowLuma/.pnpm-store/v11/files/3c/37fff576eeabeef48942f29e33df8c77c193a7c887ad53afeae55d7c1a2f4a11d32fa7dd184f71ce916f0c7c1abfdbb433271e95599b084243cc120b8c9989
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

36 lines
1.2 KiB
Plaintext

import { Readable, Writable } from 'node:stream';
import { JSONRPCMessage } from '../types.js';
import { Transport } from '../shared/transport.js';
/**
* Server transport for stdio: this communicates with an MCP client by reading from the current process' stdin and writing to stdout.
*
* This transport is only available in Node.js environments.
*/
export declare class StdioServerTransport implements Transport {
private _stdin;
private _stdout;
private _readBuffer;
private _started;
constructor(_stdin?: Readable, _stdout?: Writable, options?: {
/**
* Maximum size of the read buffer in bytes. If a single message exceeds
* this size the transport will emit an error and close.
*
* Defaults to 10 MB.
*/
maxBufferSize?: number;
});
onclose?: () => void;
onerror?: (error: Error) => void;
onmessage?: (message: JSONRPCMessage) => void;
_ondata: (chunk: Buffer) => void;
_onerror: (error: Error) => void;
/**
* Starts listening for messages on stdin.
*/
start(): Promise<void>;
private processReadBuffer;
close(): Promise<void>;
send(message: JSONRPCMessage): Promise<void>;
}
//# sourceMappingURL=stdio.d.ts.map