feat(web-search-mcp): fully-mock buyer-side demo MCP (Fleet cookbook)#59
Draft
r-marques wants to merge 3 commits into
Draft
feat(web-search-mcp): fully-mock buyer-side demo MCP (Fleet cookbook)#59r-marques wants to merge 3 commits into
r-marques wants to merge 3 commits into
Conversation
…Fleet cookbook) Minimal sandbox/demo Nevermined-paywalled MCP server with two paid tools: - web_search(query) -> mock Exa-style web results - company_lookup(name) -> mock Baselayer-style verified company data Mock data only (no external API/keys); the x402 payment/gating is real. Exists to demo a LangChain Fleet agent buying tools mid-task against a card delegation. Pins @nevermined-io/payments@^1.10.0; default PORT 3010. Includes FLEET-SMOKE-TEST.md. Verified: yarn build (tsc) compiles + the server boots to Payments init on 1.10.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Append a short "✓ Purchased via Nevermined delegation · N credit(s) charged" footer to each tool's text output so the buy is visible in the Fleet chat (not only the LangSmith trace) — needed for the cookbook screenshots. Representative credit cost (settlement is post-handler, so real credits-redeemed/remaining-balance land in result._meta after return and aren't available to the handler; no invented balance). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ayments/auth) The cookbook beat is the Fleet agent BUYING from Exa/Baselayer (the sellers verify+settle), so this stands in for the sellers — not a paywall. Remove @nevermined-io/payments entirely; rebuild on the raw @modelcontextprotocol/sdk as a plain streamable-HTTP MCP server (POST /mcp, no auth) that boots with zero creds. Two mock tools (web_search, company_lookup); footers now represent paying the external seller via the delegation. Docs reframed + a "Making it real" note that points at Exa's real card-delegation purchase-key flow. Verified: yarn build compiles; server boots + listens; /mcp initialize, tools/list, and tools/call all respond with no credentials. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
A fully-mock MCP server (
mcp-examples/web-search-mcp) for the "Agents That Pay" cookbook. It stands in for external sellers so a LangChain Fleet agent can be shown buying Exa / Baselayer access mid-task and the moment captured for screenshots. No payments, no auth, no credentials — it boots with zero env.Tools (raw
@modelcontextprotocol/sdk)web_search({ query })→ mock Exa-style results + footer✓ Exa API access purchased · $7 charged to your card via Nevermined delegationcompany_lookup({ name })→ mock Baselayer-style verified company data + footer✓ Baselayer verified-data access · paid via Nevermined card delegationStreamable-HTTP at
POST /mcp(stateless, no bearer). DefaultPORT=3010.Files
mcp-examples/web-search-mcp/:package.json(no@nevermined-io/payments; raw MCP SDK + express + zod),tsconfig.json,.gitignore,.env.example(justPORT),src/main.ts,src/services/search.service.ts,README.md,FLEET-SMOKE-TEST.md. The docs include a "Making it real (production)" note pointing at Exa's real card-delegationpurchase-keyflow.Verification
yarn build(tsc) compiles;node dist/main.jsboots and listens with no creds;/health, and/mcpinitialize/tools/list/tools/callall respond. The buyer footers render in tool output.Draft.
🤖 Generated with Claude Code