UNPKG

@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

25 lines (24 loc) 1.45 kB
/** * @fileoverview Main entry point for the Filesystem MCP (Model Context Protocol) server. * This file orchestrates the server's lifecycle: * 1. Initializes the core `McpServer` instance (from `@modelcontextprotocol/sdk`) with its identity and capabilities. * 2. Registers available filesystem tools, making them discoverable and usable by clients. * 3. Selects and starts the appropriate communication transport (currently stdio) * based on configuration. * 4. Handles top-level error management during startup. * * MCP Specification References: * - Lifecycle: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-03-26/basic/lifecycle.mdx * - Overview (Capabilities): https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-03-26/basic/index.mdx * - Transports: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-03-26/basic/transports.mdx * @module src/mcp-server/server */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; /** * Main application entry point. Initializes and starts the MCP server. * Orchestrates server startup, transport selection, and top-level error handling. * * @returns For 'stdio', resolves with `McpServer`. * Rejects on critical failure, leading to process exit. */ export declare function initializeAndStartServer(): Promise<void | McpServer>;