---
title: "Docs MCP"
description: "Give your AI coding assistant full context about the Leyr API - docs, endpoint reference, and use-case guides via MCP."
canonical_url: "http://localhost/product/mcp/docs-mcp"
---
# Docs MCP
> Give your AI coding assistant full context about the Leyr API - docs, endpoint reference, and use-case guides via MCP.
Add one URL to your IDE. Your AI assistant gets full access to every Leyr endpoint, use-case guide, and code example - and can write correct integration code from your first prompt.
**No credentials required to start. No install.** Your AI can even create your Leyr account, app, and first EMR connection for you, right from the chat.
---
## What your AI can do
Ask your AI to generate working Python or JavaScript for any Leyr workflow - booking appointments, writing notes, finding patients - and get code that matches the actual API contracts.
Search all 40+ Leyr API endpoints by keyword, tag, or path. Get full parameter details, request shapes, and response schemas without leaving your editor.
Step-by-step quickstarts for every major workflow - from showing doctor availability to attaching documents - with complete end-to-end flows.
Patient ID formats, error codes, EHR-specific quirks, rate limits - your AI can answer instantly using the real Leyr documentation.
---
## Setup
No installation required. The MCP server runs as part of the Leyr docs site - just point your IDE at the URL.
No Leyr account needed to use the docs server.
### Add to your IDE
Add to `~/.cursor/mcp.json`:
```json
{
"mcpServers": {
"leyr-docs": {
"url": "https://docs.leyr.io/mcp"
}
}
}
```
Add to your MCP settings (Windsurf Settings → MCP Servers):
```json
{
"mcpServers": {
"leyr-docs": {
"url": "https://docs.leyr.io/mcp"
}
}
}
```
Run in your terminal:
```bash
claude mcp add --transport http leyr-docs https://docs.leyr.io/mcp
```
Or edit `~/Library/Application Support/Claude/claude_desktop_config.json` manually:
```json
{
"mcpServers": {
"leyr-docs": {
"url": "https://docs.leyr.io/mcp"
}
}
}
```
Open the Command Palette (`⇧⌘P` / `Ctrl+Shift+P`), run **MCP: Add Server**, choose **HTTP**, and enter:
```text
https://docs.leyr.io/mcp
```
The Leyr MCP server is available at:
```text
https://docs.leyr.io/mcp
```
Transport: **Streamable HTTP** (MCP spec 2025-11-25). Refer to your IDE or MCP client documentation for instructions on how to add an HTTP MCP server.
Restart your IDE after saving the config.
---
## Available tools
|
Tool
|
What it does
|
list_use_cases
|
List all use-case guides and the recommended execution order
|
show_doctor_availability
|
Guide: care units → resources → services → timeslots
|
book_appointment
|
Guide: book a patient appointment
|
write_medical_note
|
Guide: write a medical note for a patient
|
attach_document
|
Guide: attach a document to a patient record
|
find_patient
|
Guide: search for a patient and retrieve their ID
|
create_patient
|
Guide: create or upsert a patient record
|
search_docs
|
Full-text search across all Leyr documentation
|
get_doc_page
|
Fetch a specific documentation page by slug
|
list_doc_sections
|
Browse all available documentation sections
|
get_openapi_schema
|
Full OpenAPI schema summary with all endpoints listed
|
search_endpoints
|
Search endpoints by keyword, tag, or path
|
get_endpoint
|
Get full details for a specific endpoint
|
### Administration
No Leyr account yet? Your AI can set one up for you - account, app, and EMR connection. The one step that stays yours: opening the verification email and clicking the link, same as any other signup.
|
Tool
|
What it does
|
register_account
|
Create a new Leyr account; sends a verification email
|
login
|
Sign in once the account is verified
|
list_apps
|
List the apps on the signed-in account
|
get_app
|
Get a single app by id, including its connected EMRs
|
create_app
|
Create a new app; returns the
client_id
/
client_secret
pair used for live API calls
|
list_emrs
|
List every EHR/EMR Leyr can connect to, with required credential fields and mock availability
|
connect_emr
|
Connect an EMR to an app - sandbox mock connection or a real one with your own credentials
|
---
## Example prompts
Once connected, try asking your AI:
> *"Show me the full availability and booking flow for Webdoc in Python"*
> *"Look up a patient by Swedish personal number and show me the exact request shape"*
> *"Write a medical note for patient 12345 using the unstructured template"*
> *"What's the difference between emr_id and se_personal_number patient IDs?"*
> *"List all endpoints that support creating resources in Webdoc"*
> *"Set me up with a Leyr account at me@example.com and create an app called 'My Integration'"*
> *"What EHR systems can you connect to, and which ones can I try without real credentials?"*
> *"Connect my app to Webdoc in sandbox mode so I can start testing"*
---
## Ready to make real API calls?
Once your account, app, and an EMR connection exist - whether you set them up here or in the [Developer Portal](https://leyr.io/developers) - use the [Clinical MCP](http://localhost/product/mcp/health-mcp) to execute live API calls directly from your AI assistant: book appointments, write notes, manage patients, and more.
Set up Clinical MCP
---
Questions, requests, or suggestions for our MCP? Reach out at [contact@leyr.io](mailto:contact@leyr.io).
## Sitemap
See the full [sitemap](http://localhost/sitemap.md) for all pages.