UUID生成器

一个简单的ChatGPT GPT Action,用于生成随机UUID(v4),支持Vercel部署和TypeScript开发。

  • by maxproske
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 maxproske/uuid-mcp

使用说明

GPT Action: Random UUID Generator

A simple MVP prototype of a ChatGPT GPT Action that returns a random UUID. Built with TypeScript and ready to deploy to Vercel.

Features

  • 🎲 Generates random UUIDs (v4)
  • ⚡ Serverless function on Vercel
  • 🔌 OpenAPI 3.1 specification for ChatGPT integration
  • 📝 TypeScript for type safety

Local Development

  1. Install dependencies:
npm install
  1. Run locally with Vercel CLI:
vercel dev

The API will be available at http://localhost:3000/api/random-uuid

Deploy to Vercel

  1. Install Vercel CLI (if not already installed):
npm i -g vercel
  1. Deploy:
vercel
  1. Follow the prompts to link your project and deploy.

Configure ChatGPT Action

  1. After deployment, note your Vercel URL (e.g., https://your-app.vercel.app)

  2. Update public/openapi.json with your actual Vercel URL in the servers section

  3. Go to ChatGPT and create a new GPT:

    • Go to https://chat.openai.com/gpts/editor
    • Click "Create a GPT"
    • Go to "Configure" tab
    • Scroll down to "Actions"
    • Click "Create new action"
  4. Import the OpenAPI schema:

    • Either paste the contents of public/openapi.yaml or public/openapi.json
    • Or provide the URL: https://your-app.vercel.app/openapi.yaml
  5. Test the action in ChatGPT:

    • Ask: "Generate a random UUID for me"
    • ChatGPT will call your API and display the result

API Endpoint

GET /api/random-uuid

Returns a random UUID with a timestamp.

Response:

{
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "timestamp": "2025-10-15T12:00:00.000Z"
}

Project Structure

gpt-actions/
├── api/
│   └── random-uuid.ts       # Serverless function
├── public/
│   ├── openapi.yaml         # OpenAPI specification (YAML)
│   └── openapi.json         # OpenAPI specification (JSON)
├── package.json
├── tsconfig.json
├── vercel.json
└── README.md

Notes

  • No authentication required for this MVP (add auth in production!)
  • CORS is enabled to allow ChatGPT to call the API
  • The OpenAPI spec follows OpenAI's requirements for GPT Actions