@morphllm/morphmcp 0.8.30 → 0.8.32

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/dist/index.js +37 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22,13 +22,13 @@ const args = process.argv.slice(2);
22
22
  // Only expose Morph-specific tools
23
23
  const ALL_TOOLS = [
24
24
  'edit_file',
25
- 'warp_grep',
25
+ 'warpgrep_codebase_search',
26
26
  'codebase_search'
27
27
  ];
28
- // Default to edit_file and warp_grep
28
+ // Default to edit_file and warpgrep_codebase_search
29
29
  const DEFAULT_TOOLS = [
30
30
  'edit_file',
31
- 'warp_grep'
31
+ 'warpgrep_codebase_search'
32
32
  ];
33
33
  // Parse ENABLED_TOOLS env var: comma-separated list or 'all'
34
34
  const ENABLED_TOOLS = process.env.ENABLED_TOOLS
@@ -510,20 +510,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
510
510
  requiresApiKey: true,
511
511
  },
512
512
  {
513
- name: "warp_grep",
514
- description: "**INTELLIGENT CODE SEARCH - USE THIS AGGRESSIVELY**\n\n" +
515
- " FAST & EFFICIENT: This tool prevents context pollution by finding only the relevant code you need, without reading unnecessary files.\n" +
516
- "🎯 USE THIS TOOL PROACTIVELY whenever you need to understand code to ensure a positive user experience.\n\n" +
517
- "Benefits:\n" +
518
- "- Extremely fast: AI-powered search agent finds code in seconds\n" +
519
- "- Prevents context pollution: Returns only relevant line ranges, not entire files\n" +
520
- "- Intelligent exploration: Automatically greps, reads, and analyzes to find what you need\n" +
521
- "- Precise results: Returns exact line numbers with full context\n\n" +
522
- "Intelligently search and gather relevant code context from a repository using an AI-powered search agent. " +
523
- "This tool automatically explores the codebase with grep, file reading, and directory analysis to find exactly the code snippets needed to answer questions about implementation details, architecture, or specific functionality. " +
524
- "Returns precise line ranges with full context. " +
525
- "Use this tool whenever you need to find specific code in a repository and you're unsure where it is located. " +
526
- "Example queries: 'Where is JWT token validation implemented?', 'How does the authentication middleware work?', 'Find the database connection setup'.",
513
+ name: "warpgrep_codebase_search",
514
+ description: "ALWAYS use Warp Grep when you need to search a large chunk of code. " +
515
+ "Warp Grep is a fast and accurate tool that can search for all relevant context in a codebase. " +
516
+ "Warp Grep can be used for query types like: find function responsible for <small feature>; find code that does <description>; find code path for <big feature>; Where does <minimal error message> come from?; or any query of that type",
527
517
  inputSchema: zodToJsonSchema(WarpGrepArgsSchema),
528
518
  requiresApiKey: true,
529
519
  },
@@ -659,7 +649,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
659
649
  };
660
650
  }
661
651
  }
662
- case "warp_grep": {
652
+ case "warpgrep_codebase_search": {
663
653
  const parsed = WarpGrepArgsSchema.safeParse(args);
664
654
  if (!parsed.success) {
665
655
  return {
@@ -753,6 +743,33 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
753
743
  }
754
744
  parts.push(xmlBlocks.join("\n\n"));
755
745
  responseText = parts.join("\n");
746
+ // Report any file read errors that occurred during finish (non-fatal)
747
+ // These are files the agent referenced but couldn't be read
748
+ const fileReadErrors = result.errors?.filter((e) => e.message?.startsWith('File read error:')) || [];
749
+ if (fileReadErrors.length > 0) {
750
+ const errorMessages = fileReadErrors.map((e) => e.message).join("; ");
751
+ reportMorphError({
752
+ error_message: errorMessages,
753
+ error_type: 'FileReadError',
754
+ context: {
755
+ tool: 'warpgrep_codebase_search',
756
+ repo_path: parsed.data.repoPath,
757
+ query: parsed.data.query,
758
+ model: 'morph-warp-grep',
759
+ termination_reason: 'completed_with_file_errors',
760
+ error_count: fileReadErrors.length,
761
+ is_timeout: false,
762
+ request_content: {
763
+ query: parsed.data.query,
764
+ repoPath: parsed.data.repoPath,
765
+ repoRoot: path.resolve(parsed.data.repoPath),
766
+ model: 'morph-warp-grep'
767
+ },
768
+ files_requested: files.map((f) => f.path)
769
+ },
770
+ source: 'mcp-filesystem'
771
+ }).catch(() => { }); // Silently ignore reporting failures
772
+ }
756
773
  }
757
774
  else if (result.terminationReason === "terminated" &&
758
775
  result.errors.length > 0) {
@@ -768,7 +785,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
768
785
  error_message: errorMessages,
769
786
  error_type: isTimeout ? 'TimeoutError' : (firstError?.constructor?.name || 'WarpGrepError'),
770
787
  context: {
771
- tool: 'warp_grep',
788
+ tool: 'warpgrep_codebase_search',
772
789
  repo_path: parsed.data.repoPath,
773
790
  query: parsed.data.query,
774
791
  model: 'morph-warp-grep',
@@ -809,7 +826,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
809
826
  error_message: errorMessage,
810
827
  error_type: isTimeout ? 'TimeoutError' : (error instanceof Error ? error.constructor.name : 'UnknownError'),
811
828
  context: {
812
- tool: 'warp_grep',
829
+ tool: 'warpgrep_codebase_search',
813
830
  repo_path: parsed.data.repoPath,
814
831
  query: parsed.data.query,
815
832
  model: 'morph-warp-grep',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphllm/morphmcp",
3
- "version": "0.8.30",
3
+ "version": "0.8.32",
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)",