[Feature]: WordSearch
Feature Description
I am not that experienced (maybe dumb suggestion) - could you make the search for a certain word in Xcode possible? Sometimes in my huge project, I use oversight and have the same files/commands/etc. in different locations in Xcode and the mcp does not notice and can‘t search itself after the doubled up words.
Use Cases
No response
Example Interactions
No response
@Lanadya Thanks for the feedback. I'm not sure I fully understand what you're asking. Could you provide an example of the problem you're facing and what the expected behaviour is?
Hi Cameron,I had a threat safe cash issue and couldn’t fix it until I put it in the search in Xcode in the navigator and then I’ve been shown all places where threat save cash has been used in my project.That helped to find a solution for my build problems. The MCP couldn’t do it itself so I had to do it manually if this subscription is still not clear please get back to me. I will try better. Attached I Send the photos.Thank you for your marvelous work!!!!NinaAm 30.04.2025 um 13:34 schrieb Cameron Cooke @.***>: cameroncooke left a comment (cameroncooke/XcodeBuildMCP#16) @Lanadya Thanks for the feedback. I'm not sure I fully understand what you're asking. Could you provide an example of the problem you're facing and what the expected behaviour is?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Hi Cameron, I had a ThreadSafeCache issue and couldn’t fix it until I put the word in the search in Xcode in the navigator and then I’ve been shown all places where ThreadSafeCache has been used in my project. That helped to find a solution for my build problems. The MCP cannot look how often and in what file a certain command (or whatever else) is. it if this description is still not clear please get back to me. I will try better. Attached I Send the photos. Thank you for your marvelous work!!!! Nina image0.jpegimage1.jpeg
@claude please review this issue
Claude finished @cameroncooke's task —— View job
Analysis of WordSearch Feature Request
I'll analyze this feature request for adding text/word search functionality to XcodeBuildMCP.
Todo List:
- [x] Review the feature request details and user needs
- [x] Examine current XcodeBuildMCP architecture and existing search tools
- [x] Look at images provided by the user showing Xcode's search functionality
- [x] Assess technical feasibility and implementation approaches
- [x] Provide recommendations and next steps
Understanding the Request
Based on @Lanadya's description and the screenshots provided, they want the ability to search for specific text/code across their Xcode project files through the MCP server. The specific use case mentioned was searching for "ThreadSafeCache" to identify all locations where this class/pattern was used in the codebase, which helped debug build issues.
The screenshots show Xcode's built-in search functionality that displays:
- Multiple Swift files containing the search term
- Line-by-line matches with context
- File paths and specific code locations
- Highlighted search terms within the code
Current XcodeBuildMCP Architecture Analysis
Existing Capabilities:
- 15 workflow groups with 84+ specialized tools
- Project Discovery:
discover_projstool for finding.xcodeprojand.xcworkspacefiles - Command Infrastructure: Robust
CommandExecutorinterface for running shell commands - File System Access:
FileSystemExecutorinterface for file operations - Plugin Architecture: Auto-discovery system that would easily accommodate new search tools
Missing Capabilities:
- No existing text/content search functionality
- No grep, ripgrep, or similar search utilities exposed as MCP tools
- No source code indexing or search capabilities
Technical Feasibility Assessment
✅ Highly Feasible - This feature aligns perfectly with XcodeBuildMCP's architecture:
Implementation Approaches
1. Command-Line Based Search (Recommended)
// New workflow group: `text-search`
- `search_code` - Search for text/patterns across project files
- `search_files` - Find files by name pattern
- `search_regex` - Advanced regex-based code search
Benefits:
- Leverages existing
CommandExecutorinfrastructure - Uses proven tools (
grep,ripgrep,find) - Fast and reliable
- Works with all file types (Swift, Objective-C, C++, etc.)
- Supports regex patterns for advanced searching
2. Xcode Integration Approach
Could potentially use xcodebuild with specific flags, but this would be limited compared to general text search.
3. File System + Parser Approach
Custom implementation using FileSystemExecutor, but this would be more complex and slower.
Recommended Implementation
New Workflow Group: text-search
Location: src/mcp/tools/text-search/
Core Tools:
-
search_code- Primary text search across project files- Parameters:
searchTerm,projectPath,fileTypes?,caseSensitive?,regex? - Uses
ripgrep(faster) orgrepfallback - Returns: File paths, line numbers, matched content with context
- Parameters:
-
search_files- Find files by name/path patterns- Parameters:
pattern,projectPath,maxDepth? - Uses
findcommand - Returns: Matching file paths
- Parameters:
-
search_replace- Search and replace text (advanced feature)- Parameters:
searchTerm,replacement,projectPath,dryRun? - Interactive confirmation for safety
- Parameters:
Example Usage:
// Find all uses of "ThreadSafeCache" in Swift files
search_code({
searchTerm: "ThreadSafeCache",
projectPath: "/path/to/project",
fileTypes: ["swift"],
caseSensitive: true
})
// Returns:
// AssetManagerTypes.swift:97: guard let url = Bundle(for: CoreCommon.ThreadSafeCache...
// ThreadSafeAssetManager.swift:216: private var imageCache = CoreCommon.ThreadSafeCache...
// ThreadSafeCache.swift:489: // ThreadSafeCache.swift
Integration Strategy
- Plugin Auto-Discovery: Follows existing patterns, tools automatically registered
- Dependency Injection: Uses
CommandExecutorfor testability - Error Handling: Consistent with existing tool response patterns
- Dynamic Loading: Compatible with
XCODEBUILDMCP_DYNAMIC_TOOLS=truemode - Cross-Platform: Works with all supported project types (iOS, macOS)
Development Effort
Estimated Effort: Medium (1-2 weeks)
- Tool implementation: ~3-5 days
- Testing: ~2-3 days
- Documentation: ~1 day
Prerequisites:
ripgrepavailable on system (fallback togrep)- Basic command-line tools (
find,grep)
Recommendation
✅ APPROVE - This is an excellent feature request that:
- Addresses Real Need: Solves actual debugging/development workflow issues
- Fits Architecture: Perfect match for XcodeBuildMCP's plugin system
- High Value: Would be useful for many developers working with large codebases
- Straightforward Implementation: Leverages existing infrastructure
- Future-Proof: Can be extended with more advanced features
Next Steps:
- Create new
text-searchworkflow group - Implement
search_codeas primary tool - Add comprehensive test coverage
- Update documentation
- Consider additional tools (
search_files,search_replace) in future iterations
This feature would make XcodeBuildMCP significantly more useful for code exploration and debugging workflows, directly addressing @Lanadya's use case and many similar scenarios.