mcpdog
Version:
MCPDog - Universal MCP Server Manager with Web Interface
125 lines • 3.02 kB
TypeScript
import { EventEmitter } from 'events';
export interface MCPServerConfig {
name: string;
enabled: boolean;
transport: 'stdio' | 'http-sse' | 'streamable-http';
description?: string;
command?: string;
args?: string[];
cwd?: string;
env?: Record<string, string>;
endpoint?: string;
url?: string;
apiKey?: string;
headers?: Record<string, string>;
sseReconnectInterval?: number;
httpKeepAlive?: boolean;
sseEndpoint?: string;
maxChunkSize?: number;
streamTimeout?: number;
streamEndpoint?: string;
sessionMode?: 'auto' | 'required' | 'disabled';
toolsConfig?: {
mode: 'all' | 'whitelist' | 'blacklist';
enabledTools?: string[];
disabledTools?: string[];
toolSettings?: Record<string, {
enabled: boolean;
alias?: string;
description?: string;
}>;
};
timeout?: number;
retries?: number;
enabledTools?: string[];
}
export interface MCPDogConfig {
version: string;
servers: Record<string, MCPServerConfig>;
web?: {
enabled: boolean;
port: number;
host: string;
};
logging?: {
level: 'error' | 'warn' | 'info' | 'debug';
file?: string;
};
}
export interface MCPTool {
name: string;
description: string;
inputSchema: {
type: string;
properties?: Record<string, any>;
required?: string[];
};
}
export interface MCPRequest {
jsonrpc: '2.0';
id: string | number;
method: string;
params?: any;
}
export interface MCPNotificationRequest {
jsonrpc: '2.0';
method: string;
params?: any;
}
export type MCPMessage = MCPRequest | MCPNotificationRequest;
export interface MCPResponse {
jsonrpc: '2.0';
id: string | number;
result?: any;
error?: {
code: number;
message: string;
data?: any;
};
}
export interface MCPNotification {
jsonrpc: '2.0';
method: string;
params?: any;
}
export interface ServerAdapter extends EventEmitter {
name: string;
config: MCPServerConfig;
isConnected: boolean;
connect(): Promise<void>;
disconnect(): Promise<void>;
getTools(): Promise<MCPTool[]>;
callTool(name: string, args: any): Promise<MCPResponse>;
sendRequest(request: MCPRequest): Promise<MCPResponse>;
}
export interface ClientCapabilities {
supportsNotifications: boolean;
clientName: string;
clientVersion: string;
}
export type MCPDogEvents = {
'server-connected': {
serverName: string;
};
'server-disconnected': {
serverName: string;
error?: Error;
};
'tools-changed': {
serverName?: string;
};
'config-updated': {
config: MCPDogConfig;
};
'tool-called': {
serverName: string;
toolName: string;
args: any;
result: any;
};
'error': {
error: Error;
context?: string;
};
};
//# sourceMappingURL=index.d.ts.map