Skip to content

feat(mcp): add Parallel search setup and fix structured tool inputs - #861

Open
georgeatparallel wants to merge 2 commits into
Cinnamon:mainfrom
georgeatparallel:feat/parallel-search-mcp
Open

georgeatparallel wants to merge 2 commits into
Cinnamon:mainfrom
georgeatparallel:feat/parallel-search-mcp

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Sep 5, 2026

Copy link
Copy Markdown

Description

Adds a Parallel Search MCP setup example to Basic Usage, using the existing mcp-remote stdio path. Users can select public web search and page fetching for ReAct or ReWOO without a Parallel account or API key.

When someone uses @WebSearch, Kotaemon chooses Tavily as its default backend and calls its advanced mode. In Artificial Analysis's August 31 results, Parallel advanced scored 74.8 vs. 65.6 for Tavily basic on the Search Index. The gap on BrowseComp was bigger: 76.5% vs. 58.5%, an 18-point lead.

AA tested Tavily basic, while Kotaemon uses advanced, so these aren't scores for the exact setup here. They're API benchmark results from AA's fixed agent harness, not a test of Kotaemon or this MCP path. I'd consider testing Parallel as the default @WebSearch backend too if answer quality is the priority. This PR adds the optional MCP path; it doesn't change that default.

The setup exposed four gaps in the MCP support added in #813:

  • Agent JSON inputs were validated as a single string before decoding, so tools with multiple required fields or array arguments failed before invocation. Decode JSON objects at the MCP input boundary, keeping schema validation and plain-string handling.
  • Both pipeline builders removed enabled_tools from the cached server configuration. Loading a search-only server twice could enable fetching on the second load. Read the allowlist without changing it.
  • Both agents build their tool prompts from descriptions. Include each discovered input schema in the description so the agents can see required fields and argument types.
  • Nullable anyOf fields were treated as strings. Preserve the underlying type and required/optional presence rules so fields such as fetch search_queries accept arrays or null and still reject invalid values.

Existing defaults and non-MCP tools are unchanged. The guide explains selection, disabling, rate limits, and that queries, URLs, and supplied context go to Parallel when the agent uses these tools. I work at Parallel, which operates this service.

Validation: 64 focused checks passed at 20f330f, using an isolated source-loading harness. These cover MCP inputs, nullable fields, discovery, configuration management, and repeated selection. Separate checks exercised both prompt composers and deterministic ReAct/ReWOO tool dispatch. The documented JSON passed through the actual Add/Save handlers, a temporary SQLite database, reload, and both source pipeline-selection methods. Anonymous search and fetch succeeded through the selected MCPTool and mcp-remote 0.8.3. Black 22.3.0, isort 5.12.0, and flake8 7.0.0 checks passed; whitespace checks passed with the existing CRLF line endings recognized. The unchanged guide retains its prior Prettier 2.7.1 validation. GitHub CI awaits maintainer approval; no passing CI result is claimed.

The harness uses real MCP, tool, and database code while substituting unrelated UI and LLM construction. The full application, rendered UI, LLM-generated tool choices, repository builds, and full test suites were not run.

Type of change

  • New features (non-breaking change).
  • Bug fix (non-breaking change).
  • Breaking change (fix or feature that would cause existing functionality not to work as expected).

Checklist

  • I have performed a self-review of my code.
  • I have added thorough tests if it is a core feature.
  • There is a reference to the original bug report and related work.
  • I have commented on my code, particularly in hard-to-understand areas.
  • The feature is well documented.

@georgeatparallel
georgeatparallel marked this pull request as ready for review September 5, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant