Skip to content

Add an opt-in Parallel Search MCP example - #29

Merged
Telli merged 2 commits into
clawdotnet:mainfrom
georgeatparallel:parallel-search-a6058b56-4116-40b1-80a7-86f195a3bbf0
Oct 7, 2026
Merged

Telli merged 2 commits into
clawdotnet:mainfrom
georgeatparallel:parallel-search-a6058b56-4116-40b1-80a7-86f195a3bbf0

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in Parallel Search MCP command to McpToolAgent for web search and page extraction without a Parallel API key or model provider key. For example:

dotnet run --project examples/McpToolAgent --configuration Release -- --parallel-search search "C# CancellationToken documentation"
dotnet run --project examples/McpToolAgent --configuration Release -- --parallel-search fetch https://learn.microsoft.com/en-us/dotnet/standard/threading/cancellation-in-managed-threads

The example discovers the tool schema through the official SDK's Streamable HTTP transport and executes the selected tool through SharpClaw's registry and permission layer. It runs tools directly; it does not add agent-loop MCP dispatch. The anonymous endpoint is free for light use and subject to rate limits.

Validation

  • dotnet build SharpClawCode.sln --configuration Release --warnaserror
  • dotnet test SharpClawCode.sln --configuration Release
  • Relevant package, CLI, MCP, plugin, and cross-platform checks were run

Live search returned Microsoft documentation with source URLs and excerpts, and fetch returned the cancellation guide. The documented installation and both commands also worked with an isolated user profile and no provider credentials. Four fixture tests check the endpoint and project User-Agent on discovery and tool calls, anonymous headers, allowlist denial before remote execution, and remote error propagation. The four example hosts build, and the package smoke script passes on Linux. Windows and macOS checks remain for CI.

Risk and compatibility

  • Durable JSON/session formats remain compatible or include a migration
  • Dangerous file, shell, and network operations still pass through permissions
  • No credentials, local state, or generated secrets are included

The echo example remains the default. Built-in web tools, model provider selection, and workspace MCP registrations are unchanged. Calls accept cancellation and have a 60-second command timeout.

Btw - I'm a devrel engineer at Parallel

Summary by CodeRabbit

  • New Features
    • Added an opt-in example for searching the web and fetching public page content without a model provider key. Search results include URLs and excerpts; fetches return extracted content.
    • Commands use read-only permissions, support cancellation, and report errors with a failing exit code. The existing example behavior remains unchanged unless the search option is used.
  • Documentation
    • Added instructions for running the search and fetch commands, including usage and permission details.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03c1e97a-4250-4d6f-af52-b71681e52ecb
📥 Commits

Reviewing files that changed from the base of the PR and between 9b649bf and 15a8162.

📒 Files selected for processing (1)
  • examples/McpToolAgent/Program.cs
 __________________________________________________________________________
< Your code is like a magic trick: now you see it... now it's `undefined`. >
 --------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00dec3ca-e6be-41a4-aca4-73bff39b7c0b
📥 Commits

Reviewing files that changed from the base of the PR and between 0e4652e and 9b649bf.

📒 Files selected for processing (7)
  • README.md
  • docs/mcp.md
  • examples/McpToolAgent/McpToolAgent.csproj
  • examples/McpToolAgent/ParallelSearchExample.cs
  • examples/McpToolAgent/Program.cs
  • tests/SharpClaw.Code.UnitTests/Mcp/ParallelSearchExampleTests.cs
  • tests/SharpClaw.Code.UnitTests/SharpClaw.Code.UnitTests.csproj

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The McpToolAgent example adds optional commands for anonymous Parallel Search MCP search and page fetch. It discovers and executes remote tools through SharpClaw’s permission-aware executor. Tests and documentation cover the commands and their behavior.

Changes

Parallel Search MCP example

Layer / File(s) Summary
Discover and execute remote tools
examples/McpToolAgent/McpToolAgent.csproj, examples/McpToolAgent/ParallelSearchExample.cs, tests/SharpClaw.Code.UnitTests/Mcp/*, tests/SharpClaw.Code.UnitTests/SharpClaw.Code.UnitTests.csproj
The example discovers remote tool schemas, registers an adapter, and executes calls through SharpClaw’s permission-aware executor. Tests cover successful calls, allowlist denial, and remote errors.
Expose search and fetch commands
examples/McpToolAgent/Program.cs, docs/mcp.md, README.md
The --parallel-search path validates search or fetch arguments, creates a read-only tool context, handles cancellation and timeouts, and reports results through exit codes. Documentation describes the commands and their behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Program
  participant ParallelSearchExample
  participant ParallelSearchMCP
  participant ToolExecutor
  Program->>ParallelSearchExample: ExecuteAsync with tool name and arguments
  ParallelSearchExample->>ParallelSearchMCP: Initialize connection and discover tool schema
  ParallelSearchExample->>ToolExecutor: Register and execute the remote tool with permissions
  ToolExecutor->>ParallelSearchMCP: Call the selected remote tool
  ParallelSearchMCP-->>ToolExecutor: Return tool response
  ToolExecutor-->>Program: Return execution result
Loading

Suggested reviewers: telli

Merge Risk: ⚪ Minimal · up to 9b649

The opt-in search and fetch commands appear ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the opt-in Parallel Search MCP example, which is the main change.
Description check ✅ Passed The description covers the user-visible change, validation results, and compatibility risks. It includes all required template sections and notes that Windows and macOS checks remain for CI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Telli
Telli force-pushed the parallel-search-a6058b56-4116-40b1-80a7-86f195a3bbf0 branch from 9b649bf to 15a8162 Compare October 7, 2026 03:05
@Telli
Telli merged commit 6d25488 into clawdotnet:main Oct 7, 2026
8 of 9 checks passed
@f-o-x11 f-o-x11 mentioned this pull request Oct 26, 2026
6 tasks done
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.

2 participants