feat(examples): add with-iflow-search-mcp example#1312
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR introduces a new complete example demonstrating how to integrate the iFlow Search MCP (Model Context Protocol) server with VoltAgent. The example includes documentation, project scaffolding, and a working implementation that wires an MCP stdio server into an agent configured for web search, image search, and page fetch capabilities. ChangesiFlow Search MCP Example Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/with-iflow-search-mcp/README.md`:
- Around line 110-112: The README's statement that "The MCP server process reads
IFLOW_API_KEY from its own environment only. It never touches the filesystem and
never reads `~/.npmrc`, dotfiles, or keychains." is incorrect about npm/npx;
update this wording to: explain that the MCP server reads IFLOW_API_KEY from its
environment and does not itself read or write credential files, but note that
tools invoked via npm/npx may load npm configuration from standard locations
(including `~/.npmrc`, user dotfiles, or keychains) before executing packages,
so users should not rely on npm/npx isolation guarantees and must keep `.env`
out of version control; change the sentence referencing "never reads `~/.npmrc`"
to this clarified statement.
In `@examples/with-iflow-search-mcp/src/index.ts`:
- Around line 16-19: Ensure the app fails fast when IFLOW_API_KEY is missing by
validating process.env.IFLOW_API_KEY before building the env object (the code
that sets IFLOW_API_KEY: process.env.IFLOW_API_KEY ?? ""). If the value is
undefined or empty, throw a clear Error (or call process.exit with a descriptive
message) at startup so the MCP child never receives an empty key; update the
startup logic that creates the env map (where IFLOW_API_KEY is assigned) to
perform this check and use the validated value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1edbf9ee-1fed-4ff1-b926-c7345921fe1c
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
examples/README.mdexamples/with-iflow-search-mcp/.env.exampleexamples/with-iflow-search-mcp/.gitignoreexamples/with-iflow-search-mcp/README.mdexamples/with-iflow-search-mcp/package.jsonexamples/with-iflow-search-mcp/src/index.tsexamples/with-iflow-search-mcp/tsconfig.json
There was a problem hiding this comment.
2 issues found across 8 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
Adds a runnable example wiring
@iflow-ai/search-mcpinto VoltAgent viaMCPConfiguration, following the existingexamples/with-mcppattern.npx -y @iflow-ai/search-mcp(no new runtime dependency added to VoltAgent itself).iflow-search_iflow_web_search.IFLOW_MCP_CLIENT=voltagentso iFlow's analytics can distinguish traffic from this host.Security
.env.exampleships withYOUR_OPENAI_API_KEY/YOUR_IFLOW_API_KEYplaceholders only, and.envis git-ignored.IFLOW_API_KEYfromprocess.envand forwards it to the spawned MCP child.Test plan
Verified locally on this branch:
pnpm biome check examples/with-iflow-search-mcp/— clean, no fixes appliednpx prettier --check examples/with-iflow-search-mcp/**/*.{ts,tsx,md,json}— all cleannpx prettier --check examples/README.md— cleanpnpm --filter "voltagent-example-with-iflow-search-mcp^..." build— exit 0pnpm exec tsc --noEmitfrom the example dir — exit 0pnpm run buildfrom the example dir — exit 0 (emitsdist/index.js)tools/listreturned the 3 prefixed iFlow tools (iflow-search_iflow_web_search,iflow-search_iflow_image_search,iflow-search_iflow_web_fetch), oneweb_searchinvocation returned items.iflow-search_iflow_web_searchand produced a final answer. Smoke used DeepSeek as the LLM provider (viaDEEPSEEK_API_KEYfrom environment) and iFlow Search (viaIFLOW_API_KEYfrom environment). DeepSeek was used only for the local smoke — it is not a dependency of the example; the committedsrc/index.tsstill referencesopenai/gpt-4o-miniper the established example convention.🤖 Generated with Claude Code
Summary by cubic
Adds a runnable example that integrates
@iflow-ai/search-mcpwith VoltAgent viaMCPConfiguration. It provides web search, image search, and single-page fetch tools without new core runtime deps, and now validatesIFLOW_API_KEYat startup.New Features
examples/with-iflow-search-mcp, spawning the MCP server vianpx -y @iflow-ai/search-mcp.iflow-search_iflow_web_search,iflow-search_iflow_image_search,iflow-search_iflow_web_fetch.IFLOW_API_KEYto the MCP child and tags traffic withIFLOW_MCP_CLIENT=voltagent..env.example, and links it fromexamples/README.md.Bug Fixes
IFLOW_API_KEYis missing, with a clear startup error.Written for commit e5a612c. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
New Features
Documentation
Chores