driftdetect-mcp 0.9.22 → 0.9.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +68 -119
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,162 +1,111 @@
1
1
  # Drift MCP Server
2
2
 
3
- MCP (Model Context Protocol) server that exposes drift functionality to AI agents like Claude, Kiro, and other MCP-compatible tools.
3
+ MCP (Model Context Protocol) server that gives AI agents deep understanding of your codebase patterns, conventions, and architecture.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/driftdetect-mcp.svg)](https://www.npmjs.com/package/driftdetect-mcp)
4
6
 
5
7
  ## Installation
6
8
 
9
+ **Recommended: Global install with pinned version**
7
10
  ```bash
8
- npm install -g driftdetect-mcp
9
- # or
10
- pnpm add -g driftdetect-mcp
11
+ npm install -g driftdetect-mcp@0.9.22
11
12
  ```
12
13
 
13
14
  ## Configuration
14
15
 
15
- Add to your MCP config (`.kiro/settings/mcp.json` for Kiro, or `~/.config/claude/mcp.json` for Claude Desktop):
16
+ ### Claude Desktop
17
+
18
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
16
19
 
17
20
  ```json
18
21
  {
19
22
  "mcpServers": {
20
23
  "drift": {
21
- "command": "npx",
22
- "args": ["driftdetect-mcp", "/path/to/your/project"]
24
+ "command": "driftdetect-mcp"
23
25
  }
24
26
  }
25
27
  }
26
28
  ```
27
29
 
28
- Or if installed globally:
30
+ ### Cursor / Windsurf / Kiro
31
+
32
+ Add to your MCP config:
29
33
 
30
34
  ```json
31
35
  {
32
36
  "mcpServers": {
33
37
  "drift": {
34
- "command": "drift-mcp",
35
- "args": ["/path/to/your/project"]
38
+ "command": "driftdetect-mcp"
36
39
  }
37
40
  }
38
41
  }
39
42
  ```
40
43
 
41
- ## Available Tools
44
+ ### Alternative: npx with pinned version
42
45
 
43
- ### `drift_status`
44
- Get overall codebase pattern health and statistics.
45
-
46
- ### `drift_patterns`
47
- Query patterns by category with optional confidence filtering.
48
-
49
- **Parameters:**
50
- - `categories` (optional): Array of categories to query
51
- - `minConfidence` (optional): Minimum confidence score (0.0-1.0)
52
-
53
- ### `drift_files`
54
- Get patterns found in a specific file or glob pattern.
55
-
56
- **Parameters:**
57
- - `path` (required): File path or glob pattern
58
- - `category` (optional): Filter by category
59
-
60
- ### `drift_where`
61
- Find where a pattern is used across the codebase.
62
-
63
- **Parameters:**
64
- - `pattern` (required): Pattern name or ID to search
65
- - `category` (optional): Filter by category
66
-
67
- ### `drift_export`
68
- Export patterns in AI-optimized format for code generation context.
69
-
70
- **Parameters:**
71
- - `categories` (optional): Categories to export
72
- - `format` (optional): `ai-context`, `json`, or `summary`
73
- - `compact` (optional): Reduce output verbosity
74
-
75
- ### `drift_contracts`
76
- Get frontend/backend API contract status and mismatches.
77
-
78
- **Parameters:**
79
- - `status` (optional): `all`, `verified`, `mismatch`, or `discovered`
80
-
81
- ### `drift_trends`
82
- Get pattern trend analysis and regression alerts. Shows how patterns have changed over time.
83
-
84
- **Parameters:**
85
- - `period` (optional): Time period - `7d`, `30d`, or `90d` (default: `7d`)
86
- - `category` (optional): Filter trends by category
87
- - `severity` (optional): `all`, `critical`, or `warning`
88
- - `type` (optional): `all`, `regressions`, or `improvements`
89
-
90
- ### `drift_examples`
91
- Get actual code examples for patterns. Returns real code snippets from the codebase.
92
-
93
- **Parameters:**
94
- - `categories` (optional): Categories to get examples for
95
- - `pattern` (optional): Specific pattern name or ID
96
- - `maxExamples` (optional): Maximum examples per pattern (default: 3)
97
- - `contextLines` (optional): Lines of context around each match (default: 10)
98
- - `includeDeprecated` (optional): Include deprecated code examples (default: false)
99
-
100
- ### `drift_pack`
101
- Get pre-defined pattern packs for common development tasks.
102
-
103
- **Parameters:**
104
- - `action` (optional): `get`, `list`, `suggest`, `create`, `delete`, or `infer`
105
- - `name` (optional): Pack name for get/create/delete actions
106
- - `refresh` (optional): Force regenerate the pack
107
-
108
- ### `drift_feedback`
109
- Provide feedback on pattern examples to improve future suggestions.
110
-
111
- **Parameters:**
112
- - `action` (optional): `rate`, `stats`, or `clear`
113
- - `file` (required for rate): File path of the example
114
- - `rating` (required for rate): `good`, `bad`, or `irrelevant`
115
- - `reason` (optional): Reason for the rating
116
-
117
- ## Categories
118
- - `api` - API route patterns, response formats
119
- - `auth` - Authentication and authorization
120
- - `security` - Security patterns and practices
121
- - `errors` - Error handling patterns
122
- - `logging` - Logging conventions
123
- - `testing` - Test structure and mocking
124
- - `data-access` - Database and data layer patterns
125
- - `config` - Configuration management
126
- - `types` - TypeScript type patterns
127
- - `structural` - File/folder organization
128
- - `components` - UI component patterns
129
- - `styling` - CSS/styling conventions
130
- - `accessibility` - A11y patterns
131
- - `documentation` - Doc patterns
132
- - `performance` - Performance optimizations
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "drift": {
50
+ "command": "npx",
51
+ "args": ["-y", "driftdetect-mcp@0.9.22"]
52
+ }
53
+ }
54
+ }
55
+ ```
133
56
 
134
- ## Example Usage
57
+ ## Prerequisites
135
58
 
136
- Once configured, AI agents can query your codebase patterns:
59
+ Scan your project first:
137
60
 
61
+ ```bash
62
+ cd /path/to/your/project
63
+ npx driftdetect init
64
+ npx driftdetect scan
138
65
  ```
139
- Agent: "How does this codebase handle authentication?"
140
- → Uses drift_patterns with categories: ["auth", "security"]
141
66
 
142
- Agent: "Show me the API patterns before I add a new endpoint"
143
- → Uses drift_export with categories: ["api"] and format: "ai-context"
67
+ ## Security & Privacy
144
68
 
145
- Agent: "Are there any API contract mismatches?"
146
- Uses drift_contracts with status: "mismatch"
69
+ - **Reads**: Source files in your project directory
70
+ - **Writes**: `.drift/` directory only
71
+ - **Network**: No outbound calls (all analysis is local)
72
+ - **Telemetry**: Anonymous usage stats, opt-out with `drift telemetry disable`
147
73
 
148
- Agent: "Has code quality regressed recently?"
149
- → Uses drift_trends with period: "7d" and severity: "critical"
74
+ ## Available Tools
150
75
 
151
- Agent: "Show me how error handling is done in this codebase"
152
- → Uses drift_examples with categories: ["errors"]
153
- ```
76
+ 45+ MCP tools organized in 7 layers:
154
77
 
155
- ## Prerequisites
78
+ | Layer | Key Tools | Purpose |
79
+ |-------|-----------|---------|
80
+ | **Orchestration** | `drift_context` | Start here - curated context for any task |
81
+ | **Discovery** | `drift_status`, `drift_capabilities` | Quick overview |
82
+ | **Surgical** | `drift_signature`, `drift_callers`, `drift_type` | Precise queries |
83
+ | **Exploration** | `drift_patterns_list`, `drift_security_summary` | Browse patterns |
84
+ | **Detail** | `drift_pattern_get`, `drift_code_examples` | Deep dives |
85
+ | **Analysis** | `drift_test_topology`, `drift_coupling` | Code health |
86
+ | **Generation** | `drift_validate_change`, `drift_suggest_changes` | AI assistance |
156
87
 
157
- Run `drift scan` in your project first to build the pattern database:
88
+ ## Example Usage
158
89
 
159
- ```bash
160
- cd /path/to/your/project
161
- npx driftdetect scan
162
90
  ```
91
+ You: "Add a user preferences endpoint"
92
+
93
+ AI calls drift_context({ intent: "add_feature", focus: "user preferences" })
94
+
95
+ Drift returns:
96
+ - Your API patterns (decorators, prefixes, response format)
97
+ - Similar endpoints as examples
98
+ - Required middleware
99
+ - Files to modify
100
+ - Security considerations
101
+ ```
102
+
103
+ ## Documentation
104
+
105
+ - [Full Documentation](https://github.com/dadbodgeoff/drift/wiki)
106
+ - [MCP Tools Reference](https://github.com/dadbodgeoff/drift/wiki/MCP-Tools-Reference)
107
+ - [MCP Setup Guide](https://github.com/dadbodgeoff/drift/wiki/MCP-Setup)
108
+
109
+ ## License
110
+
111
+ Apache 2.0 - See [LICENSE](https://github.com/dadbodgeoff/drift/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "driftdetect-mcp",
3
- "version": "0.9.22",
3
+ "version": "0.9.23",
4
4
  "description": "MCP server that gives AI agents (Claude, Cursor, Copilot) deep understanding of your codebase patterns, conventions, and architecture. Query patterns, security boundaries, call graphs in real-time.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Geoffrey Fernald",