Skip to content

About

Food ordering API examples for Layout: order from restaurant chains over REST, MCP and the Layout CLI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Layout Food Ordering API

Get started with the Layout food ordering API. Layout places real pickup orders at restaurant chains through a REST API and an MCP server. Everything here runs in the sandbox, which builds carts from real or test menus but charges nobody and sends nothing to a restaurant.

What is here

Folder Shows
quickstart/ Node 18+, no dependencies. Creates a sandbox user, mints a build grant, builds a cart at test_place_carted, confirms it and reads the order. The restaurants Layout orders from are listed at https://layout.link/restaurants.
python/ The same quickstart in Python 3 with the standard library only.
mcp-client/ A small MCP client using @modelcontextprotocol/sdk. Lists the server's tools and calls the read-only places tool. claude-code.md shows how to add the server to Claude Code and Cursor.

Run

Get a sandbox secret key (sk_test_...) from the Layout console, then:

cp .env.example .env
export LAYOUT_SECRET_KEY=sk_test_...
node quickstart/quickstart.mjs
python3 python/quickstart.py

For the MCP client, mint a sandbox build grant with POST /v1/users/{id}/grant and set it as LAYOUT_PERSON_TOKEN:

cd mcp-client && npm install && LAYOUT_PERSON_TOKEN=lgb_... npm start

The scripts refuse to run with a key that is not a sandbox key.

Links

License

MIT

About

Food ordering API examples for Layout: order from restaurant chains over REST, MCP and the Layout CLI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages