You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# GitHub Copilot Usage & Standards for Mapbox MCP Server
1
+
# GitHub Copilot Guidelines for Mapbox MCP Server
2
2
3
-
This document defines how to use GitHub Copilot effectively and responsibly in the Mapbox MCP server repository. Following these guidelines ensures Copilot is a productive tool that supports, but does not replace, our engineering standards.
3
+
This document defines responsible use of GitHub Copilot in this repository. Copilot is a productivity tool that must work within our engineering standards.
4
4
5
-
---
5
+
## Core Principles
6
6
7
-
## 1. Copilot as an Assistant, Not an Authority
7
+
###1. Review, Don't Auto-Accept
8
8
9
-
-**Review All Suggestions:** Never accept Copilot code without reviewing it for correctness, security, and style.
10
-
-**Understand Before You Use:** Only use Copilot suggestions you fully understand. If unsure, ask for clarification or write it yourself.
11
-
-**No Blind Copy-Paste:** Do not copy-paste large blocks of Copilot code without adapting to project context.
9
+
-**Always review** Copilot suggestions before accepting
10
+
-**Understand first** - only use code you fully comprehend
11
+
-**No blind copy-paste** - adapt suggestions to project context
12
+
-**Iterate** - use suggestions as starting points, not final solutions
12
13
13
-
---
14
+
### 2. Security First
14
15
15
-
## 2. Code Quality & Consistency
16
+
-**Never accept** suggestions with hardcoded secrets, tokens, or credentials
17
+
-**Review carefully** any code handling sensitive data
18
+
-**Environment variables** - ensure secrets use `.env` files, never committed
16
19
17
-
-**Follow Project Standards:** All Copilot-generated code must comply with the standards in `CLAUDE.md` and our linting, typing, and testing requirements.
18
-
-**TypeScript Only:** Copilot suggestions must be in TypeScript for all code in `src/` and `test/`.
19
-
-**No Global Pollution:** Do not accept suggestions that patch or override global objects (e.g., `global.fetch`).
20
+
### 3. Quality Standards
20
21
21
-
---
22
+
- All Copilot code must comply with standards in **CLAUDE.md** and **docs/engineering_standards.md**
23
+
- Pre-commit hooks will enforce linting, formatting, and TypeScript strictness
24
+
- If Copilot suggests patterns inconsistent with the codebase, reject and write manually
22
25
23
-
##3. Testing & Documentation
26
+
### 4. Testing & Documentation
24
27
25
-
-**Tests Required:** All Copilot-generated features or fixes must include appropriate unit tests.
26
-
-**JSDoc & Comments:** Add or edit documentation/comments for Copilot code as you would for hand-written code.
27
-
28
-
---
28
+
- Include unit tests for all Copilot-generated features or fixes
29
+
- Add or update JSDoc comments as you would for hand-written code
30
+
- Update README.md or CHANGELOG.md if user-facing changes
29
31
30
-
##4. Security & Privacy
32
+
### 5. Collaboration
31
33
32
-
-**No Secrets:** Never accept suggestions that include hardcoded secrets, tokens, or credentials.
33
-
-**Sensitive Data:** Do not use Copilot to generate or handle sensitive data without review.
34
+
- All Copilot code goes through standard PR review process
35
+
- Mention in PR description if significant portion is Copilot-generated
36
+
- Provide feedback if Copilot produces poor/unsafe suggestions
34
37
35
-
---
38
+
## When to Avoid Copilot
36
39
37
-
## 5. Collaboration & Review
40
+
-**Critical business logic** - prefer hand-written code with thorough review
41
+
-**Security-sensitive code** - authentication, authorization, data validation
42
+
-**Legal/compliance code** - licensing, terms of service, privacy policies
43
+
-**Architecture decisions** - let humans make strategic choices
38
44
39
-
-**Pull Requests:** All Copilot-generated code must go through the standard PR review process.
40
-
-**Attribution:** If a significant portion of a PR is Copilot-generated, mention it in the PR description.
41
-
-**Feedback:** If Copilot produces poor or unsafe suggestions, provide feedback to improve future results.
45
+
## Learning from the Codebase
42
46
43
-
---
47
+
Copilot learns patterns from existing code. This codebase has strong conventions:
44
48
45
-
## 6. When Not to Use Copilot
49
+
- Dependency injection for testability (see src/tools/)
50
+
- HttpPipeline for all HTTP requests (see src/utils/httpPipeline.ts)
> **Note**: If you're using Claude Code specifically, see CLAUDE.md instead. This file is for general AI coding assistants.
4
4
5
-
This is a Model Context Protocol (MCP) server that provides AI agents with access to Mapbox's geospatial services including geocoding, directions, search, and mapping capabilities. The server implements tools for forward/reverse geocoding, route planning, point-of-interest search, static map generation, and geographic data analysis.
5
+
## What This Project Does
6
6
7
-
## Architecture & Standards
7
+
This is an MCP (Model Context Protocol) server that provides AI applications with geospatial intelligence capabilities through Mapbox APIs. It enables AI agents to understand locations, navigate the physical world, and access spatial data including geocoding, search, routing, travel time analysis, and map visualization.
8
8
9
-
### Core Technologies
9
+
##Tech Stack
10
10
11
-
-**Runtime:** Node.js LTS
12
-
-**Language:** TypeScript (strict mode, no JavaScript files)
13
-
-**Testing:** Vitest with comprehensive unit tests
-**README.md** - User-facing documentation and integration guides
172
82
173
-
- Patching global objects (especially `fetch`)
174
-
- Missing unit tests for new functionality
175
-
- Hardcoding configuration values
176
-
- Using JavaScript instead of TypeScript
177
-
- Ignoring ESLint/Prettier warnings
178
-
- Making real network calls in tests
83
+
## Factual Errors to Watch For
179
84
180
-
### Getting Started
85
+
When analyzing or modifying this codebase:
181
86
182
-
1. Install dependencies: `npm install`
183
-
2. Run tests: `npm test`
184
-
3. Check linting: `npm run lint`
185
-
4. Format code: `npm run format`
186
-
5. Build project: `npm run build`
187
-
6. Test project: `npm run test`
87
+
- The HTTP pipeline class is `HttpPipeline`, not `PolicyPipeline`
88
+
- The HTTP pipeline file is `src/utils/httpPipeline.ts`, not `fetchRequest.ts`
89
+
- Base tool class uses `httpRequest` parameter, not `fetch`
188
90
189
91
---
190
92
191
-
This codebase prioritizes maintainability, testability, and adherence to MCP standards. When in doubt, refer to existing tool implementations and follow established patterns.
93
+
For detailed code quality standards, testing requirements, and collaboration guidelines, see docs/engineering_standards.md.
0 commit comments