Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

ydc-claude-agent-sdk-integrationYDC Claude Agent SDK 集成

Agent Skill

ydc-claude-agent-sdk-integration 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

59,927

周安装

2,448

GitHub Stars

1

下载量

19,192
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ydc-claude-agent-sdk-integration(YDC Claude Agent SDK 集成)
来源仓库:https://github.com/edwardirby/ydc-claude-agent-sdk-integration
安装命令:
openclaw skills install ydc-claude-agent-sdk-integration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install ydc-claude-agent-sdk-integration

简介

将 Claude Agent SDK 与适用于 Python 和 TypeScript 的 You.com HTTP MCP 服务器集成。当开发人员提及 Claude Agent SDK、Anthropic Agent SDK 或将 Claude 与 MCP 工具集成时使用。

SKILL.md

name
ydc-claude-agent-sdk-integration
description
Integrate Claude Agent SDK with You.com HTTP MCP server for Python and TypeScript. Use when developer mentions Claude Agent SDK, Anthropic Agent SDK, or integrating Claude with MCP tools.
license
MIT
compatibility
Python 3.10+ or TypeScript 5.2+ (for v2), Node.js 18+
metadata
author
youdotcom-oss
category
sdk-integration
version
1.0.0
keywords
claude,anthropic,claude-agent-sdk,agent-sdk,mcp,you.com,integration,http-mcp,web-search,python,typescript

Integrate Claude Agent SDK with You.com MCP

Interactive workflow to set up Claude Agent SDK with You.com's HTTP MCP server.

Workflow

  1. Ask: Language Choice

* Python or TypeScript?

  1. If TypeScript - Ask: SDK Version

* v1 (stable, generator-based) or v2 (preview, send/receive pattern)? * Note: v2 requires TypeScript 5.2+ for await using support

  1. Install Package

* Python: pip install claude-agent-sdk * TypeScript: npm install @anthropic-ai/claude-agent-sdk

  1. Ask: Environment Variables

* Using standard YDC_API_KEY and ANTHROPIC_API_KEY? * Or custom names? * Have they set them? * If NO: Guide to get keys: - YDC_API_KEY: https://you.com/platform/api-keys - ANTHROPIC_API_KEY: https://console.anthropic.com/settings/keys

  1. Ask: File Location

* NEW file: Ask where to create and what to name * EXISTING file: Ask which file to integrate into (add HTTP MCP config)

  1. Create/Update File

For NEW files: * Use the complete template code from the "Complete Templates" section below * User can run immediately with their API keys set

For EXISTING files: * Add HTTP MCP server configuration to their existing code * Python configuration block:

     from claude_agent_sdk import query, ClaudeAgentOptions

     options = ClaudeAgentOptions(
         mcp_servers={
             "ydc": {
                 "type": "http",
                 "url": "https://api.you.com/mcp",
                 "headers": {
                     "Authorization": f"Bearer {os.getenv('YDC_API_KEY')}"
                 }
             }
         },
         allowed_tools=[
             "mcp__ydc__you_search",
             "mcp__ydc__you_express",
             "mcp__ydc__you_contents"
         ]
     )

* TypeScript configuration block:

     const options = {
       mcpServers: {
         ydc: {
           type: 'http' as const,
           url: 'https://api.you.com/mcp',
           headers: {
             Authorization: `Bearer ${process.env.YDC_API_KEY}`
           }
         }
       },
       allowedTools: [
         'mcp__ydc__you_search',
         'mcp__ydc__you_express',
         'mcp__ydc__you_contents'
       ]
     };

Complete Templates

Use these complete templates for new files. Each template is ready to run with your API keys set.

Python Template (Complete Example)

"""
Claude Agent SDK with You.com HTTP MCP Server
Python implementation with async/await pattern
"""

import os
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions

# Validate environment variables
ydc_api_key = os.getenv("YDC_API_KEY")
anthropic_api_key = os.getenv("ANTHROPIC_API_KEY")

if not ydc_api_key:
    raise ValueError(
        "YDC_API_KEY environment variable is required. "
        "Get your key at: https://you.com/platform/api-keys"
    )

if not anthropic_api_key:
    raise ValueError(
        "ANTHROPIC_API_KEY environment variable is required. "
        "Get your key at: https://console.anthropic.com/settings/keys"
    )


async def main():
    """
    Example: Search for AI news and get results from You.com MCP server
    """
    # Configure Claude Agent with HTTP MCP server
    options = ClaudeAgentOptions(
        mcp_servers={
            "ydc": {
                "type": "http",
                "url": "https://api.you.com/mcp",
                "headers": {"Authorization": f"Bearer {ydc_api_key}"},
            }
        },
        allowed_tools=[
            "mcp__ydc__you_search",
            "mcp__ydc__you_express",
            "mcp__ydc__you_contents",
        ],
        model="claude-sonnet-4-5-20250929",
    )

    # Query Claude with MCP tools available
    async for message in query(
        prompt="Search for the latest AI news from this week",
        options=options,
    ):
        # Handle different message types
        if message.type == "text":
            print(message.content)
        elif message.type == "tool_use":
            print(f"\
[Tool: {message.name}]")
            print(f"Input: {message.input}")
        elif message.type == "tool_result":
            print(f"Result: {message.content}")


if __name__ == "__main__":
    asyncio.run(main())

TypeScript v1 Template (Complete Example)

/**
 * Claude Agent SDK with You.com HTTP MCP Server
 * TypeScript v1 implementation with generator-based pattern
 */

import { query } from '@anthropic-ai/claude-agent-sdk';

// Validate environment variables
const ydcApiKey = process.env.YDC_API_KEY;
const anthropicApiKey = process.env.ANTHROPIC_API_KEY;

if (!ydcApiKey) {
  throw new Error(
    'YDC_API_KEY environment variable is required. ' +
      'Get your key at: https://you.com/platform/api-keys'
  );
}

if (!anthropicApiKey) {
  throw new Error(
    'ANTHROPIC_API_KEY environment variable is required. ' +
      'Get your key at: https://console.anthropic.com/settings/keys'
  );
}

/**
 * Example: Search for AI news and get results from You.com MCP server
 */
async function main() {
  // Query Claude with HTTP MCP configuration
  const result = query({
    prompt: 'Search for the latest AI news from this week',
    options: {
      mcpServers: {
        ydc: {
          type: 'http' as const,
          url: 'https://api.you.com/mcp',
          headers: {
            Authorization: `Bearer ${ydcApiKey}`,
          },
        },
      },
      allowedTools: [
        'mcp__ydc__you_search',
        'mcp__ydc__you_express',
        'mcp__ydc__you_contents',
      ],
      model: 'claude-sonnet-4-5-20250929',
    },
  });

  // Process messages as they arrive
  for await (const msg of result) {
    if (msg.type === 'text') {
      console.log(msg.content);
    } else if (msg.type === 'tool_use') {
      console.log(`\
[Tool: ${msg.name}]`);
      console.log(`Input: ${JSON.stringify(msg.input, null, 2)}`);
    } else if (msg.type === 'tool_result') {
      console.log(`Result: ${msg.content}`);
    }
  }
}

main().catch(console.error);

TypeScript v2 Template (Complete Example)

/**
 * Claude Agent SDK with You.com HTTP MCP Server
 * TypeScript v2 implementation with send/receive pattern
 * Requires TypeScript 5.2+ for 'await using' support
 */

import { unstable_v2_createSession } from '@anthropic-ai/claude-agent-sdk';

// Validate environment variables
const ydcApiKey = process.env.YDC_API_KEY;
const anthropicApiKey = process.env.ANTHROPIC_API_KEY;

if (!ydcApiKey) {
  throw new Error(
    'YDC_API_KEY environment variable is required. ' +
      'Get your key at: https://you.com/platform/api-keys'
  );
}

if (!anthropicApiKey) {
  throw new Error(
    'ANTHROPIC_API_KEY environment variable is required. ' +
      'Get your key at: https://console.anthropic.com/settings/keys'
  );
}

/**
 * Example: Search for AI news and get results from You.com MCP server
 */
async function main() {
  // Create session with HTTP MCP configuration
  // 'await using' ensures automatic cleanup when scope exits
  await using session = unstable_v2_createSession({
    mcpServers: {
      ydc: {
        type: 'http' as const,
        url: 'https://api.you.com/mcp',
        headers: {
          Authorization: `Bearer ${ydcApiKey}`,
        },
      },
    },
    allowedTools: [
      'mcp__ydc__you_search',
      'mcp__ydc__you_express',
      'mcp__ydc__you_contents',
    ],
    model: 'claude-sonnet-4-5-20250929',
  });

  // Send message to Claude
  await session.send('Search for the latest AI news from this week');

  // Receive and process messages
  for await (const msg of session.receive()) {
    if (msg.type === 'text') {
      console.log(msg.content);
    } else if (msg.type === 'tool_use') {
      console.log(`\
[Tool: ${msg.name}]`);
      console.log(`Input: ${JSON.stringify(msg.input, null, 2)}`);
    } else if (msg.type === 'tool_result') {
      console.log(`Result: ${msg.content}`);
    }
  }
}

main().catch(console.error);

HTTP MCP Server Configuration

All templates use You.com's HTTP MCP server for simplicity:

Python:

mcp_servers={
    "ydc": {
        "type": "http",
        "url": "https://api.you.com/mcp",
        "headers": {
            "Authorization": f"Bearer {ydc_api_key}"
        }
    }
}

TypeScript:

mcpServers: {
  ydc: {
    type: 'http' as const,
    url: 'https://api.you.com/mcp',
    headers: {
      Authorization: `Bearer ${ydcApiKey}`
    }
  }
}

Benefits of HTTP MCP:

  • ✅ No local installation required
  • ✅ Stateless request/response model
  • ✅ Always up-to-date with latest version
  • ✅ Consistent across all environments
  • ✅ Production-ready and scalable
  • ✅ Works with existing HTTP infrastructure

Available You.com Tools

After configuration, Claude can discover and use:

  • mcp__ydc__you_search - Web and news search
  • mcp__ydc__you_express - AI-powered answers with web context
  • mcp__ydc__you_contents - Web page content extraction

Environment Variables

Both API keys are required:

# Add to your .env file or shell profile
export YDC_API_KEY="your-you-api-key-here"
export ANTHROPIC_API_KEY="your-anthropic-api-key-here"

Get your API keys:

  • You.com: https://you.com/platform/api-keys
  • Anthropic: https://console.anthropic.com/settings/keys

Validation Checklist

Before completing:

  • [ ] Package installed: claude-agent-sdk (Python) or @anthropic-ai/claude-agent-sdk (TypeScript)
  • [ ] Environment variables set: YDC_API_KEY and ANTHROPIC_API_KEY
  • [ ] Template copied or configuration added to existing file
  • [ ] HTTP MCP server configured (https://api.you.com/mcp)
  • [ ] Authorization header includes Bearer ${YDC_API_KEY}
  • [ ] Allowed tools list includes You.com tools
  • [ ] File is executable (Python) or can be compiled (TypeScript)
  • [ ] Ready to test with example query

Testing Your Integration

Python:

python your-file.py

TypeScript:

# With tsx (recommended for quick testing)
npx tsx your-file.ts

# Or compile and run
tsc your-file.ts && node your-file.js

Common Issues

<details> <summary><strong>Cannot find module @anthropic-ai/claude-agent-sdk</strong></summary>

Install the package:

# NPM
npm install @anthropic-ai/claude-agent-sdk

# Bun
bun add @anthropic-ai/claude-agent-sdk

# Yarn
yarn add @anthropic-ai/claude-agent-sdk

# pnpm
pnpm add @anthropic-ai/claude-agent-sdk

</details>

<details> <summary><strong>YDC_API_KEY environment variable is required</strong></summary>

Set your You.com API key:

export YDC_API_KEY="your-api-key-here"

Get your key at: https://you.com/platform/api-keys

</details>

<details> <summary><strong>ANTHROPIC_API_KEY environment variable is required</strong></summary>

Set your Anthropic API key:

export ANTHROPIC_API_KEY="your-api-key-here"

Get your key at: https://console.anthropic.com/settings/keys

</details>

<details> <summary><strong>MCP connection fails with 401 Unauthorized</strong></summary>

Verify your YDC_API_KEY is valid:

  1. Check the key at https://you.com/platform/api-keys
  2. Ensure no extra spaces or quotes in the environment variable
  3. Verify the Authorization header format: Bearer ${YDC_API_KEY}

</details>

<details> <summary><strong>Tools not available or not being called</strong></summary>

Ensure allowedTools includes the correct tool names:

  • mcp__ydc__you_search (not you_search)
  • mcp__ydc__you_express (not you_express)
  • mcp__ydc__you_contents (not you_contents)

Tool names must include the mcp__ydc__ prefix.

</details>

<details> <summary><strong>TypeScript error: Cannot use 'await using'</strong></summary>

The v2 SDK requires TypeScript 5.2+ for await using syntax.

Solution 1: Update TypeScript

npm install -D typescript@latest

Solution 2: Use manual cleanup

const session = unstable_v2_createSession({ /* options */ });
try {
  await session.send('Your query');
  for await (const msg of session.receive()) {
    // Process messages
  }
} finally {
  session.close();
}

Solution 3: Use v1 SDK instead Choose v1 during setup for broader TypeScript compatibility.

</details>

Additional Resources

  • You.com MCP Server: https://documentation.you.com/developer-resources/mcp-server
  • Claude Agent SDK (Python): https://platform.claude.com/docs/en/agent-sdk/python
  • Claude Agent SDK (TypeScript v1): https://platform.claude.com/docs/en/agent-sdk/typescript
  • Claude Agent SDK (TypeScript v2): https://platform.claude.com/docs/en/agent-sdk/typescript-v2-preview
  • API Keys:

- You.com: https://you.com/platform/api-keys - Anthropic: https://console.anthropic.com/settings/keys

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

77.82%
按下载量换算14,935

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills