Skip to content

MCP ​

Overview ​

With MCP (Model Context Protocol), you can use your own SESAME devices from AI apps that support remote MCP servers, such as Claude and Codex:

  • View your device list and device status;
  • Lock, unlock, and update firmware;
  • Create, view, and cancel scheduled lock / unlock / firmware updates;
  • Look up product usage and the after-sales policy.

You need a SESAME Biz API key to connect. After connecting, sign in to your SESAME account in the conversation with a verification code sent to your email, and the AI can then operate the devices in your account on your behalf. The AI app never receives your password.

Connection details ​

ItemValue
Endpointhttps://jhcr1i3ecb.execute-api.ap-northeast-1.amazonaws.com/prod/mcp
TransportStreamable HTTP, POST only
Protocol version2026-07-28; also compatible with 2025-11-25, 2025-06-18, 2025-03-26
StateStateless: no session is issued (Mcp-Session-Id); each request is handled independently
Responseapplication/json, or text/event-stream containing a single result

Request headers ​

HeaderRequiredDescription
x-api-keyYesYour SESAME Biz API key. Get it from SESAME Biz [Developer page]
x-mcp-clientNoA name that separates sign-in states: 1–32 lowercase letters, digits, or -, such as claude-code or codex. Without this header it is default; if present but empty or invalid, the request returns 400

API key and x-mcp-client ​

  • Sign-in state is stored per "Biz account that owns the API key + x-mcp-client". It persists across conversations until auth_logout is called.
  • Members of the same Biz account share one API key. Each member must set a different x-mcp-client; otherwise they share one sign-in state and end up using a SESAME account someone else signed in with.
  • x-mcp-client is set by the client itself and is not a permission boundary: anyone who has the same key and knows another member's x-mcp-client can use that member's sign-in state. Only give the API key to members you trust.
  • After you change your API key, the old key can no longer call tools.

Connecting from an AI app ​

After connecting, the AI app reads the tool list and the server's usage instructions (instructions) and calls tools according to those rules.

claude.ai (custom connector) ​

  1. In claude.ai's connector settings, choose "Add custom connector".
  2. Enter the endpoint as the URL, and add an x-api-key request header with your API key.
  3. Once added, the connector is also available in the Claude mobile app and Claude Code.

x-mcp-client

Adding x-mcp-client to a claude.ai custom connector requires review by claude.ai. Without it, the value is default: every connection under the same Biz account that has no x-mcp-client shares one sign-in state. If several people share a key, have the other members set their own x-mcp-client in clients such as Claude Code or Codex.

Claude Code ​

Add it from the command line:

bash
claude mcp add --transport http candyhouse \
  https://jhcr1i3ecb.execute-api.ap-northeast-1.amazonaws.com/prod/mcp \
  --header "x-api-key: <YOUR_API_KEY>" \
  --header "x-mcp-client: claude-code"

Or configure it in the project's .mcp.json. headers supports ${VAR} environment variable references, so the key stays out of the repository:

json
{
  "mcpServers": {
    "candyhouse": {
      "type": "http",
      "url": "https://jhcr1i3ecb.execute-api.ap-northeast-1.amazonaws.com/prod/mcp",
      "headers": {
        "x-api-key": "${CANDYHOUSE_API_KEY}",
        "x-mcp-client": "claude-code"
      }
    }
  }
}

See the Claude Code MCP documentation for details.

Codex ​

  1. Open "Plugins", switch to the "MCP" tab, and click "Add".
  2. Enter the endpoint as the URL.
  3. Add the headers x-api-key (your API key) and x-mcp-client (such as codex).

See the Codex plugins documentation for details.

Other clients ​

Any MCP client that supports Streamable HTTP and custom request headers can connect. Clients that cannot set custom headers (such as ChatGPT connectors) are not supported at this time.

Signing in ​

  1. Ask the AI to view or operate a device. If you are not signed in, the AI asks for the email address you use in the SESAME app.
  2. The AI calls auth_start, and a verification code is sent to that address.
  3. Tell the AI the code; it calls auth_verify to complete sign-in.
  • The verification code expires, and the number of incorrect attempts is limited. After it expires or the limit is reached, call auth_start again. After too many failures in a short time, the account is temporarily locked for up to about an hour.
  • To switch SESAME accounts, have the AI call auth_logout first.

Tools ​

  • deviceId must come from device_list, and scheduleId from schedule_list. Do not construct them yourself.
  • You can only operate devices and schedules in your own account; devices you hold a guest key for are not included. Passing someone else's ID is treated as "not found", and nothing is executed.

Sign-in ​

ToolParametersDescription
auth_startemailSend a verification code to the email address
auth_verifycodeCheck the code and complete sign-in
auth_logoutNoneSign out and clear the sign-in state

Devices (sign-in required) ​

ToolParametersDescription
device_listNoneDevice list
device_statusdeviceIdLatest known device status: lock state, online, battery, firmware version, etc.
lockdeviceIdLock
unlockdeviceIdUnlock
upgrade_firmwaredeviceIdStart a firmware update
  • lock, unlock, and upgrade_firmware return as soon as the command is accepted. They do not guarantee the device has moved, and no result is pushed afterwards. The status right after a command may still be the old one; check again after a few seconds.
  • Calling upgrade_firmware again on the same device within 30 seconds returns ACTION_IN_PROGRESS.

Schedules (sign-in required) ​

ToolParametersDescription
schedule_createSee belowCreate a schedule
schedule_listNoneOne-time schedules not yet fired, and active recurring schedules
schedule_cancelscheduleIdCancel a schedule; a cancelled recurring schedule stops firing

schedule_create parameters:

ParameterTypeRequired whenDescription
actionstringAlwayslock, unlock, or upgrade_firmware
deviceIdstringAlwaysTarget device
timingTypedelay / at / recurringAlwaysOnce after a delay / once at a time / recurring
delaySecondsintegertimingType is delaySeconds from now, 60–31536000
atIsostringtimingType is atLocal time without a time zone suffix, such as 2026-12-01T08:00:00; must be in the future. Do not append Z or +09:00
patterndaily / weekdays / weekends / weekly / monthlytimingType is recurringEvery day / weekdays / weekends / weekly / monthly
hourintegertimingType is recurring0–23
minuteintegertimingType is recurring0–59
dayOfWeekintegerpattern is weekly1–7, 1 is Monday and 7 is Sunday
dayOfMonthintegerpattern is monthly1–31; skipped in months without that day
timezonestringOptionalIANA time zone name, such as America/New_York. atIso, hour, and minute are interpreted in this zone; if omitted, Japan time (Asia/Tokyo). An invalid name returns PARAMETER_FAILED
  • Time zones with daylight saving time: if a recurring schedule's time does not exist on the day DST starts, that day is skipped; if it occurs twice on the day DST ends, it fires once. If a one-time schedule's time does not exist, it moves forward by the DST shift; if it occurs twice, the first one is used.
  • The server executes the action at the scheduled time and does not push the result. A fired one-time schedule disappears from schedule_list; call device_status to check the outcome.

Knowledge base and after-sales policy (no sign-in required) ​

ToolParametersDescription
knowledge_searchquery; optional product, topKSearch help center articles and support replies; returns relevant snippets, not an answer
support_policyNoneFull after-sales and purchase policy (warranty, repair fees, exchanges and returns, adapter prices, shipping, receipts, order cancellation, lockout compensation), plus rules for answering policy questions

The after-sales policy is also available as a resource: policy://candyhouse/support-policy (Markdown), readable with resources/list and resources/read.

Tool result format ​

  • content has a single text item: the tool result as JSON text, with fields such as ok, message, and data. The result is meant for the AI to read; its field structure is not guaranteed to be stable, so do not depend on it in code.
  • On a business failure (not signed in, device not found, invalid parameters, etc.), isError is true and data.reason gives the reason. The AI can correct the call and retry.

Common data.reason values:

ValueMeaning
NOT_AUTHENTICATEDNot signed in, or the sign-in has expired
DEVICE_NOT_FOUNDDevice not found, or not yours
SCHEDULE_NOT_FOUNDSchedule not found: already fired, cancelled, or not yours
PARAMETER_FAILEDInvalid parameters, such as an invalid time zone name, an atIso in the past, or an action that cannot be scheduled
ACTION_IN_PROGRESSA firmware update on the same device is in progress

Failure example (content[0].text):

json
{
  "ok": false,
  "resultType": "DEVICE_LIST",
  "message": "You are not logged in or your session has expired. Please log in first.",
  "data": { "action": "device_list", "reason": "NOT_AUTHENTICATED", "chatType": "user" }
}

Error handling ​

HTTP status codes ​

StatusSourceSituationWhat to do
400Serverx-mcp-client is empty or invalid (INVALID_MCP_CLIENT); batch request (BATCH_NOT_SUPPORTED); request violates the MCP protocol, such as headers not matching the bodyFix the request; send batch items one at a time
401GatewayNo x-api-keyAdd the header
403GatewayInvalid API keyCheck the key
403ServerThe API key has been replaced (API_KEY_REJECTED)Use the new key
405ServerA method other than POSTUse POST only
429ServerMonthly quota used up (QUOTA_EXCEEDED); no Retry-AfterRetrying will not help; wait for the monthly reset or upgrade your plan
429GatewayToo many requestsRetry later
503ServerQuota check temporarily unavailable (QUOTA_UNAVAILABLE)Retry later

Gateway errors are not in JSON-RPC format. When the server rejects a request before processing it as MCP, it returns a JSON-RPC error, with error.data.reason giving the reason:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": { "code": -32000, "message": "Monthly API usage quota exceeded", "data": { "reason": "QUOTA_EXCEEDED" } }
}

JSON-RPC error codes ​

error.codeMeaning
-32600Invalid request, including INVALID_MCP_CLIENT and BATCH_NOT_SUPPORTED
-32601Method or tool not found
-32602Tool arguments do not match the inputSchema
-32603Server error while running the tool
-32000Rejected by the server before processing; see error.data.reason

Quota and limits ​

  • Each tools/call counts toward the API key's usage quota, shared with the Web API; other requests such as initialize and tools/list do not count. See SESAME Biz [Developer page] for quotas and plans.
  • The endpoint has an overall request rate limit; exceeding it returns 429.
  • Not provided: group features, image search, tool list change notifications.