Skip to content

feat: add optional You.com search integration - #218

Open
mouse-value-add wants to merge 27 commits into
kerlenton:mainfrom
mouse-value-add:feat/youcom-search-integration
Open

feat: add optional You.com search integration#218
mouse-value-add wants to merge 27 commits into
kerlenton:mainfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

Summary

This PR adds optional You.com web search integration to mcpsnoop, enhancing the MCP debugging workflow by allowing developers to search for error explanations, protocol specifications, and tool documentation directly from the TUI.

What Changed

Core Integration:

  • Added internal/youcom/search.go - You.com API client with search functionality
  • Modified TUI to support web search via keyboard shortcut w and commands :search / :web
  • Added search overlay display consistent with other mcpsnoop panels
  • Graceful error handling when API key is missing or requests fail

Configuration Options:

  • Environment variable: YOUCOM_API_KEY
  • Command flag: --youcom-api-key
  • Config file: youcom-api-key = "key" in .mcpsnoop.toml

User Interface:

  • Press w to open search prompt
  • Commands :search <query> and :web <query>
  • Results display in scrollable overlay
  • Added to help text and hint bar
  • Async search with 10s timeout (doesn't block TUI)

Why This is Useful

When debugging MCP sessions, developers often need to:

  • Research error codes and messages they encounter
  • Look up MCP protocol specifications
  • Find tool documentation or examples
  • Understand server capabilities and behaviors

This integration eliminates context switching - you can search directly from the debugging session without leaving mcpsnoop.

Implementation Notes

  • Completely Optional: mcpsnoop works normally without any API key
  • Clean Architecture: Search client is dependency-injected, easily testable
  • Consistent UX: Follows existing mcpsnoop overlay patterns (capabilities, summary, etc.)
  • Privacy-Conscious: Only search queries sent to You.com, no session data
  • Error Recovery: Clear messaging when search unavailable or fails

Validation

  • All existing functionality preserved (when no API key provided)
  • Search works with valid API key (manual testing with You.com API)
  • Configuration loading works (env var, flag, config file precedence)
  • Help text updated appropriately
  • Code follows existing mcpsnoop patterns and conventions

Resolves: Optional web search capability for enhanced MCP debugging workflow

Tracking: youdotcom-oss/integration-tracking#178

- Add optional web search capability via You.com API
- Keyboard shortcut 'w' opens search prompt
- Command support: :search <query> and :web <query>
- Environment variable (YOUCOM_API_KEY) and flag support
- Configuration file support in .mcpsnoop.toml
- Search results display in overlay consistent with other TUI panels
- Graceful fallback when API key not configured
- Async search with 10s timeout, doesn't block TUI
- Added help text and documentation

Enhances MCP debugging workflow by allowing developers to research
errors, specifications, and tool documentation directly from the TUI
without leaving their debugging session.
shixi-li and others added 26 commits August 16, 2026 00:08
- Add optional web search capability via You.com API
- Keyboard shortcut 'w' opens search prompt
- Command support: :search <query> and :web <query>
- Environment variable (YOUCOM_API_KEY) and flag support
- Configuration file support in .mcpsnoop.toml
- Search results display in overlay consistent with other TUI panels
- Graceful fallback when API key not configured
- Async search with 10s timeout, doesn't block TUI
- Added help text and documentation

Enhances MCP debugging workflow by allowing developers to research
errors, specifications, and tool documentation directly from the TUI
without leaving their debugging session.
…main to resolve conflicts with the metrics hub, edit-replay, and elicitations/interactions work)
@mouse-value-add

Copy link
Copy Markdown
Author

Rebased onto the latest main to clear the conflicts with the metrics hub, edit-replay, and elicitations/interactions changes. Notes on the adaptation:

  • The search client now plugs in through the new tui.Option pattern (WithSearchClient) instead of a separate constructor, so the default New(st) call sites are untouched.
  • runHub keeps the --metrics-listen headless path; the You.com key is threaded alongside it and the flag falls back to YOUCOM_API_KEY.
  • Added w alongside the new R/l/i bindings in the help overlay.
  • A bare :search/:web without a query still falls back to the session-name jump, so sessions named e.g. "search-api" behave as before.

Everything stays opt-in — no key configured means the w binding just flashes "web search not configured". go build, go vet, and the test suite pass (only pre-existing TestEditorValueThatNeedsAShellIsRefusedByName fails locally for me, unrelated — it needs vim on PATH).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants