Skip to content

Add regex search tool to mcp-oaf-browse#128

Merged
nmaguiar merged 2 commits intomainfrom
codex/add-asynchronous-search-tool-to-mcp-oaf-browse
Mar 28, 2026
Merged

Add regex search tool to mcp-oaf-browse#128
nmaguiar merged 2 commits intomainfrom
codex/add-asynchronous-search-tool-to-mcp-oaf-browse

Conversation

@nmaguiar
Copy link
Copy Markdown
Contributor

@nmaguiar nmaguiar commented Mar 28, 2026

Motivation

  • Provide a browse-native search operation so callers can discover objects by pattern without knowing exact paths.
  • Reuse the existing HTTP Browse API list endpoint to perform discovery across returned entry fields.
  • Keep scans safe and efficient by doing batched/asynchronous requests and limiting breadth/depth/results.

Description

  • Added a new search MCP tool definition to mcps/mcp-oaf-browse.yaml with schema options pattern, path, params, caseSensitive, maxDepth, maxPaths, and maxResults.
  • Exposed the tool in the MCP function map alongside list and get so it is active for both STDIO and HTTP MCP modes.
  • Implemented a Browse search job that traverses browse paths by repeatedly calling the existing list API and performs regex matching across all fields of each returned entry after stringifying non-primitive values.
  • Uses concurrent processing (pForEach) wrapped in safe async $do blocks, atomic flags for short-circuiting field checks, and child-path extraction from common fields (path, filepath, filePath, relativePath, canonicalPath) while enforcing traversal controls.

Testing

  • Ran the MCP help invocation ojob mcps/mcp-oaf-browse.yaml -h to validate wiring, which failed in this environment because ojob is not installed (/bin/bash: line 1: ojob: command not found).
  • No additional automated MCP runtime tests were executed in this environment; static inspection and git commit verify the file change was applied successfully.

@nmaguiar nmaguiar marked this pull request as ready for review March 28, 2026 00:48
@nmaguiar nmaguiar self-assigned this Mar 28, 2026
  - Fetch all pages from paginated list API responses
  - Use thread-safe syncArray for result collection
  - Add safety limits to prevent infinite pagination loops
  - Replace $do pattern with try-catch for error handling
@nmaguiar nmaguiar merged commit c47b665 into main Mar 28, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in Continuous Enhancement Mar 28, 2026
@nmaguiar nmaguiar deleted the codex/add-asynchronous-search-tool-to-mcp-oaf-browse branch March 28, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

1 participant