Skip to main content
Glama
subaru-mcp

subaru-mcp

subaru-mcp

An MCP server that lets an AI assistant read, and carefully control, one Subaru through MySubaru Connected Services. It is built on subarulink and FastMCP.

  • Reads by default. Fuel, odometer, tires, doors, locks, location, maintenance and more, from the copy cached on Subaru's servers. The car is not woken.

  • Wakes are rationed. Asking the car for fresh data drains its 12V battery, so it sits behind a budget.

  • Controls are opt-in. Lock, unlock, remote start and the rest do not exist until you turn them on, and unlock needs a second flag.

  • Never open to the internet without sign-in. Over HTTP, one GitHub account is allowed and nothing else.

Unofficial, and it acts on a real car. This project is not affiliated with or endorsed by Subaru. Subaru publishes no API, so it can break without notice, and using it may be against the MySubaru terms. It can unlock doors and start an engine: read Controls before enabling them. You use it at your own risk.

Status

Built for and run against one car: a 2026 Outback (g4 telematics, USA, Companion+ plan).

Run live

Every read tool, refresh_status, remote_start and remote_stop (both confirmed by the car). HTTP mode through Tailscale Funnel, from the Claude apps and from Grok Bot.

Mocks only so far

lock, unlock, horn, lights, save_climate_preset, delete_climate_preset. locate uses the same wake as refresh_status but has not been called live.

Untested

Any other model, year or country. Other cars subarulink supports should work for reads. Electric-vehicle charging is not exposed.

An account with more than one vehicle is refused: no tool takes or returns a VIN.

Related MCP server: bluelink-mcp

Requirements

  • Linux (or WSL) with Python 3.14 and uv.

  • A MySubaru account with one vehicle. Remote commands and waking the car need a plan with remote services (Companion+) and the account PIN.

  • Optional: the 1Password CLI for secrets. For HTTP mode: a GitHub account and a tunnel that provides public HTTPS, such as Tailscale Funnel.

Setup

git clone https://github.com/thatapplefreak/subaru-mcp
cd subaru-mcp
uv sync

1. Secrets

The server needs SUBARU_USERNAME, SUBARU_PASSWORD and SUBARU_PIN when it first connects. The recommended home for them is 1Password, fetched with op read through a service account so the server can start unattended.

Copy deploy/secrets.env.example to ~/.config/subaru-mcp/secrets.env (or the path in SUBARU_MCP_ENV_FILE). It holds the service account token and references, never the MySubaru values:

OP_SERVICE_ACCOUNT_TOKEN=ops_...
SUBARU_USERNAME=op://Automation/MySubaru/username
SUBARU_PASSWORD=op://Automation/MySubaru/password
SUBARU_PIN=op://Automation/MySubaru/pin

The file must be mode 0600, owned by you, and outside any git repository, or the server refuses to read it. The token is passed to op through its environment, never on the command line.

One-time 1Password setup:

  1. Put the MySubaru login in a vault a service account can read. Service accounts cannot read Private/Personal vaults, so use a dedicated one.

  2. Create a service account at 1password.com (Developer > Service Accounts) with read-only access to that vault only.

  3. Paste its token into secrets.env and fix the references if your names differ.

Other ways to supply the values:

  • Variables already in the process environment win over the file, so op run --env-file <refs> -- uv run subaru-mcp also works.

  • Plain values instead of op:// references work too, without 1Password.

SUBARU_PIN is optional. Without it cached reads work; waking the car and commands do not.

2. Log in once (2FA)

uv run subaru-mcp-login

Interactive. It creates a device ID in ~/.local/state/subaru-mcp/device_id (mode 0600), logs in, walks through MySubaru's emailed or texted code, and prints what the account supports (telematics generation, remote services, remote engine start). It sends nothing to the car and does not test the PIN, because Subaru's PIN check is a locate command that wakes the car.

Keep the device ID file. A new one forces 2FA again.

3. Use it locally (stdio)

.mcp.json registers the stdio server as subaru for Claude Code: start Claude Code in this directory and approve the server. Any other MCP client that launches a command can run uv run subaru-mcp the same way.

4. Use it remotely (HTTP mode)

MCP client ──https──> tunnel (Tailscale Funnel) ──http──> 127.0.0.1:8765 (this server)
                                                            └─ sign-in ──> GitHub OAuth app

The server always listens on 127.0.0.1; that is not configurable. It refuses to start in HTTP mode unless the public URL, the allowed GitHub account and the OAuth app secrets are all present.

Who gets in. One GitHub account, matched by numeric ID and login, checked at sign-in and again on every request. A signed-in client can only be sent back to an address on a fixed list (Claude's callback URLs and loopback ports by default), so a crafted sign-in link cannot deliver a token elsewhere.

Settings go in ~/.config/subaru-mcp/server.env, copied from deploy/server.env.example. No secrets belong there.

Variable

SUBARU_MCP_BASE_URL

The tunnel's public URL, https://<machine>.<tailnet>.ts.net. No path.

SUBARU_MCP_PORT

Loopback port. Default 8765.

SUBARU_MCP_GITHUB_LOGIN, SUBARU_MCP_GITHUB_USER_ID

The allowed account. gh api user --jq .id prints the ID.

Secrets (in secrets.env, as op:// references or plain values): SUBARU_MCP_GITHUB_CLIENT_ID, SUBARU_MCP_GITHUB_CLIENT_SECRET. The key that signs this server's own tokens is generated on first start in ~/.local/state/subaru-mcp/oauth_signing_key.

Steps:

  1. GitHub OAuth app. github.com > Settings > Developer settings > OAuth Apps > New. Homepage URL: the base URL. Authorization callback URL: <base URL>/auth/callback. Store the client ID and a new client secret where the two references point.

  2. Service. deploy/subaru-mcp.service is a systemd user unit. It assumes the repository is at ~/code/subaru-mcp and that op is on the PATH it sets; edit both if yours differ. Link it, so the copy in the repository stays the one in use, and start it:

    systemctl --user link ~/code/subaru-mcp/deploy/subaru-mcp.service
    systemctl --user enable --now subaru-mcp
    curl -i -X POST http://127.0.0.1:8765/mcp    # must answer 401

    After editing the unit file: systemctl --user daemon-reload && systemctl --user restart subaru-mcp. After changing the code or server.env: systemctl --user restart subaru-mcp. Logs: journalctl --user -u subaru-mcp -f.

  3. Tunnel. With Tailscale: enable HTTPS certificates and Funnel for the machine in the admin console, then run tailscale funnel --bg 8765 (on Windows itself if the server runs in WSL with mirrored networking). Do this last: it is the step that makes the server reachable from the internet.

  4. Client. In Claude: Settings > Connectors > Add custom connector, URL <base URL>/mcp. Sign in with GitHub when prompted.

To cut off access at once: tailscale funnel reset, or stop the service.

Expect internet scanners to probe the public URL within hours. They get 401 or 404.

Other clients (Grok Bot and others)

Who may sign in never changes: the one GitHub account. What differs per client is the address sign-in returns to, and only listed addresses are accepted.

Setting (in server.env)

Effect

SUBARU_MCP_ALLOW_GROKBOT=true

Accepts Grok Bot's two callback addresses.

SUBARU_MCP_EXTRA_REDIRECT_URIS=

Exact callback URLs for any other client, comma-separated. Wildcards, credentials and non-local http are refused at start.

Restart the service after changing either.

Grok Bot: add a custom MCP server with the same URL, <base URL>/mcp, then sign in with GitHub when it asks. Three things to know:

  • xAI publishes no list of Grok Bot's callback addresses. The two used here come from Grok Bot forum threads. If sign-in is refused with a "redirect URI is not allowed" message, put the address from that message in SUBARU_MCP_EXTRA_REDIRECT_URIS.

  • Finish the sign-in within about 15 minutes of starting it, or Grok Bot rejects the result as expired.

  • Whether Grok Bot asks for confirmation before running a tool marked destructive has not been checked. Find out before enabling controls on a server Grok Bot can reach; the flags apply to every connected client.

Tools

Tool

Wakes the car?

Notes

status

No

Full cached snapshot. The default for every question.

fuel, tire_pressure, odometer, lock_status

No

Slices of the same snapshot.

list_climate_presets

No

UNSUPPORTED without remote engine start.

capabilities

No

What the car and plan support.

maintenance

No

Next services with miles remaining, and dealer service history.

software_updates

No

Over-the-air update campaigns and install status.

remote_activity

No

This month's remote actions on the car, from any device.

valet_and_alerts

No

Valet mode, boundary, speed and curfew alert settings.

refresh_status, locate

Yes

Drain the 12V battery. Share one wake budget.

Every snapshot carries data_freshness: when the car last reported and how old that is. Errors are [CODE] message, for example [UNSUPPORTED], [WAKE_BUDGET], [DEVICE_2FA_REQUIRED], [AUTH_FAILURE].

No tool takes or returns a VIN.

Controls (off by default)

Flag

Effect

SUBARU_ENABLE_CONTROLS=true

Adds lock, remote_start, remote_stop, horn, lights, save_climate_preset, delete_climate_preset.

SUBARU_ENABLE_UNLOCK=true

With the flag above, also adds unlock (all doors, driver's door, or tailgate). Does nothing alone.

Only the literal word true enables a flag. Without it the tools are not registered at all, so clients cannot see or call them. The flags apply to every client connected to the server.

  • Every control is marked destructive, which asks clients to confirm before running it. Whether a client does is up to that client: check yours.

  • Success is reported only when the car confirms. Otherwise the result is [UNCONFIRMED] and the command is never retried.

  • remote_start(preset_name) needs an exact preset name (case ignored). On a mismatch nothing is sent and the real names are listed.

  • 2026 Outback quirk: remote start can start the engine while MySubaru reports failure. The error says so and tells the client not to resend. Treat [UNCONFIRMED] as "the engine may be running".

  • Never remote start in an enclosed space. If you automate it, do not let the automation close a garage door after a start it could not confirm.

  • Commands have their own budget: SUBARU_COMMAND_COOLDOWN_SECONDS (default 30, minimum 10) and SUBARU_COMMAND_DAILY_CAP (default 20), logged in ~/.local/state/subaru-mcp/command_log.json.

  • Preset edits change the MySubaru account only. They do not wake the car. Seat cooling can only be set in the MySubaru app.

  • Not implemented: valet mode, boundary/speed/curfew alerts, send-destination and trip logging. subarulink has no code for them and their request formats are unverified. See docs/mysubaru-api.md.

Wake budget

Defaults: at most one wake every 2 hours and 3 per rolling 24 hours, stored in ~/.local/state/subaru-mcp/wake_log.json so restarts do not reset it. An attempt is charged when it is sent, even if the car never answers.

Variable

Default

SUBARU_WAKE_COOLDOWN_MINUTES

120

Minimum 5.

SUBARU_WAKE_DAILY_CAP

3

0 disables waking.

Safety properties

  • Exception text from subarulink is never forwarded: it can contain raw API responses, the VIN and the PIN. Clients get a fixed message per error code.

  • Every log record is scrubbed (VIN, PIN, credentials, tokens, cookies), and subarulink logging is held at WARNING because its DEBUG output prints the PIN.

  • Each tool call and its outcome is logged, without arguments, as an audit trail.

  • A rejected password is not retried until restart, to avoid locking the account.

  • 2FA only happens in subaru-mcp-login, never inside a tool call.

  • There is no generic "send this request" tool, and extra reads go through a fixed allowlist of GET paths.

To report a security problem, see SECURITY.md.

Development

uv run subaru-mcp                     # stdio
uv run subaru-mcp --transport http    # loopback HTTP; needs the settings above
uv run pytest        # mocks only; a fixture blocks real network connections
uv run ruff check . && uv run ruff format --check .

tests/test_subarulink_contract.py runs the real subarulink package against canned JSON and asserts that a cached status read requests read endpoints only. subarulink is pinned below 0.8 because the extra reads use its private connection object; that test fails if an upgrade changes it.

Never run live lock, unlock, remote start, horn or lights from tests or automation. Live smoke tests are cached status only. In tests the fake controller fails any test that reaches a command without opting in.

Never put a VIN, a login, a PIN, a token or a cookie in an issue, a pull request or a test. Test data uses made-up values.

API notes

docs/mysubaru-api.md records what the MySubaru API returns for a 2026 Outback: feature codes, every endpoint checked, what is not available, and the command paths.

g4 caveats

subarulink 0.7.21 is the first release with g4 support and upstream says some g4 behaviour is still being characterized. If Subaru's reply is missing a field subarulink expects, status returns what it could read and sets data_freshness.partial.

Acknowledgements

Subaru, MySubaru and STARLINK are trademarks of Subaru Corporation.

License

MIT.

Available Tools

13 tools
capabilitiesCapabilitiesA
Read-onlyIdempotent

What this car and its MySubaru plan support: remote start, climate and seat options, valet mode, lock and window reporting. Does not wake the car.

Inputs: no named parameters. Returns: object

fuelFuelA
Read-onlyIdempotent

Cached fuel level, range and average MPG. Does not wake the car.

Inputs: no named parameters. Returns: object

list_climate_presetsList Climate PresetsA
Read-onlyIdempotent

List remote-start climate presets by exact name. Does not wake the car. Returns UNSUPPORTED if the plan has no remote engine start.

Inputs: no named parameters. Returns: object

locateLocateA

WAKES THE CAR and drains its 12V battery. Returns its current location. For the last known location without waking the car, use status. Limited by a wake budget; can take a few minutes.

Inputs: no named parameters. Returns: object

lock_statusLock StatusA
Read-onlyIdempotent

Cached door lock state as of the car's last report. Does not wake the car, so it can be stale: check data_freshness before calling it locked.

Inputs: no named parameters. Returns: object

maintenanceMaintenanceA
Read-onlyIdempotent

Next scheduled services with miles remaining and the work each includes, plus the dealer service history. Does not wake the car.

Inputs: no named parameters. Returns: object

odometerOdometerA
Read-onlyIdempotent

Cached odometer reading in miles. Does not wake the car.

Inputs: no named parameters. Returns: object

refresh_statusRefresh StatusA

WAKES THE CAR and drains its 12V battery. Asks the car to report fresh status, then returns the full snapshot. Only use when the user explicitly asks for fresh data. Limited by a wake budget; can take a few minutes.

Inputs: no named parameters. Returns: object

remote_activityRemote ActivityA
Read-onlyIdempotent

Log of remote actions on the car this month (lock, unlock, engine start, locate, alerts), from any app or device on the account. Use it to audit what was done remotely. Does not wake the car.

Inputs: no named parameters. Returns: object

software_updatesSoftware UpdatesA
Read-onlyIdempotent

Over-the-air software update campaigns for the car and whether each is installed. Does not wake the car.

Inputs: no named parameters. Returns: object

statusStatusA
Read-onlyIdempotent

Full cached snapshot of the car: fuel, odometer, tires, doors, windows, locks, last known location, warning lights, and when the car last reported. Does not wake the car. Use this by default.

Inputs: no named parameters. Returns: object

tire_pressureTire PressureA
Read-onlyIdempotent

Cached tire pressures in PSI with the recommended values. Does not wake the car. Pressures only update while the car is moving.

Inputs: no named parameters. Returns: object

valet_and_alertsValet And AlertsA
Read-onlyIdempotent

Valet mode status and settings, and the boundary, speed and curfew alerts configured for the car. Read-only. Does not wake the car.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 13 tools

    Disambiguation4/5

    The aggregate `status` tool overlaps with `fuel`, `odometer`, `tire_pressure`, and `lock_status`, but the descriptions clearly position `status` as the default and the others as targeted cached reads. The two wake actions, `refresh_status` and `locate`, are also clearly distinguished from their cached equivalents.

    Naming Consistency4/5

    All names use snake_case and are readable, with most being noun/resource names and a few action names (`list_climate_presets`, `refresh_status`, `locate`). This is mostly predictable, though it is not a strict verb_noun convention throughout.

    Tool Count5/5

    The 13 tools sit comfortably in the appropriate range and each maps to a distinct vehicle data domain or wake action. The aggregate `status` tool does not make the targeted readers redundant, since they support narrower queries without waking the car.

    Completeness3/5

    The server covers a broad read-only surface: fuel, tires, locks, maintenance, software updates, valet mode, alerts, remote activity, and location. However, there are no remote command tools for locking, unlocking, remote start, or climate activation, so capabilities and climate presets can be listed but not acted upon, leaving notable gaps.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables a local Grok Bot to talk to the unofficial MySubaru API over stdio, supporting vehicle status, locate, tire pressure, fuel, odometer, climate presets, and explicit lock/unlock/remote start actions without exposing secrets.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to monitor a Hyundai, Kia, or Genesis vehicle's charge, fuel, range, locks, and location, and optionally pre-heat the cabin, lock or unlock doors, and start or stop charging. Reads come from cached Bluelink data with rate-limited refreshes, and all write commands are disabled by default.
      23
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables chat agents and automation tools to query Tesla vehicle status and, when explicitly enabled, send signed vehicle commands via MCP over Streamable HTTP or local stdio.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to read and control Hyundai, Kia, or Genesis vehicles, including locking and unlocking, remote climate, charging, status, location, trips, and other supported remote commands.
      MIT