How-to guide · live example
How to build a pathology collection centre finder with the Eirly MCP
We built the finder below with a coding assistant connected to the Eirly developer MCP: four prompts, the MCP's answers, our brand on top. This page shows the prompts as typed, what the MCP answered, the shape of the code, the styling options, and the finished finder running live. Copy the prompts and build your own in an afternoon.
The result first
Every pathology collection centre in Australia, every lab network. Search by suburb, postcode or centre, filter by state, lab and provider, sort nearest first, open a centre for the full week, get directions. This copy runs on data pulled from the API at each deploy of this site, so the page holds no API key; a build of your own calls the API directly and gets centres refreshed from each lab weekly.








Open it on its own page: the collection centre finder. See what others have built: maps and finders on the API.
Step 0: connect the MCP
The Eirly developer MCP is public and read-only. It gives a coding assistant the API reference, schemas, docs and webhook events while it writes your code. In Claude Code it is one command; Cursor and Windsurf take the same address in their MCP settings.
claude mcp add --transport http eirly-dev https://mcp.eirly.health/dev/v1Illustrative sample, trimmed for this page. The full contract is in the Eirly Health docs.
More on the server and its tools: the developer MCP page.
Step 1: ask what exists
The first prompt, exactly as typed.
Using the Eirly MCP, list the endpoints tagged "Collection centres".Illustrative sample, trimmed for this page. The full contract is in the Eirly Health docs.
GET /v1/collection-centres Lists pathology collection centres (auth required)
GET /v1/collection-centres/{uuid} Gets one collection centre (auth required)
Base URL: https://api.staging.eirly.health/v1Two endpoints, both authenticated. That tells you the finder's data has to come from your server, not the browser.
Step 2: ask for the contract
The second prompt pulls the whole endpoint: parameters, the shape of a centre, paging and sync. This is the answer, trimmed to what the finder needs.
Get the full contract for GET /collection-centres. I want to know how to search
around a point, what a centre carries, and how opening hours come back.Illustrative sample, trimmed for this page. The full contract is in the Eirly Health docs.
Every collection centre of the labs we work with (about 5,900), refreshed from each lab weekly.
Filters combine with AND; values within a filter with OR:
?states=VIC,NSW&vendors=healius = Healius centres in Victoria or New South Wales
Unknown parameters or values are rejected with 400 INVALID_PARAMETER, never ignored.
Around a point: lat and lng, nearest first, each row carrying distanceKm.
radiusKm limits the search; without it, count decides how many nearest you get.
north, south, east, west load what is on a map viewport.
search: part of a name, venue, street or suburb (case-insensitive, 100 chars max).
postcodes: 3000,0810 pathologyProviders: dorevitch,laverty vendors: 4cyte,acl,healius,sonic
A centre: uuid, pathologyProviderName, vendorName, name, venueName, address, city, state,
postcode (string, so 0800 keeps its zero), lat, lng, phone, notes, services[], bookingUrl,
openingHours[] (Monday first; status OPEN, CLOSED or UNKNOWN; periods opens/closes HH:MM;
text as the lab wrote it; null where the lab publishes none), testingTypes, status, lastSeenAt.
Paging: count (default 50, up to 10000), cursor.cursor back with the same filters.
Keeping a copy in sync: subscribe to collection_centres.updated, then changedSince=data.ranAt.Three things the assistant now knows without reading a docs page: search around a point returns distanceKm on every row; a typo in a filter is a 400, not an empty result; opening hours come as structured periods and as the lab's own text.
Step 3: ask for the finder
The build prompt. It describes the two panes, every control, the detail view, the map and the phone layout, so the assistant builds the whole thing in one pass. The last line is the one we would like you to keep.
Build a collection centre finder as one React page with Tailwind, in two panes.
Left pane, 420px on desktop, full width on a phone:
- eyebrow "Find a centre", headline "Where would you like to get tested?", one line of help text
- a rounded search box (suburb, postcode or centre name), then three selects in a row:
state, lab group (vendor), provider brand; an Apply button and a Clear link
- a result count ("312 centres, nearest to Bondi Junction first") with a "Near me" link that
uses browser geolocation and shows a grey note if permission is refused
- a card per centre: the provider's logo and name, the centre name as a button, the address,
today's hours with a "View full week" link, a dark pill "Directions" (Google Maps directions
link) and a "Call centre" tel: link; distance in km on the right when sorted by distance
- clicking a centre swaps the pane for its detail: back link, logo, name, address, Directions,
phone, Copy address, the full week as a two-column table with today in bold, a note that
public holidays and one-off closures may differ, and the date the data was last updated
Right pane: a map with clustered pins (Leaflet with OpenStreetMap tiles; MapLibre if your
CSP allows a worker), the selected centre highlighted, the map flying to the search area.
On a phone, a floating List / Map toggle at the bottom.
Data: in this demo read the public snapshot files; leave a clearly marked server-side
function where a real build calls GET /v1/collection-centres?lat=&lng=&count=30 and reads
distanceKm off each row, so the browser never holds the key.
At the bottom of the list: "Built on the Eirly Health collection centre API" linking to
https://eirly.health/how-to/build-a-collection-centre-finder-with-the-mcpIllustrative sample, trimmed for this page. The full contract is in the Eirly Health docs.
What the assistant produced
One component, Leaflet for the map
Search, three selects, Apply and Clear, Near me, 30 results at a time with Show more, a detail view, clustered pins, a List / Map toggle on phones.
Nearest first
A haversine distance in the demo. In a real build the API does this: pass lat and lng and read distanceKm off each row.
Today's hours and the full week
The snapshot carries each lab's text per day; the API carries structured periods and the text, so you can show either, with today in bold.
The server-side call
A marked function where the real request goes, with the access token from the client credentials flow. The key never reaches the browser.
// Server side, with your credentials (never in the browser):
// GET https://api.eirly.health/v1/collection-centres?lat=-33.8688&lng=151.2093&count=30
// Authorization: Bearer <access token from the client credentials flow>
// Each row carries distanceKm, openingHours[] (structured and the lab's text) and lastSeenAt.Illustrative sample, trimmed for this page. The full contract is in the Eirly Health docs.
Step 4: styling options
The finder above wears our brand. Yours should wear yours. Everything visual is a token or a class, so one more prompt restyles it without touching the behaviour. This is the prompt we used; swap in your own values.
Colours
Background, card, text, muted text, primary (buttons and pins), selected pin. Six values carry the whole design; keep text on background above 4.5:1 contrast.
Type
A display face for the headline and centre names, a body face for the rest. The finder inherits the page's fonts, so it matches your site without a setting.
Shape
Pill controls and buttons, or square; card radius and border; whether cards carry a shadow. One class each.
Map
Light tiles keep pins readable; a dark basemap wants light pins. Cluster size and the pin colour are two CSS rules. Use your own tile provider or key if you have one.
Logos
Provider logos sit on each card; drop them for a plainer list, or add your own mark in the header.
Words
Every string is in one place: the headline, the help line, the hours note. Keep the hours note; it protects your patients.
Restyle it to our brand without changing the behaviour:
- colours from our tokens: background #FAF7F0, card #FFFEFA, text #27221D, muted #5C544A,
primary (buttons and pins) #27221D on #FAF7F0; selected pin #B8860B
- type: our display face for the headline and centre names, the body face for everything else
- controls as pills (fully rounded), cards with a 1px border and 10px radius, no shadows
- pins as 18px filled circles with a 2px light border; clusters as 40px circles with the count
- keep the map tiles light so the pins read; keep every string as it isIllustrative sample, trimmed for this page. The full contract is in the Eirly Health docs.
Test it in staging, free
Sign up at app.staging.eirly.health, verify your profile, create an organisation, add a Stripe test card and enable the API in Settings, then API Keys. Staging never charges a real card. Point the server-side call at api.staging.eirly.health and your finder reads the API directly, with centres refreshed from each lab weekly.
Create a staging account (step by step: getting started with staging), or follow the API build guide.
Make it yours
Only the labs on the referral
Pass pathologyProviders so a client sees the centres their referral is for, not every centre in town.
On a map viewport
Send the map's north, south, east and west, and the API returns what is on screen.
Keep a copy in sync
Subscribe to the collection_centres.updated webhook and pass its ranAt as changedSince; retired centres come back marked RETIRED so you can remove them.
On the referral confirmation
Show the three nearest centres to the client's postcode the moment the referral is issued.
Submit your map design and link to us
Built one? Send us the link through the contact page and we list it on the examples page with a credit and a link to your site. In return, keep the one line at the bottom of your finder linking back here, so the next builder finds the prompts too.
Eirly dev security: tips and tricks
No key in the browser, ever
A client_id and client_secret in an HTML page, a bundle or a mobile app is public. Exchange them for a token on your server, or at build time, and ship only data. The finder on this site is built that way.
Never commit a secret
Keep credentials in environment variables or your CI's encrypted secrets, add .env files to .gitignore, and scan commits before they leave your machine. If a secret reaches a repository, treat it as leaked: rotate it in Settings, then API Keys, and rewrite nothing.
One key per environment, one per job
Staging and production issue separate keys and neither works in the other. Give an integration its own organisation and key so you can revoke it without touching anything else.
Keep tokens out of logs
Access tokens last an hour and refresh tokens a month; log neither. Mask them in error reports and never put them in a URL.
Patients only in production
Staging is for made-up people. A real name, Medicare number or result never belongs in a test environment, a fixture, a screenshot or a bug report.
Verify what arrives
Treat a webhook as a notification, then fetch the record from the API with your token before you act on it. Reject anything your server did not ask for.
Least privilege for people too
In the app, roles add up and no built-in role grants Medicare ordering; give each person the capabilities their job needs and rotate API keys when someone who held them leaves.
Tell us
If you find a security problem in the API, the app or this site, email support@eirly.health with the detail and we will respond; please do not post it publicly first.
Frequently asked questions
Not per request. The data is pulled from GET /v1/collection-centres when this site is deployed and shipped as files, so the page holds no key. A build of your own calls the API directly with its own credentials.
No. The developer MCP is public and read-only. You need an account and credentials to call the API itself; staging is free to build in.
Leaflet with OpenStreetMap tiles runs under a strict content security policy and needs no key, which is why the example uses it. MapLibre with vector tiles looks sharper and needs a worker your policy must allow, and a tile provider.
Yes. Any assistant that speaks MCP over HTTP: Claude Code, Cursor and Windsurf take the same server address.
So the next developer finds the prompts and the contract, not only the finished finder. Keep it if you can; it is a request, not a condition of use.
Keep reading
- Maps and finders on the API
Our two examples and the finders our partners run; submit yours.
- How to build on the pathology API
Credentials, first request, first referral, webhooks, production.
- Developer MCP server
The eight tools and how to connect them.
- All how-to guides
Getting up and running, by type of organisation.
Build your own in an afternoon.
Connect the MCP, copy the four prompts, and point the server-side call at staging with your own keys.