driftdetect-mcp 0.9.22 → 0.9.24

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 (3) hide show
  1. package/LICENSE +121 -0
  2. package/README.md +68 -119
  3. package/package.json +11 -11
package/LICENSE ADDED
@@ -0,0 +1,121 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship.
43
+
44
+ "Contribution" shall mean any work of authorship, including
45
+ the original version of the Work and any modifications or additions
46
+ to that Work or Derivative Works thereof, that is intentionally
47
+ submitted to the Licensor for inclusion in the Work by the copyright owner.
48
+
49
+ "Contributor" shall mean Licensor and any individual or Legal Entity
50
+ on behalf of whom a Contribution has been received by Licensor and
51
+ subsequently incorporated within the Work.
52
+
53
+ 2. Grant of Copyright License. Subject to the terms and conditions of
54
+ this License, each Contributor hereby grants to You a perpetual,
55
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
56
+ copyright license to reproduce, prepare Derivative Works of,
57
+ publicly display, publicly perform, sublicense, and distribute the
58
+ Work and such Derivative Works in Source or Object form.
59
+
60
+ 3. Grant of Patent License. Subject to the terms and conditions of
61
+ this License, each Contributor hereby grants to You a perpetual,
62
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
63
+ patent license to make, have made, use, offer to sell, sell, import,
64
+ and otherwise transfer the Work.
65
+
66
+ 4. Redistribution. You may reproduce and distribute copies of the
67
+ Work or Derivative Works thereof in any medium, with or without
68
+ modifications, and in Source or Object form, provided that You
69
+ meet the following conditions:
70
+
71
+ (a) You must give any other recipients of the Work or
72
+ Derivative Works a copy of this License; and
73
+
74
+ (b) You must cause any modified files to carry prominent notices
75
+ stating that You changed the files; and
76
+
77
+ (c) You must retain, in the Source form of any Derivative Works
78
+ that You distribute, all copyright, patent, trademark, and
79
+ attribution notices from the Source form of the Work; and
80
+
81
+ (d) If the Work includes a "NOTICE" text file as part of its
82
+ distribution, then any Derivative Works that You distribute must
83
+ include a readable copy of the attribution notices contained
84
+ within such NOTICE file.
85
+
86
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
87
+ any Contribution intentionally submitted for inclusion in the Work
88
+ by You to the Licensor shall be under the terms and conditions of
89
+ this License, without any additional terms or conditions.
90
+
91
+ 6. Trademarks. This License does not grant permission to use the trade
92
+ names, trademarks, service marks, or product names of the Licensor.
93
+
94
+ 7. Disclaimer of Warranty. Unless required by applicable law or
95
+ agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
96
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
97
+
98
+ 8. Limitation of Liability. In no event and under no legal theory,
99
+ shall any Contributor be liable to You for damages, including any
100
+ direct, indirect, special, incidental, or consequential damages.
101
+
102
+ 9. Accepting Warranty or Additional Liability. While redistributing
103
+ the Work or Derivative Works thereof, You may choose to offer,
104
+ and charge a fee for, acceptance of support, warranty, indemnity,
105
+ or other liability obligations.
106
+
107
+ END OF TERMS AND CONDITIONS
108
+
109
+ Copyright 2025 Geoffrey Fernald
110
+
111
+ Licensed under the Apache License, Version 2.0 (the "License");
112
+ you may not use this file except in compliance with the License.
113
+ You may obtain a copy of the License at
114
+
115
+ http://www.apache.org/licenses/LICENSE-2.0
116
+
117
+ Unless required by applicable law or agreed to in writing, software
118
+ distributed under the License is distributed on an "AS IS" BASIS,
119
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120
+ See the License for the specific language governing permissions and
121
+ limitations under the License.
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.23
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.23"]
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.24",
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",
@@ -48,20 +48,20 @@
48
48
  "files": [
49
49
  "dist"
50
50
  ],
51
- "scripts": {
52
- "build": "tsc",
53
- "clean": "rm -rf dist",
54
- "dev": "tsc --watch",
55
- "start": "node dist/bin/server.js",
56
- "typecheck": "tsc --noEmit"
57
- },
58
51
  "dependencies": {
59
52
  "@modelcontextprotocol/sdk": "^1.0.0",
60
- "driftdetect-core": "^0.9.20",
61
- "driftdetect-detectors": "^0.9.20"
53
+ "driftdetect-core": "0.9.24",
54
+ "driftdetect-detectors": "0.9.24"
62
55
  },
63
56
  "devDependencies": {
64
57
  "@types/node": "^20.10.0",
65
58
  "typescript": "^5.3.0"
59
+ },
60
+ "scripts": {
61
+ "build": "tsc",
62
+ "clean": "rm -rf dist",
63
+ "dev": "tsc --watch",
64
+ "start": "node dist/bin/server.js",
65
+ "typecheck": "tsc --noEmit"
66
66
  }
67
- }
67
+ }