ydc-claude-agent-sdk-integration

1
0
Source

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.

Install

mkdir -p .claude/skills/ydc-claude-agent-sdk-integration && curl -L -o skill.zip "https://mcp.directory/api/skills/download/8824" && unzip -o skill.zip -d .claude/skills/ydc-claude-agent-sdk-integration && rm skill.zip

Installs to .claude/skills/ydc-claude-agent-sdk-integration

About this skill

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?
  2. 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
  3. Install Package

    • Python: pip install claude-agent-sdk
    • TypeScript: npm install @anthropic-ai/claude-agent-sdk
  4. Ask: Environment Variables

  5. 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)
  6. 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"\n[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(`\n[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(`\n[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:

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

**TypeScri


Content truncated.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,4071,302

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,2201,024

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

9001,013

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

958658

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

970608

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,033496

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.