Back to Blog
Technical Tutorials

Step-by-Step: Transforming a REST API into an AI-Ready Service with MCPify

Backend and platform engineers: expose your REST API to GPT-5 and other LLMs fast—without writing custom plugins or glue code. Complete tutorial with examples.

Herman Sjøberg
Herman Sjøberg
AI Integration Expert
August 22, 20258 min read
REST APIGPT-5TutorialOpenAPIBackend EngineeringMCP

Key Takeaways

  • Convert a REST API into an AI-ready MCP service from its description
  • Support for both OpenAPI specs and minimal JSON configs
  • Auto-generated MCP tools with rich metadata
  • Production tips for pagination and caching
  • Complete Python integration example

Step-by-Step: Transforming a REST API into an AI-Ready Service with MCPify

Who this is for: Backend and platform engineers who want to expose a REST API to GPT-5 (and other LLMs) fast—without writing custom plugins or piles of glue code.

This tutorial walks you through converting a standard REST API into an AI-ready service using MCPify. You'll send us a spec (or a tiny JSON config), let MCPify auto-generate MCP tools with rich metadata, and then connect those tools to GPT-5.


What you'll build

We'll MCPify a fictional TaskTracker REST API so GPT-5 can:

  • List the latest tasks (GET /tasks)
  • Fetch details for one task (GET /tasks/{id})
  • Create a task (POST /tasks)

You'll end with a shareable MCP endpoint in MCPify and a minimal client snippet that lets GPT-5 call your API as a tool.


Prerequisites

  • A REST API you control (or this tutorial's sample spec)
  • API credentials (API key or OAuth client) if required
  • An MCPify service, configured with us: talk to sales
  • (Optional) OpenAI/Anthropic access if you want to test from GPT-5/Claude

Step 1 — Describe your REST API

You can provide either an OpenAPI spec or a minimal JSON config. MCPify accepts both.

Option A: OpenAPI snippet (YAML)

openapi: 3.0.0
info:
  title: TaskTracker API
  version: 1.0.0
servers:
  - url: https://api.tasktracker.local/v1
paths:
  /tasks:
    get:
      summary: List tasks
      parameters:
        - in: query
          name: status
          schema: { type: string, enum: [open, in_progress, done] }
        - in: query
          name: limit
          schema: { type: integer, default: 10, minimum: 1, maximum: 100 }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Task'
  /tasks/{id}:
    get:
      summary: Get a task by ID
      parameters:
        - in: path
          name: id
          required: true
          schema: { type: string }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
  /tasks:
    post:
      summary: Create a new task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [title]
              properties:
                title: { type: string }
                assignee: { type: string }
                due: { type: string, format: date-time }
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'

components:
  schemas:
    Task:
      type: object
      properties:
        id: { type: string }
        title: { type: string }
        status: { type: string, enum: [open, in_progress, done] }
        assignee: { type: string }
        due: { type: string, format: date-time }
        created: { type: string, format: date-time }

Option B: Minimal JSON config

{
  "name": "TaskTracker",
  "baseUrl": "https://api.tasktracker.local/v1",
  "auth": {
    "type": "apiKey",
    "header": "X-API-Key"
  },
  "endpoints": [
    {
      "method": "GET",
      "path": "/tasks",
      "description": "List tasks",
      "params": {
        "status": { "type": "string", "enum": ["open", "in_progress", "done"] },
        "limit": { "type": "integer", "default": 10 }
      }
    },
    {
      "method": "GET",
      "path": "/tasks/{id}",
      "description": "Get a task by ID"
    },
    {
      "method": "POST",
      "path": "/tasks",
      "description": "Create a task",
      "body": {
        "title": { "type": "string", "required": true },
        "assignee": { "type": "string" },
        "due": { "type": "string", "format": "date-time" }
      }
    }
  ]
}

Which to use? If you already have OpenAPI, use it — MCPify will capture every detail. If not, a minimal JSON config is faster. You can add response schemas later if you want precise response typing.


Step 2 — Send your spec to MCPify

  1. Tell us about the API: talk to sales
  2. Agree a service name (e.g., tasktracker)
  3. Send the spec (YAML or JSON)
  4. Submit credentials at credentials.mcpify.org if the API needs auth
  5. We register it on the gateway and hand back the endpoint

What happens behind the scenes

MCPify:

  1. Parses your spec to understand all endpoints and schemas
  2. Generates MCP-compliant tools with full metadata
  3. Validates auth credentials and base URL
  4. Provisions a secure MCP endpoint for your service

Step 3 — Retrieve your MCP endpoint

When the service is registered, we hand back:

  • Service MCP Endpoint: https://tasktracker.mcp.mcpify.org/mcp
  • Available tools: List of generated tool names (e.g., tasktracker.listTasks)
  • Health status: we confirm the generated tools pass their checks before handover

Worked request/response examples for each tool shape are on the playground; ask us to run one against your own service.


Step 4 — What MCPify auto-generated

MCPify created these tools:

  • tasktracker.listTasks(status?, limit?)
  • tasktracker.getTask(id)
  • tasktracker.createTask(title, assignee?, due?)

Each includes:

  • Human-readable summaries
  • Strict input schemas (types, enums, required)
  • Response shapes and example payloads
  • Pagination & rate-limit hints (where applicable)

This metadata gives GPT-5 what it needs to construct a valid call without trial-and-error—no guesswork, no brittle prompt gymnastics.


Step 5 — Connect from GPT-5 (minimal example)

Below is a minimal Python example using OpenAI's Chat Completions API. The only thing you need from MCPify is your service MCP endpoint URL (the URL we hand back at registration).

from openai import OpenAI

client = OpenAI()

resp = client.chat.completions.create(
    model="gpt-5",
    messages=[
        {"role": "user", "content": "List my open tasks for this week"}
    ],
    tools=[
        {
            "type": "mcp_server",
            "name": "tasktracker",
            "server_url": "<YOUR_MCPIFY_SERVICE_URL>"
        }
    ]
)

print(resp.choices[0].message)

Heads-up: Exact SDK fields can vary; the key idea is that you register the MCPify service as a tool and let GPT-5 invoke it. You can do the same with Claude (MCP servers are first-class there) or via any agent framework that supports MCP.


Step 6 — Try real prompts

  • "Show my 10 most recent tasks that are in_progress, sorted by due."
  • "Create a task titled 'Ship v1.3 release notes' assigned to alex due next Friday."
  • "Get task T-9321 and summarize status and blockers."

You'll see GPT-5 choose the right tool, pass valid parameters, and (if needed) iterate with pagination—all guided by MCPify's metadata.


Production tips

  • Pagination: Prefer smaller limit and let the model page if needed.
  • Field filtering: Return only fields you need (fewer tokens, faster).
  • Caching: High-read endpoints benefit from MCPify's response cache.
  • Error visibility: MCPify shows the model error details (401, 500, etc.) — it can retry or apologize accordingly.
  • Monitoring: Ask us for call logs, latency and token counts — see Observability.

Next steps

Questions? Get in touch.


With MCPify, your REST API becomes an AI-native service — no code, no plugins, just configuration and go.

Who This Article Is For

Backend engineers and platform teams wanting to expose REST APIs to AI models

About the Author

Herman Sjøberg

Herman Sjøberg

AI Integration Expert

Herman excels at assisting businesses in generating value through AI adoption. With expertise in cloud architecture (Azure Solutions Architect Expert), DevOps, and machine learning, he's passionate about making AI integration accessible to everyone through MCPify.

Connect on LinkedIn