← シフト屋さん Public API

MCP ガイド

シフト屋さんのシフト作成エンジンを MCP サーバーとして公開しています。 AI エージェントから話しかけるだけでシフト表を作成・調整できます。

接続する

使っているクライアントの手順をご覧ください。

エンドポイント

https://api.shiftyasan.com/mcp

Streamable HTTP。1回の呼び出しが1つの POST で完結するステートレスな構成で、 常時接続は張りません。

認証

2通りあり、どちらも Authorization: Bearer で送ります。

方式形式向いている場面
OAuth oat_… Claude.ai / ChatGPT。キーを扱わずに済む。接続時に自動で用意される
API キー sk_live_… Claude Desktop / Code、HTTP 直接。ヘッダーを自分で設定できる場合

OAuth の詳細は 認可サーバーメタデータを参照してください (PKCE S256 必須、public client、動的登録と CIMD の両方に対応)。

利用できるツール

ツール内容認証
validate_shift_input リクエストがスキーマに合っているかを検証する。解く前に必ずこれを呼ぶ 不要
solve_shift シフトを作成する。規模が大きいと 202 と job_id を返す 必要
get_solve_job 202 で返ったジョブの完了を待つ。running の間は約15秒間隔で再取得する 必要

validate_shift_input は無料・無認証です。エージェントに 「解く前に必ず検証を通す」と指示しておくと、無駄な失敗が減ります。

解けるまでの時間

問題の規模に応じて実行先が自動で切り替わります。小さい問題は数秒〜十数秒で同期的に返り、 大きい問題は 202 でジョブ化されます。ジョブは get_solve_job で完了を待ってください。

⚠️ 期間の上限は 31日です。それより長い期間は分割して依頼してください。

結果の読み方で注意すること

うまくいかないとき

401 が返る

OAuth なら再接続、API キーなら ダッシュボードでキーが有効かを確認してください。 キーを無効化すると、そのキーに紐づく OAuth 接続も止まります。

429 が返る

レート制限です。Retry-After ヘッダーの秒数だけ待ってから再試行してください。

設定に接続の項目(コネクタ/Plugins)が見当たらない

クライアント側のプランや提供状況によります。 ChatGPT / Claude の各ページに、条件と代替手段をまとめています。

npm パッケージ(@shiftyasan/mcp-server)はもう使えない?

使えます。既存の設定はそのまま動きます。ただしローカル実行なので Node.js 20 以上が必要で、 更新もご自身で行う必要があります。新規であればリモート接続を推奨します。

HTTP API を直接使う

MCP を介さず REST で呼ぶこともできます。OpenAPI は こちら。 検証だけなら無認証で試せます。

curl -X POST "https://api.shiftyasan.com/v1/public/solve/validate" \
  -H 'Content-Type: application/json' \
  -d '{"schedule_period":{"start_date":"2026-09-01","end_date":"2026-09-07"}}'

← Shiftyasan Public API

MCP guide

Shiftyasan's scheduling engine is available as an MCP server, so AI agents can build and adjust shift schedules conversationally.

Connecting

Follow the guide for your client.

Endpoint

https://api.shiftyasan.com/mcp

Streamable HTTP. Each call is a single POST — the server is stateless and holds no long-lived connection.

Authentication

Two kinds of token, both sent as Authorization: Bearer.

KindFormatUse when
OAuth oat_… Claude.ai / ChatGPT. No key handling — provisioned when you connect
API key sk_live_… Claude Desktop / Code, or direct HTTP — anywhere you can set a header yourself

For OAuth details see the authorization server metadata (PKCE S256 required, public client, both dynamic registration and CIMD supported).

Tools

ToolWhat it doesAuth
validate_shift_input Checks a request against the schema. Always call this before solving none
solve_shift Builds the schedule. Large problems return 202 with a job_id required
get_solve_job Polls a job from 202. While running, retry about every 15 seconds required

validate_shift_input is free and needs no auth. Telling your agent to always validate before solving cuts down on wasted failures.

How long solving takes

Where the problem runs is chosen automatically by size. Small problems return synchronously in seconds; large ones come back as a 202 job — wait for it with get_solve_job.

⚠️ Schedules are capped at 31 days. Split longer periods into separate requests.

Reading the result

Troubleshooting

I get a 401

With OAuth, reconnect. With an API key, check it is still enabled in the dashboard. Disabling a key also stops the OAuth connections that resolve to it.

I get a 429

Rate limited. Wait the number of seconds in the Retry-After header, then retry.

I cannot find the connection setting (Connectors / Plugins)

It depends on your client's plan and rollout. The ChatGPT and Claude pages cover the requirements and the alternatives.

Is the npm package (@shiftyasan/mcp-server) still usable?

Yes — existing setups keep working. It runs locally, so it needs Node.js 20+ and you update it yourself. For a new setup, the remote connection is recommended.

Using the HTTP API directly

You can call the REST API without MCP. The OpenAPI document is here. Validation is free and needs no auth.

curl -X POST "https://api.shiftyasan.com/v1/public/solve/validate" \
  -H 'Content-Type: application/json' \
  -d '{"schedule_period":{"start_date":"2026-09-01","end_date":"2026-09-07"}}'