Skip to main content
Best for: building Valyu into your product / agents. Add Valyu search tools to agents built on the Claude Agent SDK. This is a community-maintained integration by GhouI - for official integrations, see Vercel AI SDK or the Valyu API directly.
Domain-specific Valyu search tools exposed to the Claude Agent SDK over the Model Context Protocol (MCP), so your agents can search academic papers, financial data, patents, and more.

Paste into your AI assistant to wire Valyu search tools into a Claude Agent SDK project.

Open in Cursor
The integration includes search tools for:
  • Web Search: Real-time information, news, and current events
  • Finance Search: Stock prices, earnings reports, SEC filings, and financial metrics
  • Paper Search: Academic research from arXiv and scholarly databases
  • Bio Search: Biomedical literature, PubMed articles, and clinical trials
  • Patent Search: Patent databases and prior art research
  • SEC Search: Regulatory documents (10-K, 10-Q, 8-K filings)
  • Economics Search: Labor statistics, Federal Reserve data, World Bank indicators
  • Company Research: Comprehensive intelligence reports with synthesized data

Installation

Clone the community-maintained repository and install dependencies:
git clone https://github.com/GhouI/valyu-claude-agent-sdk.git
cd valyu-claude-agent-sdk
npm install --legacy-peer-deps
yarn install --legacy-peer-deps
pnpm install --legacy-peer-deps
The --legacy-peer-deps flag is required due to Zod version compatibility requirements.
Configure credentials by adding your Valyu API key to a .env file:
VALYU_API_KEY=your-valyu-api-key-here
The package automatically reads this environment variable.

Free Credits

Get your API key with $10 free credits ($20 with a work email) from the Valyu Platform.

Basic Usage

Web Search Example

Search for real-time information, news, and current events:
import { query } from "@anthropic-ai/claude-agent-sdk";
import { valyuWebSearchServer } from "./tools/index.js";

async function webSearchExample() {
  for await (const message of query({
    prompt: "What are the latest developments in AI technology?",
    options: {
      model: "claude-sonnet-4-5",
      allowedTools: ["mcp__valyu-web-search__web_search"],
      mcpServers: {
        "valyu-web-search": valyuWebSearchServer,
      },
    },
  })) {
    if (message.type === "assistant") {
      const textContent = message.content
        .filter((block) => block.type === "text")
        .map((block) => block.text)
        .join("\n");
      console.log(textContent);
    }
  }
}

await webSearchExample();
Every tool follows the same shape - import its server, list it in allowedTools, register it under mcpServers. Route each query to the most specific tool.

Available tools

ToolServer importallowedTools id
WebvalyuWebSearchServermcp__valyu-web-search__web_search
FinancevalyuFinanceSearchServermcp__valyu-finance-search__finance_search
PapervalyuPaperSearchServermcp__valyu-paper-search__paper_search
BiovalyuBioSearchServermcp__valyu-bio-search__bio_search
PatentvalyuPatentSearchServermcp__valyu-patent-search__patent_search
SECvalyuSecSearchServermcp__valyu-sec-search__sec_search
EconomicsvalyuEconomicsSearchServermcp__valyu-economics-search__economics_search
Company researchvalyuCompanyResearchServermcp__valyu-company-research__company_research

Combine multiple tools

Register several servers so the agent can choose between them:
import { query } from "@anthropic-ai/claude-agent-sdk";
import {
  valyuWebSearchServer,
  valyuFinanceSearchServer,
  valyuCompanyResearchServer,
} from "./tools/index.js";

for await (const message of query({
  prompt: "Analyze Nvidia's market position and competitive landscape",
  options: {
    model: "claude-sonnet-4-5",
    allowedTools: [
      "mcp__valyu-web-search__web_search",
      "mcp__valyu-finance-search__finance_search",
      "mcp__valyu-company-research__company_research",
    ],
    mcpServers: {
      "valyu-web-search": valyuWebSearchServer,
      "valyu-finance-search": valyuFinanceSearchServer,
      "valyu-company-research": valyuCompanyResearchServer,
    },
  },
})) {
  // handle messages
}
createBioSearchServer() (and the equivalents for other tools) accept:
  • searchType - "proprietary" or "web" (default "proprietary")
  • maxNumResults - default 10
  • includedSources - e.g. ["pubmed", "clinicaltrials.gov"]
  • maxPrice - max cost per query, CPM (default 30.0)
  • relevanceThreshold - 0.0-1.0 (default 0.5)
  • category - focus area, e.g. "biomedical"
const customServer = createBioSearchServer({
  includedSources: ["pubmed", "clinicaltrials.gov"],
  maxNumResults: 10,
  relevanceThreshold: 0.7,
});

Additional Resources

GitHub Repository

Community-maintained Claude Agent SDK integration source code

API Reference

Complete Valyu API documentation

Claude Agent SDK

Official Anthropic Claude Agent SDK

Get API Key

Sign up for $10 free credits ($20 with a work email)

Support

This is a community-maintained integration. For issues or contributions: