Skip to content

Commit db366ef

Browse files
committed
Initial commit
0 parents  commit db366ef

57 files changed

Lines changed: 13269 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @mapbox/locationai @mapbox/docs
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
title: "[Bug] <brief summary>"
4+
labels: [bug, needs-triage]
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: What happened?
10+
description: A clear description of the bug.
11+
placeholder: "The tool returned an error when..."
12+
validations:
13+
required: true
14+
15+
- type: textarea
16+
id: steps
17+
attributes:
18+
label: Steps to Reproduce
19+
placeholder: |
20+
1. Configure the MCP server with ...
21+
2. Ask the AI assistant to ...
22+
3. Observe ...
23+
validations:
24+
required: true
25+
26+
- type: textarea
27+
id: expected
28+
attributes:
29+
label: Expected Behavior
30+
placeholder: "The tool should have returned..."
31+
validations:
32+
required: true
33+
34+
- type: input
35+
id: version
36+
attributes:
37+
label: Version
38+
description: Output of `npx @mapbox/mcp-docs-server --version` or package version
39+
placeholder: "0.1.0"
40+
validations:
41+
required: false
42+
43+
- type: textarea
44+
id: notes
45+
attributes:
46+
label: Additional Context
47+
description: Logs, screenshots, or anything else that might help.
48+
validations:
49+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Feature Request
2+
description: Suggest a new tool, resource, or improvement
3+
title: "[Feature] <brief summary>"
4+
labels: [enhancement, needs-triage]
5+
body:
6+
- type: dropdown
7+
id: type
8+
attributes:
9+
label: Type
10+
options:
11+
- New tool
12+
- New resource
13+
- Improvement to existing tool/resource
14+
- Documentation
15+
- Other
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: problem
21+
attributes:
22+
label: Problem or Motivation
23+
description: What use case or gap does this address?
24+
placeholder: "When I ask Claude to..., there's no good way to..."
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: proposal
30+
attributes:
31+
label: Proposed Solution
32+
description: What should the new tool/resource do?
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: notes
38+
attributes:
39+
label: Additional Context
40+
validations:
41+
required: false

.github/copilot-instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# GitHub Copilot Guidelines
2+
3+
This repository is the Mapbox MCP Documentation Server — a TypeScript MCP server providing AI assistants with Mapbox documentation and reference materials.
4+
5+
## Key Facts
6+
7+
- Tools extend `BaseTool` (not `MapboxApiBasedTool` — that class lives in a different repo)
8+
- `BaseTool.execute(input)` takes **only the validated input** — no `accessToken` or `context` params
9+
- No Mapbox access token is needed for most tools; if required, accept it as an input field
10+
- HTTP requests use the shared `httpRequest` from `src/utils/httpPipeline.ts`**never patch `global.fetch`**
11+
- Tests mock `httpRequest` with `vi.fn()` — no real network calls in tests
12+
13+
## Before Accepting Suggestions
14+
15+
- Verify the suggestion uses `BaseTool`, not `MapboxApiBasedTool`
16+
- Verify `execute(input)` has the correct signature (no extra params)
17+
- Verify HTTP calls go through the injected `httpRequest`, not `fetch` directly
18+
- Verify no secrets or tokens are hardcoded
19+
20+
## Standards
21+
22+
- TypeScript strict mode — no implicit `any`
23+
- All new tools/resources need tests in `test/` mirroring the `src/` structure
24+
- Update `CHANGELOG.md` under `Unreleased` with every user-facing change
25+
26+
See [CONTRIBUTING.md](../CONTRIBUTING.md) and [CLAUDE.md](../CLAUDE.md) for full patterns and examples.

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Description
2+
3+
<!-- What was changed and why? Link any related issues. -->
4+
5+
- Closes #<!-- issue number, if applicable -->
6+
7+
---
8+
9+
## Testing
10+
11+
<!-- How was this tested? Include relevant output, screenshots, or test results. -->
12+
13+
---
14+
15+
## Checklist
16+
17+
- [ ] Tests added or updated (`npm test` passes)
18+
- [ ] Lint passes (`npm run lint`)
19+
- [ ] `CHANGELOG.md` updated under `Unreleased`
20+
- [ ] Documentation updated if needed (README, JSDoc)
21+
22+
---
23+
24+
## Additional Notes
25+
26+
<!-- Any follow-up work, decisions, or context for reviewers. -->

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "22"
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run linter
27+
run: npm run lint
28+
29+
- name: Check formatting
30+
run: npm run format
31+
32+
- name: Compile typescript
33+
run: npm run build
34+
35+
- name: Run tests
36+
run: npm test

.gitignore

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional stylelint cache
57+
.stylelintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variable files
69+
.env
70+
.env.*
71+
!.env.example
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
.parcel-cache
76+
77+
# Next.js build output
78+
.next
79+
out
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and not Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# vuepress v2.x temp and cache directory
95+
.temp
96+
.cache
97+
98+
# Sveltekit cache directory
99+
.svelte-kit/
100+
101+
# vitepress build output
102+
**/.vitepress/dist
103+
104+
# vitepress cache directory
105+
**/.vitepress/cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# Firebase cache directory
120+
.firebase/
121+
122+
# TernJS port file
123+
.tern-port
124+
125+
# Stores VSCode versions used for testing VSCode extensions
126+
.vscode-test
127+
128+
# yarn v3
129+
.pnp.*
130+
.yarn/*
131+
!.yarn/patches
132+
!.yarn/plugins
133+
!.yarn/releases
134+
!.yarn/sdks
135+
!.yarn/versions
136+
137+
# Vite logs files
138+
vite.config.js.timestamp-*
139+
vite.config.ts.timestamp-*
140+
141+
# Build artifacts
142+
.tshy/
143+
.tshy-build/
144+
145+
# Test artifacts
146+
test-results.xml
147+
coverage/

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
npx lint-staged

.husky/setup-hooks.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { writeFileSync, mkdirSync, chmodSync, constants } from 'node:fs';
2+
import { execSync } from 'node:child_process';
3+
import { platform } from 'node:os';
4+
5+
mkdirSync('.husky', { recursive: true });
6+
7+
execSync('git config core.hooksPath .husky');
8+
9+
writeFileSync(
10+
'.husky/pre-commit',
11+
`#!/usr/bin/env sh
12+
npx lint-staged`
13+
);
14+
15+
// Cross-platform way to make the file executable
16+
if (platform() === 'win32') {
17+
// On Windows, executable permissions don't matter as much
18+
console.log('pre-commit script created.');
19+
} else {
20+
// On Unix systems, use chmod
21+
try {
22+
execSync('chmod +x .husky/pre-commit');
23+
console.log('pre-commit script created.');
24+
} catch {
25+
// Fallback to Node.js fs.chmodSync if available
26+
try {
27+
chmodSync(
28+
'.husky/pre-commit',
29+
constants.S_IRWXU | constants.S_IRGRP | constants.S_IXGRP
30+
); // 0o750
31+
console.log('pre-commit script created.');
32+
} catch {
33+
console.warn(
34+
'Warning: Could not set executable permissions on the hook file'
35+
);
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)