io.github.lorkorblaq/labloop-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@io.github.lorkorblaq/labloop-mcp How much is a thyroid test?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LabLoop MCP (demo)
An unofficial, fictional Model Context Protocol server that demonstrates a complete, multi-step booking flow for medical lab tests:
search → compare prices → quote → confirm booking → escalate to a human
Everything here is fake. Tests, test centers, prices ("credits"), bookings, profiles, and escalation tickets are fictional and held in memory. The server makes no network calls, needs no credentials, and never books, charges, or messages anyone. It is not medical advice and is not affiliated with any real healthcare provider.
Why this exists
This server is a reference for designing tools that LLMs can chain reliably:
Rules live next to arguments. Guidance like "strip filler words before searching" or "use the exact id from a prior lookup" sits in each parameter's description instead of a long system prompt.
Two-step writes. The booking tool returns a full quote first (
needs_confirmation) and only books when it is called again withconfirm=trueafter the user agrees. A quote leaves no state behind.Actionable non-happy paths. Results carry a
status(ambiguous,not_found,needs_infowith amissinglist,invalid_test_id) plus a message telling the model what to do next, instead of a bare error.Graceful degradation. Each test in a multi-test order falls back to its cheapest center when the preferred one doesn't offer it (flagged with
providerFallback), and tests that can't be resolved are reported inskipped_testswithout failing the whole order.Small surface. The only runtime dependencies are
mcpandpydantic.
Related MCP server: CUF Health Portal MCP Server
Tools
Tool | What it does | Read-only |
| List the full catalog (id, name, abbreviation, category) | yes |
| Find a test by name or abbreviation; handles ambiguous matches and fuzzy suggestions | yes |
| Test centers and prices for one test, cheapest first | yes |
| Quote ( | no |
| Read saved demo contact details | yes |
| Save demo contact details for reuse in later bookings | no |
| Simulated hand-off to a human agent; logs a ticket in memory | no |
Install and run
Requires Python 3.10+. The server speaks MCP over stdio.
pip install labloop-mcp # or: uvx labloop-mcp
labloop-mcpClaude Desktop / Claude Code
{
"mcpServers": {
"labloop": { "command": "uvx", "args": ["labloop-mcp"] }
}
}With Claude Code: claude mcp add labloop -- uvx labloop-mcp
Try it with MCP Inspector
npx @modelcontextprotocol/inspector uvx labloop-mcpExample conversation flow
"How much is a thyroid test?" →
labloop_find_test(name="thyroid")→labloop_get_test_providers(test_id="tst-thyroid")"Book it with a lipid panel for next Monday at 9am, 12 Willow Ave." →
labloop_quote_or_book_collection(test_ids=["tst-thyroid","tst-lipid-panel"], user_id="demo-user-1", date_time="…", address="12 Willow Ave", phone_number="+15550000001")→ returnsneeds_confirmationwith the combined quote"Yes, go ahead." → the same call with
confirm=true→successful, with simulatedcollectionId/schedulingId"This is wrong, I want a person." →
labloop_escalate_to_human(...)
Security and privacy
No secrets, API keys, or environment variables are required or read.
No outbound network access. All state is in process memory and is cleared on restart.
Every input is validated by Pydantic before it reaches the tool logic (E.164 phone numbers, email format, length limits).
Don't enter real personal data; this is a demo.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest
python scripts/smoke_test.py # drives the server over stdio end-to-endLicense
MIT
Available Tools
7 toolslabloop_escalate_to_humanEscalate to a human agentA
Hand the conversation to a human support agent (SIMULATED in this demo).
Use when the user asks for a real person, has a complaint, is frustrated, keeps hitting errors, or the request is beyond the other tools. Logs a ticket in memory and returns {status, simulated: true, ticketId, message}. No real message is sent.
Inputs: user_query (required), context. Returns: object
labloop_find_testFind a test by nameARead-onlyIdempotent
Look up a medical test by name or abbreviation to get its id and details.
Details include description, eligible gender, turnaround time (hours), preparation advice, and sample type. Returns one of:
{status: "found", test: {...}}: a single match; use test.id in later calls.
{status: "ambiguous", options: [...]}: several matches; ask the user to pick one.
{status: "not_found", suggestions: [...]}: nothing matched; offer the close suggestions.
Inputs: name (required). Returns: object
labloop_get_test_providersGet test prices by providerARead-onlyIdempotent
Get the test centers offering a test and their prices, cheapest first.
Returns {status, testId, testName, currency, providers: [{provider, price}]}, or {status: "invalid_test_id"} if the id is unknown.
Inputs: test_id (required). Returns: object
labloop_get_user_profileGet saved user detailsARead-onlyIdempotent
Fetch the demo user's saved contact details (name, phone, address, email).
Useful before booking, to avoid asking for details already on file. Profiles live in server memory only. Returns {status: "successful", profile} or {status: "not_found"}.
Inputs: user_id (required). Returns: object
labloop_list_testsList all testsARead-onlyIdempotent
List every test in the LabLoop catalog with its id, name, abbreviation, and category.
Use to browse what is available, or when labloop_find_test cannot find what the user means. Returns {status, count, tests: [{id, name, abbrev, category}]}.
Inputs: no named parameters. Returns: object
labloop_quote_or_book_collectionQuote or book a home sample collectionA
Order one or more tests as a single home sample-collection booking. This takes two steps.
Call with confirm=false (default) to get ONE combined quote: each test's center and price, a logistics fee, and the grand total. Nothing is booked.
After the user explicitly approves, call again with the same arguments and confirm=true.
Address, phone, and email fall back to the user's saved profile, and new details are saved back after booking. Status values: needs_info (ask the user for 'missing'), invalid_test_id, needs_confirmation (show the quote), successful (simulated booking with collectionId and schedulingId).
Inputs: user_id (required), test_ids (required), email, notes, +6 more. Returns: object
labloop_update_user_profileSave user detailsAIdempotent
Save new or corrected contact details so future bookings can reuse them.
Only the fields provided are changed. Returns {status, updated_fields, profile}.
Inputs: user_id (required), name, email, phone, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct resource or action: catalog listing, test lookup, provider pricing, booking, profile get/update, and human escalation. The list/find pair is explicitly differentiated by description, and no two tools appear interchangeable.
All tool names consistently use the labloop_ prefix with snake_case verb_noun patterns like list_tests, find_test, get_test_providers, and update_user_profile. The compound quote_or_book_collection is longer but still follows the same predictable convention.
Seven tools is well-scoped for this domain: catalog discovery, pricing, booking, profile management, and escalation. Each tool earns its place with no redundant or filler tools.
Core workflows are covered: browse/find tests, get providers, quote and confirm a booking, and manage user profile. However, there is no way to look up past bookings or cancel a collection, leaving a minor dead end after a successful booking.
Maintenance
Related MCP Connectors
Blood-test markers, lab panels, conditions & symptoms as agent tools. EN/RU/HE. Hosted.
Read-only U.S. lab-test catalog, collection-site search, and reference-range context.
Run Infermedica symptom checks, diagnosis, triage and condition lookups.
Your lab results, DNA files and wearable data explained in your agent, with action plans. EU-hosted.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to manage medical appointments by searching for doctors, checking availability, and booking sessions through a natural language interface. It serves as a reference implementation for advanced MCP features like symptom-based specialist recommendations and multi-step scheduling workflows.-
- FlicenseAqualityDmaintenanceEnables users to interact with the CUF health portal to retrieve patient information, appointments, clinical documents, invoices, and prescriptions through natural language.122-
- FlicenseNot gradedqualityDmaintenanceSimulates a third-party appointment booking agent, enabling your AI platform to check availability and book appointments via MCP interoperability.-
- FlicenseNot gradedqualityCmaintenanceEnables conversational CRUD management of a service catalog and service orders, including item manipulation, search, and business-rule validation through natural language.-