Skip to main content
New: the Agentic AI Academy, 5 courses on running AI agents in production.Start free →
intermediate

Legacy APIs as MCP Tools Through GraphQL

Agents will call your services, and most of those services are old REST and SOAP APIs that nobody wants to rewrite. Generating one tool per endpoint fails too: agents choose worse when the list of tools grows. This course takes the path Željko Kozina showed at the Amsterdam Java User Group, as Luca Berton wrote it up on lucaberton.com: put a GraphQL facade in front of the old API, design tools from the screens people already use, and publish each GraphQL operation as an MCP tool.

You build it in Java with Spring, on the Spring PetClinic REST API: first the facade, then tools written by hand with Spring AI, then tools that are only a reviewed GraphQL file with GATool. You call every tool yourself, so you see exactly what an agent sends and gets back.

The narration is a synthetic voice made from the author's own voice.

6 lessons28mUpdated November 2026

What you'll learn

  • Read the calls a legacy screen makes, and see what they cost an agent
  • Put a GraphQL facade in front of a REST API, and fetch a whole screen with one query
  • Keep the facade safe: read-only operations, depth limits and clean errors
  • Turn a named GraphQL operation into an MCP tool with Spring AI
  • Publish trusted GraphQL documents as MCP tools with GATool, and catch broken ones at startup
  • Keep the list of tools small, and know when tool search or dynamic tools are worth it

Who this is for

  • • DevOps engineers deepening their expertise
  • • SREs building production-grade systems
  • • Backend developers expanding into infrastructure

Prerequisites

  • • A Mac with Apple silicon, Docker through Colima, and a Java 25 JDK
  • • Basic Java and Spring Boot: a controller, application properties, running with Maven
  • • What an MCP server is, at the level of the course "Build and Secure an MCP Server"

Course content

2 modules, 6 lessons, 28m of video

Module 1

3 lessons, 13 min
1

5 min

Run the Spring PetClinic REST API, look at what its responses contain, and measure how much of it a screen really shows, and how many calls a screen that combines owners and vets needs. The narration is a synthetic voice made from the author's own voice.

2
One schema in front of the old API

5 min

Build a GraphQL facade with Spring that calls the REST API underneath, and fetch each screen with one query that asks only for the fields it shows.

3
Guard the facade

4 min

Keep the first release read-only, limit how deep a query can go, and make a missing record come back as "not found" instead of an internal error, with no stack trace.

Module 2

3 lessons, 16 min
4
A GraphQL operation is an MCP tool

6 min

See how a named operation maps to a tool's name, description and schemas, write the tool with Spring AI, set honest hints instead of the defaults, and list and call it with curl over MCP.

5
GATool: the operation file is the tool

6 min

Publish the same tool as a reviewed GraphQL file with GATool, add a second one, watch a broken query stop the application at startup, and see what the secure defaults ask of you.

6
When the list of tools grows

5 min

See why agents choose worse with more tools and what tool search does about it, run GATool's experimental tools that let a model search the schema and write its own query within limits, and leave with a policy for which to use.

Get started

Start Free Lesson

First lesson is always free — no signup required

This course includes

6 hands-on lessons
Intermediate level
28m total
Final assessment

Every lesson, with Pro

All 6 lessons of this course and every other course.

$25 a month billed yearly, or $29 month to month

Until 30 November: $210 for the first year, or $14.50 for the first month, with code LAUNCH.

See plans →

Your instructor

Luca Berton

Founder and CEO, Open Empower. About the author

More in AI Agents

All courses in this track

OpenClaw: Your First AI Agent

Deploy OpenClaw locally or on a small VPS, add real tools, create one reusable automation, and apply essential security guardrails. You'll leave with a working 'Ops Assistant' that generates a Daily Brief, creates an Action Queue, and does it all safely.

Beginner · 7 lessons · 1 h

Preview free lesson

Claude Code Masterclass: Ship Real Code with AI

Stop treating AI like a magic autocomplete and start using it like a sharp junior engineer who sits next to you — one you direct, review, and hold accountable. In 10 hands-on modules you'll master the Plan → Implement → Test → Review → Commit loop and use it to ship real, tested code with Claude Code: Best-of-N, honest test suites, safe git workflows, multimodal prompts, refactoring & docs, reusable skills, the GitHub MCP server, lifecycle hooks, and a production-readiness checklist. You stay the engineer of record — Claude proposes, you decide what ships.

Intermediate · 10 lessons · 5 h

Preview free lesson

Claude Code Bootcamp: Build Real-World Software with AI

The complete Claude Code Bootcamp by Luca Berton — thirteen hands-on modules that teach you to ship real, tested software with Claude Code. You stay the engineer of record: Claude proposes, you review and merge. Master the Plan → Implement → Test → Review → Commit loop, then apply it across GCOE prompting, CLAUDE.md brain files, Best-of-N, testing & self-review, safe Git workflows, multimodal screenshot-to-UI, constrained refactoring & docs, reusable Skills, the GitHub MCP server, lifecycle Hooks, and a five-axis production-readiness review. Includes a ten-skill reusable library and a 20-question knowledge quiz.

Intermediate · 15 lessons · 8 h

Preview free lesson