# Function isMCPServerError

- isMCPServerError(error: unknown): error is MCPServerError

  Type guard for MCPServerError

  Checks if an unknown error is an instance of MCPServerError or one of its subclasses. Useful for error handling and formatting.

  #### Parameters

  - error: unknown

    Unknown error to check

  #### Returns error is MCPServerError

  true if error is an MCPServerError or subclass

  #### Example

      try {
        await fetchMEPs();
      } catch (error) {
        if (isMCPServerError(error)) {
          console.error(`Error ${error.code}: ${error.message}`);
        }
      }

  - Defined in types/errors.ts:202