Refactor server.py to MCP Components#53
Open
adarshdigievo wants to merge 5 commits into
Open
Conversation
Adds engine-specific interactive UI for google_jobs via the search_dashboard tool. When engine=google_jobs, the dashboard auto-dispatches to a dedicated jobs view featuring: - Metrics row: jobs found, with salary (%), remote (%), query - Schedule type PieChart (Full-time vs Contract vs Part-time breakdown) - Sortable jobs table (title, company, location, salary, type, posted, benefits) - Click-to-expand detail card with salary/schedule/remote badges, description snippet, and link to full listing Registers google_jobs in ENGINE_APP_BUILDERS alongside google_flights.
Adds engine-specific interactive UI for google_shopping via the search_dashboard tool. When engine=google_shopping, the dashboard auto-dispatches to a dedicated shopping view featuring: - Metrics row: products found, price range, items on sale, avg rating - Horizontal BarChart: top 10 cheapest sellers for price comparison - Sortable products table (product, seller, price, was-price, discount, rating, reviews) - Click-to-expand detail card with discount badge, old price, snippet, Google Shopping link Registers google_shopping in ENGINE_APP_BUILDERS alongside flights and jobs.
Previously both dashboards hardcoded $ for price formatting. Now: - Flights: reads search_parameters.currency (e.g. "INR") and maps to the correct symbol (₹) via a lookup table. Falls back to USD/$ when not specified. - Shopping: extracts the currency prefix from the first result's price string (e.g. "₹6,999" → "₹") since shopping doesn't return a currency code in search_parameters. Adds _currency_symbol(), _fmt_price(), _extract_currency_prefix() helpers shared across engine builders.
vm-serpapi
approved these changes
Jun 23, 2026
vm-serpapi
left a comment
Member
There was a problem hiding this comment.
Good work @adarshdigievo, the refactoring works fine an is sound. Approving with a few comments to address before merge:
- Rebase on main and resolve merge conflicts.
- In tests you use private
_rootattributes, I think it's better to use public APIs likelist_tools()there, it's better for consistency. - Would be good to add empty
__init__.pyto mcp_components dir so it's treated as a python module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
server.pyinto dedicated component files.FileSystemProviderto discover MCP components fromsrc/mcp_components/- MCP tools, resources, and MCP apps now have dedicated files.__init__.pyfiles that are no longer needed with the current import/discovery setup.