GeneratorsFree

MCP Client SDK Generator

Generate ready-to-use client SDKs in TypeScript, Python, or Go to interact with your WebMCP-enabled site. Handles manifest discovery and tool execution logic automatically.

Input

/**
 * WebMCP Client SDK for MyWebMCPClient
 * Generated by WebMCPTools.io
 */

export class MyWebMCPClient {
  private baseUrl: string;

  constructor(baseUrl: string = "https://api.example.com") {
    this.baseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
  }

  /**
   * Fetch the WebMCP manifest
   */
  async getManifest() {
    const response = await fetch(`${this.baseUrl}/.well-known/mcp.json`);
    if (!response.ok) throw new Error(`Failed to fetch manifest: ${response.statusText}`);
    return await response.json();
  }

  /**
   * Execute a WebMCP tool
   */
  async callTool(toolName: string, args: any) {
    const manifest = await this.getManifest();
    const tool = manifest.tools.find((t: any) => t.name === toolName);
    
    if (!tool) throw new Error(`Tool "${toolName}" not found in manifest`);
    
    const response = await fetch(`${this.baseUrl}${tool.endpoint}`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(args),
    });

    if (!response.ok) throw new Error(`Tool execution failed: ${response.statusText}`);
    return await response.json();
  }
}

About MCP Client SDK Generator

The MCP Client SDK Generator is a specialized tool designed for WebMCP developers to generate lightweight client sdks for your webmcp implementation.. As the Web Model Context Protocol (WebMCP) continues to evolve as a W3C draft specification, having reliable diagnostic and generation tools is essential for building AI-ready websites.

How to use this tool

  1. Provide the required input (URL, JSON, or form data) in the input section above.
  2. Click the primary action button to process your request.
  3. Review the results, scores, and recommendations provided by the tool.
  4. Download or share your results for documentation or team collaboration.

Why WebMCP matters

WebMCP allows websites to expose structured tools directly to AI agents. By implementing WebMCP, you enable AI models like Claude, GPT-4, and Gemini to interact with your site's data and functionality in a secure, structured way, moving beyond simple web scraping to true agentic integration.