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
Copy file name to clipboardExpand all lines: CLAUDE.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,15 +75,25 @@ All tools, prompts, and resources are explicitly imported and registered in `src
75
75
-`browser-eval-manager.ts`: Manages Playwright MCP server lifecycle
76
76
-`nextjs-runtime-manager.ts`: Discovers and connects to Next.js dev servers with MCP enabled
77
77
78
+
**Telemetry System** (`src/telemetry/`):
79
+
-`mcp-telemetry-tracker.ts`: Singleton tracker for MCP tool invocations
80
+
-`telemetry-events.ts`: Event schema definitions and factory functions
81
+
-`telemetry-storage.ts`: Handles anonymous ID, session tracking, and API submission
82
+
-`event-queue.ts`: In-memory aggregation of events during session
83
+
-`flush-events.ts`: Background process that sends events after server shutdown
84
+
-`logger.ts`: Synchronous file logging for debugging
85
+
- Telemetry can be disabled via `NEXT_TELEMETRY_DISABLED=1` environment variable
86
+
- Data stored in `~/.next-devtools-mcp/` (telemetry-id, telemetry-salt, mcp.log)
87
+
78
88
**Resources Architecture**:
79
89
- Knowledge base split into focused sections (12 sections for Cache Components, 2 for Next.js 16, 1 for fundamentals)
80
90
- Each resource exports: `metadata` (uri, name, description, mimeType) and `handler` (function returning content)
81
91
- Resources use URI-based addressing (e.g., `cache-components://overview`)
82
-
- Markdown files in `src/resources/`are copied to `dist/resources/` during build via `scripts/copy-resources.js`
92
+
- Markdown files in `src/resources/`and `src/prompts/`are copied during build via `scripts/copy-resources.js` (to `dist/resources/` and `dist/resources/prompts/` respectively)
83
93
84
94
### TypeScript Configuration
85
95
86
-
- Target: ES2022, ES modules (Node16 module resolution)
96
+
- Target: ES2022, ES modules (NodeNext module resolution)
87
97
- Strict mode enabled
88
98
- Output directory: `dist/`
89
99
- Declaration files generated
@@ -92,7 +102,7 @@ All tools, prompts, and resources are explicitly imported and registered in `src
92
102
## Build Process
93
103
94
104
1. TypeScript compilation: `tsc` compiles all TypeScript files from `src/` to `dist/`
95
-
2. Resource copying: `scripts/copy-resources.js` copies markdown files from `src/resources/` and `src/prompts/` to `dist/resources/`
105
+
2. Resource copying: `scripts/copy-resources.js` copies markdown files from `src/resources/` and `src/prompts/`(to `dist/resources/` and `dist/resources/prompts/` respectively)
96
106
97
107
The `dist/index.js` file is the entry point for the MCP server and includes a shebang for CLI execution.
Copy file name to clipboardExpand all lines: README.md
+55-17Lines changed: 55 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -294,25 +294,31 @@ proper context and ensures all Next.js queries use official documentation.
294
294
295
295
## MCP Resources
296
296
297
-
Next.js 16 knowledge base resources are automatically available to your coding agent.
298
-
299
-
These resources provide comprehensive documentation split into focused sections for efficient context management:
297
+
The knowledge base resources are automatically available to your coding agent and are split into focused sections for efficient context management. Current resource URIs:
300
298
301
299
<details>
302
300
<summary>📚 Available Knowledge Base Resources (click to expand)</summary>
303
301
304
-
-**`nextjs16://knowledge/overview`** - Overview and critical errors AI agents make
305
-
-**`nextjs16://knowledge/core-mechanics`** - Fundamental paradigm shift and how cacheComponents works
306
-
-**`nextjs16://knowledge/public-caches`** - Public cache mechanics with 'use cache'
307
-
-**`nextjs16://knowledge/private-caches`** - Private cache patterns with 'use cache: private'
308
-
-**`nextjs16://knowledge/runtime-prefetching`** - Runtime prefetch configuration and patterns
-**`nextjs16://knowledge/cache-invalidation`** - updateTag, revalidateTag, and refresh patterns
311
-
-**`nextjs16://knowledge/advanced-patterns`** - cacheLife, cacheTag, draft mode, and more
312
-
-**`nextjs16://knowledge/build-behavior`** - Prerendering, resume data cache, and metadata
313
-
-**`nextjs16://knowledge/error-patterns`** - Common errors and how to fix them
314
-
-**`nextjs16://knowledge/test-patterns`** - E2E patterns from 125+ test fixtures
315
-
-**`nextjs16://knowledge/reference`** - API reference, checklists, and comprehensive nuances
302
+
- Cache Components (12 sections):
303
+
-`cache-components://overview`
304
+
-`cache-components://core-mechanics`
305
+
-`cache-components://public-caches`
306
+
-`cache-components://private-caches`
307
+
-`cache-components://runtime-prefetching`
308
+
-`cache-components://request-apis`
309
+
-`cache-components://cache-invalidation`
310
+
-`cache-components://advanced-patterns`
311
+
-`cache-components://build-behavior`
312
+
-`cache-components://error-patterns`
313
+
-`cache-components://test-patterns`
314
+
-`cache-components://reference`
315
+
316
+
- Next.js 16 migration:
317
+
-`nextjs16://migration/beta-to-stable`
318
+
-`nextjs16://migration/examples`
319
+
320
+
- Next.js fundamentals:
321
+
-`nextjs-fundamentals://use-client`
316
322
317
323
</details>
318
324
@@ -325,7 +331,6 @@ Pre-configured prompts to help with common Next.js development tasks:
325
331
<details>
326
332
<summary>💡 Available Prompts (click to expand)</summary>
327
333
328
-
-**`init`** - Initialize context for Next.js development with MCP tools and documentation requirements
329
334
-**`upgrade-nextjs-16`** - Guide for upgrading to Next.js 16
330
335
-**`enable-cache-components`** - Migrate and enable Cache Components mode for Next.js 16
331
336
@@ -548,6 +553,40 @@ With other agents or programmatically:
548
553
549
554
</details>
550
555
556
+
## Privacy & Telemetry
557
+
558
+
### What Data is Collected
559
+
560
+
`next-devtools-mcp` collects anonymous usage telemetry to help improve the tool. The following data is collected:
561
+
562
+
-**Tool usage**: Which MCP tools are invoked (e.g., `nextjs_runtime`, `browser_eval`, `upgrade_nextjs_16`)
563
+
-**Error events**: Anonymous error messages when tools fail
564
+
-**Session metadata**: Session ID, timestamps, and basic environment info (OS, Node.js version)
565
+
566
+
**What is NOT collected:**
567
+
- Your project code, file contents, or file paths
568
+
- Personal information or identifiable data
569
+
- API keys, credentials, or sensitive configuration
570
+
- Arguments passed to tools (except tool names)
571
+
572
+
Local files are written under `~/.next-devtools-mcp/` (anonymous `telemetry-id`, `telemetry-salt`, and a debug log `mcp.log`). Events are sent to the telemetry endpoint in the background to help us understand usage patterns and improve reliability.
573
+
574
+
### Opt-Out
575
+
576
+
To disable telemetry completely, set the environment variable:
577
+
578
+
```bash
579
+
export NEXT_TELEMETRY_DISABLED=1
580
+
```
581
+
582
+
Add this to your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`) to make it permanent.
583
+
584
+
You can also delete your local telemetry data at any time:
585
+
586
+
```bash
587
+
rm -rf ~/.next-devtools-mcp
588
+
```
589
+
551
590
## Local Development
552
591
553
592
To run the MCP server locally for development:
@@ -580,4 +619,3 @@ To run the MCP server locally for development:
0 commit comments