Skip to main content
The create command is the core of MCPKit. It analyzes a website and generates a complete MCP server with tools for interacting with that site.

Usage

mcpkit create <url> [options]

Arguments

url
string
required
The URL of the website to create an MCP server for. Must be a valid HTTP or HTTPS URL.

Options

--skip-auth
boolean
default:"false"
Skip the authentication step even if the website requires login.

Examples

Basic Usage

Create an MCP server for a public website:
mcpkit create https://news.ycombinator.com

With Interactive URL Prompt

If you don’t provide a URL, mcpkit will prompt you:
mcpkit create
# ? Enter the URL of the website to create an MCP for: https://mcpkit.sh

Skip Authentication

For testing or public websites:
mcpkit create https://example.com --skip-auth

How It Works

1

URL Validation

MCPKit validates the provided URL and extracts the domain name.
🔨 MCP Server Generator
📍 Analyzing: https://mcpkit.sh
2

Browser Session

A headless browser session is launched via Browserbase to load the website.
The browser runs in the cloud, so you don’t need Chrome installed locally.
3

Authentication (Optional)

If the website requires authentication, you’ll be prompted to log in:
🔐 This site may require authentication.
Would you like to authenticate? (Y/n) y

🌐 Opening live browser session...
Complete authentication in your browser, then press Enter...
Your authentication context (cookies, session data) will be saved for future use.
4

Action Discovery

MCPKit uses AI to analyze the page and discover available actions:
🔍 Discovering actions...
✅ Found 8 actions:
  - Create new issue
  - Search issues
  - Update issue status
  - Add comment
  - List projects
  - ...
The AI examines:
  • Interactive elements (buttons, forms, links)
  • Page structure and navigation
  • Common workflows and patterns
  • API endpoints (if available)
5

Schema Generation

For each discovered action, MCPKit generates:
  • Tool name and description
  • Input parameters with types
  • Zod validation schemas
  • Implementation code
// Generated tool example
{
  name: "create_issue",
  description: "Create a new issue",
  inputSchema: {
    type: "object",
    properties: {
      title: { type: "string" },
      description: { type: "string" },
      priority: {
        type: "string",
        enum: ["low", "medium", "high", "urgent"]
      }
    },
    required: ["title"]
  }
}
6

Server Generation

A complete MCP server project is created:
📁 mcp-stagehand-mcpkit.sh/
├── src/
│   ├── index.ts           # Main MCP server
│   ├── tools/
│   │   ├── create_issue.ts
│   │   ├── search_issues.ts
│   │   └── ...
│   └── types.ts           # Shared types
├── package.json
├── tsconfig.json
└── README.md
Your MCP server is ready to use!

Generated Server Structure

The generated MCP server includes:

Main Server (src/index.ts)

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server(
  {
    name: "hackernews-mcp-server",
    version: "1.0.0",
  },
  {
    capabilities: {
      tools: {},
    },
  }
);

// Tool handlers
server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    // Generated tools
  ],
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  // Tool implementation
});

Tool Implementation

Each tool is implemented with:
// tools/create_issue.ts
export async function createIssue(params: {
  title: string;
  description?: string;
  priority?: "low" | "medium" | "high" | "urgent";
}) {
  const stagehand = await initStagehand();

  // Navigate to create issue page
  await stagehand.act("click new issue button");

  // Fill in form
  await stagehand.act(`type "${params.title}" in title field`);

  if (params.description) {
    await stagehand.act(`type "${params.description}" in description field`);
  }

  // Submit
  await stagehand.act("click create button");

  // Extract result
  const result = await stagehand.extract("get created issue details");

  return result;
}

Configuration

Generated servers can be configured via environment variables:
# .env in generated server directory
BROWSERBASE_API_KEY=your_api_key
BROWSERBASE_PROJECT_ID=your_project_id
LOG_LEVEL=info

Testing the Generated Server

After creation, test your server:
cd mcp-stagehand-<domain>/
npm install
npm run build
npx @modelcontextprotocol/inspector node dist/index.js

Advanced Options

Custom Model for Discovery

The AI model used for action discovery can be configured in your ~/.mcpkit/secrets.json:
{
  "llmProvider": "google",
  "llmApiKey": "your-api-key",
  "llmModel": "gemini-2.0-flash-exp"
}
Supported providers:
  • google - Gemini models (recommended)
  • openai - GPT models
  • anthropic - Claude models
  • azure - Azure OpenAI

Debugging

For verbose output during generation:
DEBUG=mcpkit:* mcpkit create https://example.com

Common Workflows

  • Public Website
  • Authenticated Website
  • Internal Tool
For websites that don’t require authentication:
# Create server
mcpkit create https://news.ycombinator.com

# Test it
cd mcp-stagehand-news.ycombinator.com
npm install && npm run build
npx @modelcontextprotocol/inspector node dist/index.js

Troubleshooting

If MCPKit doesn’t find any actions:
  1. Try a more specific URL - Navigate to a specific page with clear actions
    # Instead of homepage
    mcpkit create https://mcpkit.sh/issues
    
  2. Authenticate first - Some content only appears after login
    mcpkit create https://example.com
    # Choose Yes when prompted to authenticate
    
  3. Check the website is accessible - Make sure it’s not behind a firewall or paywall
If authentication doesn’t work:
  1. Complete the full login flow - Don’t close the browser until you see success
  2. Check for 2FA - Some sites require two-factor authentication
  3. Verify credentials - Make sure you’re using valid credentials
  4. Try manual context creation:
    mcpkit contexts create example.com
    
If the generated tools don’t work correctly:
  1. Check Browserbase API key in the generated .env file
  2. Verify authentication - Make sure saved context is still valid
  3. Test individual actions in the MCP Inspector
  4. Regenerate with updated context:
    mcpkit contexts delete example.com
    mcpkit create https://example.com
    

Next Steps