Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Install dependencies npm install # Build the project npm run build # Run tests npm test # Watch mode npm run test:run # Single run npm run test:coverage # With coverage report # Linting npm run lint # Check for linting issues npm run lint:fix # Auto-fix linting and formatting issues # Type checking npm run type-check # Check TypeScript types without building
This is an MCP (Model Context Protocol) server implementation for esa.io, using STDIO transport for communication. The architecture follows a simple structure:
MCP Server Setup (
src/index.ts): Entry point that initializes the MCP server with STDIO transport. Handles transport lifecycle events and graceful error handling.
Configuration (
src/config/index.ts): Centralized configuration management that reads from environment variables. Required env vars:
ESA_ACCESS_TOKEN: Required for esa.io API authenticationESA_API_BASE_URL: Optional API base URL (defaults to https://api.esa.io)The server follows the standard MCP pattern:
When extending functionality, new tools and resources should be registered with the server instance before connecting to transport.
When writing tests, follow these principles for maintainable and readable test code:
Import Order Optimization
import type)Mock Creation Patterns
as unknown as pattern for type casting to keep mocks minimal and focusedcreateMockConfig, createMockServer)setupServerMocks)Mock Documentation
Module Mocking with vi.doMock
vi.doMock for replacing entire modules during import resolutionvi.doMock before the module importawait import()) after setting up module mocksvi.doMock is fundamentally different from vi.fn() - it intercepts module loadingTest Structure
describe blocksbeforeEach/afterEach hooks