@nextscope/mcp
Version:
MCP bridge and shared tools for NextScope.
34 lines (33 loc) • 1.67 kB
TypeScript
import { type NextScopeMcpAdapter, type NextScopeServerInfo, type NextScopeToolName, type OutputOptions, type ServerSelection } from './index';
export interface BridgeOptions {
url?: string;
route: string;
host: string;
port?: number;
timeoutMs: number;
}
export interface BridgeState {
servers: DiscoveredServer[];
discoveryState: 'offline' | 'discovering' | 'connected';
lastError?: string;
lastDiscoveredAt?: string;
discoveryAttempts: number;
}
interface DiscoveredServer extends NextScopeServerInfo {
upstreamUrl: string;
}
type UpstreamArgs = Record<string, unknown>;
export declare function createBridgeState(): BridgeState;
export declare function createBridgeAdapter(options: BridgeOptions, state?: BridgeState): NextScopeMcpAdapter;
export declare function proxyData(toolName: NextScopeToolName, args: OutputOptions & ServerSelection & object, options: BridgeOptions, state: BridgeState): Promise<any>;
export declare function callUpstreamTool(upstreamUrl: string, toolName: NextScopeToolName, args: UpstreamArgs): Promise<any>;
export declare function discoverServers(options: BridgeOptions, state: BridgeState, discoverOptions: {
wait: boolean;
}): Promise<DiscoveredServer[]>;
export declare function resolveServer(serverId: string | undefined, options: BridgeOptions, state: BridgeState, resolveOptions: {
wait: boolean;
}): Promise<DiscoveredServer>;
export declare function candidateUrls(options: BridgeOptions): Promise<string[]>;
export declare function probeMcp(url: string): Promise<boolean>;
export declare function parseOptions(argv: string[], env: NodeJS.ProcessEnv): BridgeOptions;
export {};