@morphllm/morphmcp 0.8.22 → 0.8.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.
- package/README.md +13 -181
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# Morph MCP
|
|
2
2
|
|
|
3
|
-
Unified Model Context Protocol (MCP) server providing AI-powered file editing
|
|
3
|
+
Unified Model Context Protocol (MCP) server providing AI-powered file editing capabilities. Built on Morph's SDK for fast, accurate code operations.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
### AI-Powered Tools
|
|
8
8
|
- **Fast Apply (edit_file)** - Morph's lightning-fast code editing at 10,500+ tokens/sec with 98% accuracy
|
|
9
|
-
- **Semantic Search (codebase_search)** - Natural language code search using embeddings and GPU reranking for finding relevant code across your codebase
|
|
10
|
-
- **Fast Context Search (fast_context_search)** - AI-powered grep agent using WarpGrep that intelligently explores repositories to find relevant code
|
|
11
9
|
|
|
12
10
|
### Filesystem Operations
|
|
13
11
|
- Read/write files with memory-efficient head/tail operations
|
|
@@ -30,36 +28,26 @@ Unified Model Context Protocol (MCP) server providing AI-powered file editing an
|
|
|
30
28
|
| Variable | Description | Default |
|
|
31
29
|
|----------|-------------|---------|
|
|
32
30
|
| `MORPH_API_KEY` | Your Morph API key (required for AI tools) | - |
|
|
33
|
-
| `ENABLED_TOOLS` | Comma-separated list of enabled tools, or `all` | `edit_file
|
|
34
|
-
| `MORPH_DEBUG` | Enable debug logging for grep agent (`true`/`false`) | `false` |
|
|
31
|
+
| `ENABLED_TOOLS` | Comma-separated list of enabled tools, or `all` | `edit_file` |
|
|
35
32
|
| `ENABLE_WORKSPACE_MODE` | Auto-detect workspace root (`true`/`false`) | `true` |
|
|
36
33
|
| `WORKSPACE_ROOT` | Override workspace root directory | `$PWD` |
|
|
37
34
|
|
|
38
35
|
### Tool Configuration
|
|
39
36
|
|
|
40
|
-
Control which tools are available using `ENABLED_TOOLS`. **By default, only AI-powered
|
|
37
|
+
Control which tools are available using `ENABLED_TOOLS`. **By default, only the AI-powered tool (`edit_file`) is enabled** to keep the interface clean. Enable additional filesystem tools as needed:
|
|
41
38
|
|
|
42
39
|
```bash
|
|
43
|
-
# Default: Only AI-powered
|
|
44
|
-
# (No ENABLED_TOOLS needed - edit_file
|
|
40
|
+
# Default: Only AI-powered tool
|
|
41
|
+
# (No ENABLED_TOOLS needed - edit_file is enabled by default)
|
|
45
42
|
|
|
46
43
|
# Enable all tools including filesystem operations
|
|
47
44
|
ENABLED_TOOLS=all
|
|
48
45
|
|
|
49
|
-
# Only
|
|
50
|
-
ENABLED_TOOLS=edit_file,codebase_search
|
|
51
|
-
|
|
52
|
-
# Only fast apply
|
|
46
|
+
# Only fast apply (explicit, same as default)
|
|
53
47
|
ENABLED_TOOLS=edit_file
|
|
54
48
|
|
|
55
|
-
# Only semantic search
|
|
56
|
-
ENABLED_TOOLS=codebase_search
|
|
57
|
-
|
|
58
|
-
# Include fast_context_search (grep agent)
|
|
59
|
-
ENABLED_TOOLS=edit_file,codebase_search,fast_context_search
|
|
60
|
-
|
|
61
49
|
# Custom selection
|
|
62
|
-
ENABLED_TOOLS=read_file,write_file,edit_file
|
|
50
|
+
ENABLED_TOOLS=read_file,write_file,edit_file
|
|
63
51
|
```
|
|
64
52
|
|
|
65
53
|
## Available Tools
|
|
@@ -81,78 +69,6 @@ ENABLED_TOOLS=read_file,write_file,edit_file,codebase_search
|
|
|
81
69
|
|
|
82
70
|
**Note for Cursor users:** If you're using this tool within Cursor, you may need to first use another tool (like `search_replace`) to add exactly one empty newline somewhere in the file before using `edit_file`. This ensures the file is in an editable state.
|
|
83
71
|
|
|
84
|
-
#### `codebase_search`
|
|
85
|
-
**SEMANTIC CODE SEARCH** - Find code using natural language queries. Uses two-stage retrieval (vector search + GPU reranking) to find the most relevant code across your entire codebase.
|
|
86
|
-
|
|
87
|
-
**Key features:**
|
|
88
|
-
- Natural language queries: "Where is JWT validation?" or "How does auth work?"
|
|
89
|
-
- Two-stage retrieval: Vector search (~240ms) + GPU reranking (~630ms)
|
|
90
|
-
- Returns precise code chunks with relevance scores
|
|
91
|
-
- Searches by semantic meaning, not just keywords
|
|
92
|
-
- Works across all files and languages
|
|
93
|
-
|
|
94
|
-
**Requires:** `MORPH_API_KEY` and code pushed to Morph git
|
|
95
|
-
|
|
96
|
-
**How it works:**
|
|
97
|
-
```
|
|
98
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
99
|
-
│ SEMANTIC SEARCH LIFECYCLE │
|
|
100
|
-
└─────────────────────────────────────────────────────────────┘
|
|
101
|
-
|
|
102
|
-
1. CODE CHANGES 2. AUTO-SYNC (Plugin)
|
|
103
|
-
┌─────────────┐ ┌─────────────┐
|
|
104
|
-
│ Agent edits │ ────────────────── │ git commit │
|
|
105
|
-
│ files │ │ + push │
|
|
106
|
-
└─────────────┘ └──────┬──────┘
|
|
107
|
-
│
|
|
108
|
-
▼
|
|
109
|
-
3. EMBEDDING (3-8s) 4. INDEXED & SEARCHABLE
|
|
110
|
-
┌─────────────────┐ ┌──────────────────┐
|
|
111
|
-
│ Code chunking │ │ PostgreSQL │
|
|
112
|
-
│ morph-v4-embed │ ──────────── │ pgvector (HNSW) │
|
|
113
|
-
│ Vector storage │ │ Ready for search │
|
|
114
|
-
└─────────────────┘ └────────┬─────────┘
|
|
115
|
-
│
|
|
116
|
-
▼
|
|
117
|
-
5. SEARCH QUERY 6. TWO-STAGE RETRIEVAL
|
|
118
|
-
┌─────────────────┐ ┌──────────────────┐
|
|
119
|
-
│ "Find auth │ │ Vector: top 50 │
|
|
120
|
-
│ logic" │ ──────────── │ Rerank: top 10 │
|
|
121
|
-
└─────────────────┘ │ ~1000ms total │
|
|
122
|
-
└────────┬─────────┘
|
|
123
|
-
│
|
|
124
|
-
▼
|
|
125
|
-
7. RESULTS 8. AGENT USES CONTEXT
|
|
126
|
-
┌─────────────────┐ ┌──────────────────┐
|
|
127
|
-
│ Ranked code │ │ Makes informed │
|
|
128
|
-
│ with scores │ ──────────── │ edits with │
|
|
129
|
-
│ + line numbers │ │ relevant context │
|
|
130
|
-
└─────────────────┘ └──────────────────┘
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**Setup:** Install the `morph-sync` plugin to automatically sync code after every agent response. See [Enable Semantic Search](#enable-semantic-search-with-morph-sync-plugin) below.
|
|
134
|
-
|
|
135
|
-
**Example queries:**
|
|
136
|
-
- "Where is JWT validation implemented?"
|
|
137
|
-
- "How does the authentication middleware work?"
|
|
138
|
-
- "Find database connection setup"
|
|
139
|
-
|
|
140
|
-
#### `fast_context_search`
|
|
141
|
-
Intelligently search and gather relevant code context from a repository using Morph's WarpGrep AI-powered search agent. Automatically explores the codebase with grep, file reading, and directory analysis to find exactly what you need.
|
|
142
|
-
|
|
143
|
-
**Key features:**
|
|
144
|
-
- AI-powered multi-round exploration
|
|
145
|
-
- Returns precise line ranges, not entire files
|
|
146
|
-
- Prevents context pollution by finding only relevant code
|
|
147
|
-
- Formatted XML output with line numbers
|
|
148
|
-
|
|
149
|
-
**Example queries:**
|
|
150
|
-
- "Where is JWT token validation implemented?"
|
|
151
|
-
- "How does the authentication middleware work?"
|
|
152
|
-
- "Find the database connection setup"
|
|
153
|
-
|
|
154
|
-
**Requires:** `MORPH_API_KEY`
|
|
155
|
-
|
|
156
72
|
### File Operations
|
|
157
73
|
*Note: These tools are available but disabled by default. Set `ENABLED_TOOLS=all` to enable.*
|
|
158
74
|
|
|
@@ -288,16 +204,6 @@ Or manually add to `.vscode/mcp.json`:
|
|
|
288
204
|
}
|
|
289
205
|
```
|
|
290
206
|
|
|
291
|
-
**For semantic code search only:**
|
|
292
|
-
```json
|
|
293
|
-
{
|
|
294
|
-
"env": {
|
|
295
|
-
"MORPH_API_KEY": "sk-...",
|
|
296
|
-
"ENABLED_TOOLS": "codebase_search"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
207
|
**For everything (including all filesystem tools):**
|
|
302
208
|
```json
|
|
303
209
|
{
|
|
@@ -308,32 +214,20 @@ Or manually add to `.vscode/mcp.json`:
|
|
|
308
214
|
}
|
|
309
215
|
```
|
|
310
216
|
|
|
311
|
-
**Default (AI
|
|
217
|
+
**Default (AI tool only - recommended for most use cases):**
|
|
312
218
|
```json
|
|
313
219
|
{
|
|
314
220
|
"env": {
|
|
315
221
|
"MORPH_API_KEY": "sk-..."
|
|
316
|
-
// ENABLED_TOOLS defaults to edit_file
|
|
222
|
+
// ENABLED_TOOLS defaults to edit_file
|
|
317
223
|
}
|
|
318
224
|
}
|
|
319
225
|
```
|
|
320
226
|
|
|
321
|
-
### 3.
|
|
322
|
-
|
|
323
|
-
For the `codebase_search` tool to work, code must be synced to Morph git. Install the `morph-sync` plugin:
|
|
324
|
-
|
|
325
|
-
**In Claude Code:**
|
|
326
|
-
```bash
|
|
327
|
-
/plugin install morph-sync
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
The plugin automatically commits and pushes code after every agent response, triggering embedding in the background (3-8 seconds).
|
|
331
|
-
|
|
332
|
-
### 4. Test Your Setup
|
|
227
|
+
### 3. Test Your Setup
|
|
333
228
|
|
|
334
229
|
In your AI assistant, try:
|
|
335
230
|
- **Edit test:** "Use the edit_file tool to add a comment to the main function"
|
|
336
|
-
- **Search test:** "Find the authentication logic in this codebase" (uses codebase_search)
|
|
337
231
|
|
|
338
232
|
## Usage Examples
|
|
339
233
|
|
|
@@ -350,35 +244,6 @@ The AI will:
|
|
|
350
244
|
5. Report errors (if any) to Morph for continuous improvement
|
|
351
245
|
```
|
|
352
246
|
|
|
353
|
-
### Semantic Code Search
|
|
354
|
-
|
|
355
|
-
```
|
|
356
|
-
Ask AI: "Find the authentication logic in this codebase"
|
|
357
|
-
|
|
358
|
-
The codebase_search tool will:
|
|
359
|
-
1. Query the embedded codebase using natural language
|
|
360
|
-
2. Vector search retrieves top 50 candidates (~240ms)
|
|
361
|
-
3. GPU reranking scores for precision (~630ms)
|
|
362
|
-
4. Return top 10 most relevant code chunks with scores
|
|
363
|
-
5. Include file paths, line numbers, and relevance percentages
|
|
364
|
-
6. Agent uses this context to make informed edits
|
|
365
|
-
|
|
366
|
-
Note: Requires code to be synced via morph-sync plugin
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Fast Context Search
|
|
370
|
-
|
|
371
|
-
```
|
|
372
|
-
Ask AI: "Use fast_context_search to find where JWT tokens are validated"
|
|
373
|
-
|
|
374
|
-
The WarpGrep agent will:
|
|
375
|
-
1. Explore the repository using grep, read, and analyse tools
|
|
376
|
-
2. Perform multi-round intelligent exploration
|
|
377
|
-
3. Find relevant code across multiple files
|
|
378
|
-
4. Return precise line ranges with full context (not entire files)
|
|
379
|
-
5. Display formatted XML output with line numbers
|
|
380
|
-
6. Show summary of tool calls made during search
|
|
381
|
-
```
|
|
382
247
|
|
|
383
248
|
## Migration Guide
|
|
384
249
|
|
|
@@ -404,26 +269,6 @@ The WarpGrep agent will:
|
|
|
404
269
|
}
|
|
405
270
|
```
|
|
406
271
|
|
|
407
|
-
### From `morph-codeseek`
|
|
408
|
-
|
|
409
|
-
**Old config:**
|
|
410
|
-
```json
|
|
411
|
-
{
|
|
412
|
-
"env": {
|
|
413
|
-
"GREP_AGENT_API_KEY": "sk-..."
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
**New config:**
|
|
419
|
-
```json
|
|
420
|
-
{
|
|
421
|
-
"env": {
|
|
422
|
-
"MORPH_API_KEY": "sk-...",
|
|
423
|
-
"ENABLED_TOOLS": "fast_context_search"
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
```
|
|
427
272
|
|
|
428
273
|
## Architecture
|
|
429
274
|
|
|
@@ -432,19 +277,15 @@ The WarpGrep agent will:
|
|
|
432
277
|
```
|
|
433
278
|
morph-mcp/
|
|
434
279
|
├── index.ts # Main server & tool registry
|
|
435
|
-
├── grep/ # Fast context search agent (WarpGrep)
|
|
436
|
-
│ ├── agent/ # Multi-round exploration logic
|
|
437
|
-
│ ├── tools/ # Grep, read, analyse, finish
|
|
438
|
-
│ └── utils/ # Ripgrep, file finder, logger
|
|
439
280
|
├── path-utils.ts # Path normalization & Windows/WSL support
|
|
440
281
|
├── path-validation.ts # Security validation
|
|
441
282
|
├── roots-utils.ts # MCP Roots protocol handling
|
|
442
|
-
└── @morphllm/morphsdk # Morph SDK integration (Fast Apply
|
|
283
|
+
└── @morphllm/morphsdk # Morph SDK integration (Fast Apply)
|
|
443
284
|
```
|
|
444
285
|
|
|
445
286
|
### Dependencies
|
|
446
287
|
|
|
447
|
-
- **@morphllm/morphsdk** (v0.2.22) - Core Fast Apply
|
|
288
|
+
- **@morphllm/morphsdk** (v0.2.22) - Core Fast Apply functionality
|
|
448
289
|
- **@modelcontextprotocol/sdk** (v1.12.3) - MCP protocol implementation
|
|
449
290
|
- **@vscode/ripgrep** - Fast text search engine
|
|
450
291
|
|
|
@@ -463,19 +304,11 @@ morph-mcp/
|
|
|
463
304
|
### Tools Not Showing Up
|
|
464
305
|
|
|
465
306
|
1. Check API key is set: `MORPH_API_KEY=sk-...`
|
|
466
|
-
2. **By default, only `edit_file`
|
|
307
|
+
2. **By default, only `edit_file` is enabled.** To enable all filesystem tools, set `ENABLED_TOOLS=all`
|
|
467
308
|
3. Verify the tool name is in your `ENABLED_TOOLS` list
|
|
468
309
|
4. Restart your AI assistant completely
|
|
469
310
|
5. Check logs: `tail -f ~/Library/Logs/Claude/mcp*.log` (Claude Desktop) or check stderr output
|
|
470
311
|
|
|
471
|
-
### Fast Context Search Not Finding Code
|
|
472
|
-
|
|
473
|
-
1. Ensure you're passing the correct repository path (absolute or relative to workspace)
|
|
474
|
-
2. Try more specific queries - WarpGrep works best with clear, descriptive queries
|
|
475
|
-
3. Enable debug logging: `MORPH_DEBUG=true`
|
|
476
|
-
4. Check that `MORPH_API_KEY` is correctly set
|
|
477
|
-
5. Verify the repository path is within allowed directories (use `list_allowed_directories` tool)
|
|
478
|
-
|
|
479
312
|
### Permission Errors
|
|
480
313
|
|
|
481
314
|
1. Check allowed directories: Use `list_allowed_directories` tool
|
|
@@ -487,7 +320,6 @@ morph-mcp/
|
|
|
487
320
|
| Feature | Speed | Accuracy |
|
|
488
321
|
|---------|-------|----------|
|
|
489
322
|
| Fast Apply (edit_file) | 10,500+ tok/sec | 98% |
|
|
490
|
-
| Context Search (WarpGrep) | Multi-round, 30s | High relevance |
|
|
491
323
|
| File Operations | Native speed | 100% |
|
|
492
324
|
|
|
493
325
|
**Note:** Performance metrics are based on Morph's production models. Actual performance may vary based on file size, complexity, and network conditions.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morphllm/morphmcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.23",
|
|
4
4
|
"description": "Fast & accurate MCP server with AI-powered file editing and intelligent code search. Prevents context pollution and saves time for a better user experience.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Morph (https://morphllm.com)",
|