This file provides guidance to AI coding assistants working with this repository.
ToolHive Studio is an Electron desktop application for managing MCP (Model Context Protocol) servers. Built with React, TypeScript, Electron, and Vite. Uses pnpm as package manager. Requires Node.js >=24 <25.
pnpm install # Install dependencies
pnpm run start # Start dev server with hot reload
pnpm run lint # Run ESLint
pnpm run type-check # TypeScript type checking
pnpm run format # Format with Prettier
pnpm run test:nonInteractive # Run unit tests once
pnpm run test:coverage # Unit tests with coverage
pnpm run e2e # End-to-end tests
pnpm run generate-client # Regenerate API client from OpenAPI spec
pnpm run knip # Detect unused codeHusky/lint-staged automatically run lint + format on staged files. Run pnpm run type-check manually before committing.
- Docker daemon must be running before
pnpm run start - Node.js version must be >=24 <25 — native modules break otherwise
- After Node version change, run
pnpm run rebuildfor native modules - If API type errors appear, run
pnpm run generate-clientto refresh - Tests run through Electron (
pnpm run vitest:electron), not plain Node - Always run commands from the repository root, not from subdirectories
Do not modify or manually edit:
common/api/generated/*— regenerate viapnpm run generate-clientrenderer/src/route-tree.gen.ts— auto-generated by TanStack Router pluginnode_modules/,out/,.vite/— build artifacts
- File names: kebab-case always (e.g.,
card-mcp-server.tsx) - Components: PascalCase, functional with hooks
- Path aliases:
@/*(renderer/src),@common/*,@utils/*,@mocks/* - Imports: use aliases for cross-directory imports, not relative paths
- Exports: named exports preferred over default exports
- Tests in
__tests__/directories colocated with source - API mocking via auto-generated MSW fixtures from OpenAPI spec
- See
docs/mocks.mdfor mocking patterns - Use
.override()/.overrideHandler()for test-specific API responses - Use
recordRequests()to assert on outgoing API calls
- Conventional Commits format required
- PR titles validated against conventional commit spec by CI
- Keep PRs small and focused
- See
CONTRIBUTING.mdfor details