@cyanheads/filesystem-mcp-server
Version:
A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search and replace, and directory tree traversal
35 lines (34 loc) • 977 B
TypeScript
import { z } from 'zod';
import { RequestContext } from "../utils/internal/requestContext.js";
import { McpToolResponse } from './mcp.js';
/**
* Base interface for tool input parameters
*/
export interface BaseToolInput {
[key: string]: unknown;
}
/**
* Base interface for tool response content
*/
export interface BaseToolResponse {
[key: string]: unknown;
}
/**
* Interface for tool registration options
*/
export interface ToolRegistrationOptions<TInput extends BaseToolInput> {
/** Zod schema for input validation */
inputSchema: z.ZodType<TInput>;
/** Description of the tool */
description: string;
/** Example usage scenarios */
examples?: {
name: string;
input: TInput;
description?: string;
}[];
}
/**
* Interface for a tool handler function
*/
export type ToolHandler<TInput extends BaseToolInput, TResponse extends McpToolResponse> = (input: TInput, context: RequestContext) => Promise<TResponse>;