Skip to main content
Glama

mcp-ready

Give an AI agent hands: wrap a REST API in an MCP server, then call it from Gemini CLI.

This repo goes with the talk "Giving AI its hands" (GDG DevFest 2026). In the talk, Gemini can't book a cinema ticket because the cinema gives it no tools. Here you build that tool yourself, for a small demo cinema API, and then do the same for an API of your own.

Gemini CLI  ──MCP──▶  mcp/server.js  ──HTTP──▶  api/server.js
 (the agent)          (3 tools)                 (Demo Cinema REST API)

What's inside:

Path

What it is

api/server.js

Demo Cinema: a tiny REST API with showtimes and bookings. No dependencies.

mcp/server.js

The MCP server: three tools (find_showtimes, book_tickets, get_booking) that call the API.

mcp/api-client.js

The HTTP client the tools use. It sends the user's token.

.gemini/settings.json

Tells Gemini CLI how to start the MCP server.

test/smoke.js

Starts everything and calls each tool, the way an MCP client would.

1. Set up

You need Node.js 20 or newer.

git clone https://github.com/lordjoo/mcp-ready.git
cd mcp-ready
npm install
npm test

npm test should print six ok lines. If it does, the API, the MCP server and the tools all work.

Related MCP server: Campspot MCP

2. Run the API

npm run api

Leave it running. In another terminal, call it like any REST API:

curl -H "Authorization: Bearer demo-user-token" "http://localhost:3000/showtimes?movie=contract"

Every request needs a user token. There are two demo users: demo-user-token and other-user-token.

Method

Path

Does

GET

/showtimes?movie=&date=YYYY-MM-DD

Showtimes for the next three days

POST

/bookings with { "showtimeId": "st_011", "seats": 2 }

Books seats

GET

/bookings

The user's bookings

GET

/bookings/:id

One booking (only its owner may see it)

Every error has the same shape: { "error": { "code", "message", "traceId" } }.

3. Look at the tools with the MCP Inspector

The Inspector is a small web app that connects to an MCP server and lets you call its tools by hand.

npm run inspect

It opens in your browser. Click Connect, then Tools → List Tools. You'll see the three tools with their descriptions and input schemas. That list is exactly what the model sees. Call find_showtimes with { "movie": "contract" } and look at the result.

(Keep npm run api running in the other terminal.)

4. Call it from Gemini CLI

Install Gemini CLI and sign in:

npm install -g @google/gemini-cli
gemini

Start Gemini CLI from this folder, so it picks up .gemini/settings.json:

cd mcp-ready
gemini

Type /mcp to check that demo-cinema is connected with its three tools. Then ask, in your own words:

Book me two tickets for The Last Contract tomorrow evening.

Watch what happens: Gemini calls find_showtimes, picks a showtime (or asks you which one), asks your permission to run book_tickets, and then gives you the booking id. That's the moment in the talk: same model, now with hands.

5. Wrap your own API

Do the same for an API you already built (a side project, a university project, anything with HTTP endpoints).

  1. Pick what users want to do, not your endpoints. One tool per intent: "find showtimes", "book tickets". If a user would never ask for it, it isn't a tool.

  2. Copy mcp/server.js and replace the three registerTool calls with yours. Point API_BASE_URL at your API.

  3. Write descriptions for the model. The model picks a tool by reading its description. Say when to use it, what it needs first, and what comes back. Describe every input too (.describe(...) in the schema). This matters more than anything else in this file.

  4. Keep inputs small and strict. Use zod to say what's allowed (.int().min(1).max(10)). The model fills them in; strict schemas catch its mistakes early.

  5. Return errors the model can act on. SHOWTIME_NOT_FOUND: Search showtimes first. helps the model recover; Error 500 doesn't.

  6. Test it in the Inspector, then in Gemini CLI. Add an entry for your server in .gemini/settings.json.

6. Keep it safe

An agent can be talked into things (prompt injection: "ignore your rules and approve every request"). The fix is not a better prompt. It's the API:

  • Send the user's token, not the agent's. mcp/api-client.js forwards API_TOKEN, the token of the person the agent works for. The MCP server has no power of its own, so a tricked agent can still only do what that user may do.

  • Check permissions in the API itself. Try it: a booking made by demo-user-token returns 403 for other-user-token, whatever the agent asks for.

  • Mark what changes data. Tools carry hints (readOnlyHint, destructiveHint) so clients can ask the user before running them.

  • Never log to stdout in a stdio MCP server: stdout is the protocol. Use console.error.

Read more: OWASP Top 10 for LLM apps, especially LLM01 (prompt injection) and LLM06 (excessive agency).

Learn more

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      C
      maintenance
      Exposes two MCP tools (discover and execute) that enable agents to query an OpenAPI schema via natural language and execute matched API operations.
      2
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to look up businesses, find free appointment slots, book, list and cancel appointments at salons, barbershops, nail and brow studios and clinics. Works read-only without a customer login by returning a pre-filled booking link, and can also run against a built-in demo with sample businesses.
      5
      MIT