# 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

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AgentPilot — API AI-Readiness & MCP Server Generator",
        "description": "Audits public OpenAPI specifications for AI suitability and automatically generates run-ready typescript/python Model Context Protocol (MCP) server code packages.",
        "version": "0.1",
        "x-build-id": "k5GTE4iUlflVR63nf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/orbitai~agent-pilot-mcp-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-orbitai-agent-pilot-mcp-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/orbitai~agent-pilot-mcp-generator/runs": {
            "post": {
                "operationId": "runs-sync-orbitai-agent-pilot-mcp-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/orbitai~agent-pilot-mcp-generator/run-sync": {
            "post": {
                "operationId": "run-sync-orbitai-agent-pilot-mcp-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "openapiUrl": {
                        "title": "OpenAPI Spec URL",
                        "type": "string",
                        "description": "The URL pointing to a public OpenAPI YAML/JSON schema."
                    },
                    "openapiSpec": {
                        "title": "Raw OpenAPI Schema",
                        "type": "string",
                        "description": "Directly pasted OpenAPI specification in YAML or JSON format."
                    },
                    "targetLanguage": {
                        "title": "Target Language",
                        "enum": [
                            "typescript",
                            "python"
                        ],
                        "type": "string",
                        "description": "The programming language of the generated MCP server.",
                        "default": "typescript"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
