# AgentPilot — API AI-Readiness & MCP Server Generator (`orbitai/agent-pilot-mcp-generator`) Actor

Audits public OpenAPI specifications for AI suitability and automatically generates run-ready typescript/python Model Context Protocol (MCP) server code packages.

- **URL**: https://apify.com/orbitai/agent-pilot-mcp-generator.md
- **Developed by:** [Daniel Lozano](https://apify.com/orbitai) (community)
- **Categories:** MCP servers, Automation, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## AgentPilot — API AI-Readiness & MCP Server Generator

Evaluate public OpenAPI/Swagger schemas for AI compatibility and automatically generate deployable Model Context Protocol (MCP) server code packages with zero setup.

***

### ⚙️ How It Works

AgentPilot audits and generates MCP wrapper code using a structured 4-step pipeline:

1. **Schema Ingestion**: The Actor loads the target OpenAPI specification from a provided URL (`openapiUrl`) or raw schema text input (`openapiSpec`).
2. **AI-Readiness Audit**: It parses the spec and scores each endpoint on its suitability for LLM use. The audit checks for required parameters, parameter types, authentication schemes, and descriptive text fields.
3. **MCP Server Generation**: Based on the selected target language (`targetLanguage` — TypeScript or Python), AgentPilot generates a fully hydrated MCP Server codebase with tool mappings matching your API paths.
4. **Code Delivery**: The generated code files are saved to the default Key-Value Store, and download links are returned inside the structured dataset output.

***

### 🚀 Features

- **Automated AI Compatibility Audit**: Scores API schemas (0-100) based on documentation quality, parameter definition completeness, and authentication setup.
- **Node/TypeScript & Python Generators**: Instantly outputs complete stdio-based MCP server code structures compatible with Cursor, Windsurf, and Claude Desktop.
- **Built-in Parameter Mapping**: Auto-serializes queries, headers, and body payloads, reducing integration friction.
- **Zero Configuration**: Ready to zip, deploy to Vercel/Render, or run locally out of the box.

***

### 📝 Input Parameters

- **`openapiUrl`** (String): An HTTP link to your public OpenAPI specification JSON/YAML file (e.g. `https://api.example.com/openapi.json`).
- **`openapiSpec`** (String): Paste the raw JSON or YAML schema directly.
- **`targetLanguage`** (Select): Choose between `"typescript"` or `"python"` for the generated server code.

***

### 📦 Output Format

The Actor writes a structured audit result to the default dataset and saves the generated MCP code files in the default Key-Value Store.

#### Dataset Output Example

```json
{
  "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json",
  "actorName": "AgentPilot — API AI-Readiness & MCP Server Generator",
  "status": "success",
  "score": 85,
  "overallWarnings": [
    "Uses complex authorization. Verify API key injection."
  ],
  "endpointsCount": 3,
  "endpoints": [
    {
      "path": "/pets",
      "method": "GET",
      "summary": "List all pets",
      "description": "Returns a list of pets.",
      "score": 100,
      "warnings": []
    }
  ],
  "fileUrls": {
    "package.json": "https://api.apify.com/v2/key-value-stores/.../records/packagejson",
    "tsconfig.json": "https://api.apify.com/v2/key-value-stores/.../records/tsconfigjson",
    "src/index.ts": "https://api.apify.com/v2/key-value-stores/.../records/src_indexts",
    "README.md": "https://api.apify.com/v2/key-value-stores/.../records/READMEmd"
  }
}
```

***

### 🛠 How to Integrate

You can trigger AgentPilot programmatically using the official Apify client libraries:

#### JavaScript/TypeScript Client

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

const input = {
    "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json",
    "targetLanguage": "typescript"
};

const run = await client.actor("orbitai/agent-pilot-mcp-generator").call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python Client

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")

run_input = {
    "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json",
    "targetLanguage": "typescript"
}

run = client.actor("orbitai/agent-pilot-mcp-generator").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

***

### ⚖️ Legal & Compliance

This tool analyzes publicly available or user-provided OpenAPI specifications to generate boilerplate code. Users are responsible for configuring their own API credentials and ensuring their generated servers comply with target API Terms of Service.

# Actor input Schema

## `openapiUrl` (type: `string`):

The URL pointing to a public OpenAPI YAML/JSON schema.

## `openapiSpec` (type: `string`):

Directly pasted OpenAPI specification in YAML or JSON format.

## `targetLanguage` (type: `string`):

The programming language of the generated MCP server.

## Actor input object example

```json
{
  "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json",
  "targetLanguage": "typescript"
}
```

# Actor output Schema

## `results` (type: `string`):

Link to output dataset items.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"
};

// Run the Actor and wait for it to finish
const run = await client.actor("orbitai/agent-pilot-mcp-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json" }

# Run the Actor and wait for it to finish
run = client.actor("orbitai/agent-pilot-mcp-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "openapiUrl": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"
}' |
apify call orbitai/agent-pilot-mcp-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=orbitai/agent-pilot-mcp-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LCOQBqVuz2VxQ8CrJ/builds/k5GTE4iUlflVR63nf/openapi.json
