Instructions for GitHub Copilot working on the Mapbox MCP DevKit Server. See Copilot repository instructions guide.
- Read existing patterns before proposing solutions
- Check
src/tools/for tool implementation patterns - Reference
CLAUDE.mdfor architecture decisions - Verify token scope requirements in
README.md
- Never hardcode tokens or credentials
- All Mapbox API calls require
MAPBOX_ACCESS_TOKENwith specific scopes - Token scope mismatches are the primary failure mode
- Use
VERBOSE_ERRORS=truefor debugging auth issues - Reference token scope requirements in
README.mdbefore implementing
- TypeScript strict mode - No implicit any, proper typing required
- Tool naming - Tool names (MCP identifiers) must be
snake_case_tool(e.g.,list_styles_tool). TypeScript class names followPascalCaseToolconvention (e.g.,ListStylesTool) - Schema separation - Schema in
*.schema.ts, implementation in*.tool.ts - Use plop generator -
npx plop create-toolfor new tools - Zod validation - All tool inputs validated with Zod schemas
- ESLint and Prettier handle formatting - run
npm run lint:fix && npm run format:fix
- Run tests before committing -
npm test - Update snapshots deliberately - After adding/removing/modifying tools:
npm test -- src/tools/tool-naming-convention.test.ts --updateSnapshot - Never update snapshots without understanding what changed
- Snapshot tests capture tool metadata (TypeScript class names in
PascalCaseToolformat, MCP tool names insnake_case_toolformat, descriptions)
- Focused commits - One logical change per commit
- Build before testing - Always
npm run buildbefore running - Check CI - Tests must pass before merge
- Reference issues/PRs in commit messages
- Don't auto-accept tool name changes without verifying snake_case_tool convention
- Don't merge schema definitions into tool implementation files
- Don't skip snapshot updates after adding/removing tools
- Don't commit without running linter and tests
Key files:
docs/engineering_standards.md— Comprehensive contributor guidelinesCLAUDE.md— Architecture and technical patternsAGENTS.md— AI agent development guideREADME.md— Complete tool referenceTOOL_CONFIGURATION.md— Tool configuration