1.0.3 • Published 5 months ago

@automcp.app/cli v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

AutoMCP - Automated API Client Generation

AutoMCP is a powerful CLI tool that automatically generates MCP servers from documentation. It supports scraping API documentation from URLs or direct input and generates fully functional, published servers.

Features

  • šŸ¤– AI-powered documentation parsing using multiple providers:
    • OpenAI
    • Google Gemini
    • Anthropic
  • šŸ“š Multiple documentation input methods:
    • URL scraping (supports multiple URLs)
    • Direct text input
  • šŸ”„ Automatic server generation
  • šŸ“¦ NPM package publishing support
  • ⚔ Server-Sent Events (SSE) support
  • šŸ”’ Api Key Authentication

Prerequisites

  • Node.js (v14 or higher)
  • NPM account (for publishing)
  • API key for one of the supported AI providers:
    • OpenAI API key
    • Google Gemini API key
    • Anthropic API key

Installation

npm install -g @automcp.app/cli

Configuration

Set up your environment variables for the AI provider you want to use:

# For OpenAI
export OPENAI_API_KEY=your_api_key

# For Google Gemini
export GEMINI_API_KEY=your_api_key

# For Anthropic
export ANTHROPIC_API_KEY=your_api_key

Usage

  1. Run the CLI tool:
automcp
  1. Follow the interactive prompts:
    • Select an AI provider
    • Enter a name for your server
    • Choose documentation source (URLs or direct input)
    • Provide API documentation
    • Choose whether to publish to NPM

Running Generated Server

If you choose not to publish to NPM, you can run the server locally:

cd servers/<your-server-name>
npm install
npm run build
npm start -- --sse

Client Configuration

The generated server can be accessed in clients like Cursor using one of two configurations in your .cursor/mcp.json file:

  1. For locally running servers:
"mcp": {
  "url": "http://localhost:3001/sse"
}
  1. For NPM published servers:
"mcp": {
  "command": "npx",
  "args": [
    "-y",
    "@path-to/your-package-name@latest"
  ]
}

Publishing to NPM

When publishing to NPM, you can choose between:

  • Your personal NPM scope (@username/package-name)
  • AutoMCP scope (@automcp.app/package-name)

Make sure you're logged in to NPM before publishing:

npm login

Output Structure

The generated server will have the following structure:

servers/<your-server-name>/
ā”œā”€ā”€ index.ts           # Main server file with MCP implementation
ā”œā”€ā”€ package.json       # Project dependencies and scripts
ā”œā”€ā”€ tsconfig.json     # TypeScript configuration
ā”œā”€ā”€ .gitignore        # Git ignore rules
ā”œā”€ā”€ README.md         # Server documentation
└── dist/             # Compiled JavaScript output (after build)

Error Handling

  • The tool validates API keys before processing
  • Provides detailed error messages for failed URL scraping
  • Validates server name format
  • Checks NPM login status before publishing