vibesec
Version:
Security scanner for AI-generated code - detects vulnerabilities in vibe-coded projects
99 lines • 2.81 kB
TypeScript
export interface MCPRequest {
id: string | number;
jsonrpc?: '2.0';
method: string;
params?: Record<string, unknown>;
}
export interface MCPResponse {
id: string | number;
jsonrpc?: '2.0';
result?: unknown;
error?: MCPError;
}
export interface MCPError {
code: number;
message: string;
data?: unknown;
}
export declare enum MCPErrorCode {
PARSE_ERROR = -32700,
INVALID_REQUEST = -32600,
METHOD_NOT_FOUND = -32601,
INVALID_PARAMS = -32602,
INTERNAL_ERROR = -32603,
TOOL_NOT_FOUND = -32001,
TOOL_EXECUTION_ERROR = -32002,
INVALID_TOOL_ARGS = -32003
}
export interface JSONSchema {
type: 'object' | 'string' | 'number' | 'boolean' | 'array' | 'null';
properties?: Record<string, JSONSchema>;
required?: string[];
items?: JSONSchema;
enum?: (string | number)[];
description?: string;
optional?: boolean;
default?: unknown;
minimum?: number;
maximum?: number;
minLength?: number;
maxLength?: number;
pattern?: string;
}
export interface MCPTool {
name: string;
description: string;
inputSchema: JSONSchema;
handler: (params: unknown) => Promise<unknown>;
}
export interface ToolListResponse {
tools: ToolInfo[];
}
export interface ToolInfo {
name: string;
description: string;
inputSchema: JSONSchema;
}
export interface ToolCallParams {
name: string;
arguments?: unknown;
}
export interface MCPServerConfig {
name: string;
version: string;
capabilities: MCPCapability[];
description?: string;
}
export type MCPCapability = 'tools' | 'prompts' | 'resources' | 'completion';
export interface ServerInfo {
name: string;
version: string;
capabilities: Record<MCPCapability, boolean>;
}
export interface InitializeParams {
clientName: string;
clientVersion: string;
capabilities?: Partial<Record<MCPCapability, boolean>>;
}
export interface MCPNotification {
jsonrpc: '2.0';
method: string;
params?: Record<string, unknown>;
}
export interface ProgressParams {
token: string | number;
value: number;
message?: string;
}
export interface ToolResult<T = unknown> {
success: boolean;
data?: T;
error?: string;
metadata?: Record<string, unknown>;
}
export declare function isValidMCPRequest(obj: unknown): obj is MCPRequest;
export declare function isValidToolCallParams(obj: unknown): obj is ToolCallParams;
export declare function createErrorResponse(id: string | number, code: number, message: string, data?: unknown): MCPResponse;
export declare function createSuccessResponse(id: string | number, result: unknown): MCPResponse;
export declare function createNotification(method: string, params?: Record<string, unknown>): MCPNotification;
//# sourceMappingURL=types.d.ts.map