wardrowbe-mcp

wardrowbe-mcp

Exposes the Wardrowbe wardrobe API as MCP tools, enabling outfit suggestions, item management, wear/wash logging, and analytics via natural language.

Category
访问服务器

README

wardrowbe-mcp

MCP (Model Context Protocol) server exposing the Wardrowbe wardrobe API as tools an LLM can call. Works against any Wardrowbe instance — self-hosted (e.g., behind a reverse proxy or the ha-wardrowbe Home Assistant add-on) or a hosted/cloud deployment.

22 tools covering outfit suggestions, item browsing, wear/wash logging, acceptance flow, analytics, and notifications. Tool surface mirrors hacs-wardrowbe's LLM API one-for-one, plus three read-only helpers (list_items, get_item, get_outfit).

Install

pip install wardrowbe-mcp

Or from source:

pip install git+https://github.com/saya6k/mcp-wardrowbe

Run

wardrowbe-mcp \
  --wardrowbe-url https://wardrowbe.example.com \
  --api-key "$(openssl rand -hex 32)" \
  --auth oidc \
  --oidc-issuer-url https://id.example.com \
  --oidc-client-id wardrowbe \
  --oidc-refresh-token "<refresh-token>"

The process listens on 0.0.0.0:8080 by default and serves both transports at the root:

  • http://<host>:8080/mcp — Streamable HTTP (recommended)
  • http://<host>:8080/sse — Server-Sent Events (legacy MCP clients)
  • http://<host>:8080/ — anonymous health/info probe

All non-probe routes require Authorization: Bearer <api-key>.

Stdio transport (for proxies)

Bridges like sparfenyuk/mcp-proxy and the HASS-MCPProxy add-on spawn MCP servers as child processes and read JSON-RPC frames from their stdout. Pass --transport stdio (or set MCP_TRANSPORT=stdio) to run in that mode:

wardrowbe-mcp --transport stdio \
  --wardrowbe-url https://wardrowbe.example.com \
  --auth oidc --oidc-issuer-url https://id.example.com \
  --oidc-client-id wardrowbe --oidc-refresh-token "<refresh-token>"

stdio mode skips Starlette/uvicorn and the Bearer middleware (--host, --port, --api-key are ignored) — the parent proxy owns the trust boundary. Backend auth (--auth) still applies because it controls how the server reaches the wardrowbe backend.

HASS-MCPProxy servers.yaml example

- name: wardrowbe
  enabled: true
  type: github-python
  repo: "https://github.com/saya6k/mcp-wardrowbe"
  branch: "main"
  install: "uv pip install -e ."
  run: "python -m wardrowbe_mcp --transport stdio"
  args: []
  env:
    WARDROWBE_URL: "https://wardrowbe.example.com"
    MCP_AUTH_MODE: "oidc"
    MCP_OIDC_ISSUER_URL: "https://id.example.com"
    MCP_OIDC_CLIENT_ID: "wardrowbe"
    MCP_OIDC_REFRESH_TOKEN: "${WARDROWBE_REFRESH_TOKEN}"

After Apply & Restart, the proxy exposes the server at http://homeassistant.local:8080/servers/wardrowbe/sse — add that URL to Home Assistant via Settings → Devices & Services → MCP Server.

Configuration reference

Every flag has a matching environment variable so you can drive it from a shell environment, a .env, or a container orchestrator without rewriting the command line:

Flag Env var Notes
--transport MCP_TRANSPORT http (default) or stdio.
--host MCP_BIND_HOST Bind address. Default 0.0.0.0. http only.
--port MCP_BIND_PORT Bind port. Default 8080. http only.
--wardrowbe-url WARDROWBE_URL Base URL of the Wardrowbe backend.
--api-key MCP_API_KEY Required Bearer token for incoming MCP calls. http only.
--auth MCP_AUTH_MODE dev (default) or oidc.
--external-id MCP_EXTERNAL_ID Dev-mode identity sent to /auth/sync.
--oidc-issuer-url MCP_OIDC_ISSUER_URL OIDC discovery base.
--oidc-client-id MCP_OIDC_CLIENT_ID
--oidc-client-secret MCP_OIDC_CLIENT_SECRET Optional for public clients.
--oidc-refresh-token MCP_OIDC_REFRESH_TOKEN Obtained from a one-time external PKCE flow.
--log-level MCP_LOG_LEVEL DEBUG/INFO/WARNING/ERROR.

Auth to the Wardrowbe backend

Two modes, selected by --auth:

  • dev — sends {external_id, email, display_name} to POST /auth/sync. Works only when the Wardrowbe backend itself is in dev mode (its DEBUG=true and SECRET_KEY left at the upstream default).
  • oidc — refreshes a stored refresh_token against the configured issuer to mint a fresh id_token, then /auth/sync. The refresh token must come from a one-time interactive PKCE flow you run yourself — there is no in-process browser callback because the MCP server is headless. Once obtained, the server rotates the token automatically if the IDP returns a new one.

get_refresh_token.py — a minimal one-shot PKCE helper — is the easiest way to bootstrap OIDC. Edit the four constants at the top (ISSUER, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI), register that redirect URI on your IDP client, then run:

python3 get_refresh_token.py

A browser opens against the IDP; after you authenticate the script prints the refresh_token to stdout. Paste it into --oidc-refresh-token (or the MCP_OIDC_REFRESH_TOKEN env var) when starting wardrowbe-mcp. The script needs the offline_access scope to be allowed on your IDP client; otherwise the token endpoint omits refresh_token from the response. Common IDPs verified: Pocket ID. Should work with any OIDC-conformant provider (Keycloak, Authentik, Auth0, etc.).

Client config

Claude Code / Claude Desktop

{
  "mcpServers": {
    "wardrowbe": {
      "type": "http",
      "url": "http://<host>:8080/mcp",
      "headers": { "Authorization": "Bearer <api-key>" }
    }
  }
}

For SSE-only clients, swap "type": "http" → "type": "sse" and /mcp → /sse.

Other MCP-aware clients

Any client that supports HTTP transport with a Bearer header works. The server advertises tools, instructions, and a bundled agentskills.io-compatible skill at skill://wardrowbe-skill/SKILL.md (plus sibling resources).

Skill bundle

wardrowbe_mcp/skill/ ships inside the package as the agent-facing documentation: a SKILL.md manifest with usage guidance and three worked examples under examples/. The MCP server registers each file as an MCP resource at startup, so MCP clients that auto-install skills pick it up automatically. Manual install is also possible by copying the directory into the client's skill discovery path.

The bundle's prose currently mentions the ha-wardrowbe add-on as the canonical deployment. If you're running this against a different Wardrowbe deployment, edit SKILL.md to match.

Development

git clone https://github.com/saya6k/mcp-wardrowbe
cd mcp-wardrowbe
pip install -e .
wardrowbe-mcp --help

Smoke test against a running instance:

curl -fsS http://127.0.0.1:8080/ | jq                       # anonymous health
curl -fsS http://127.0.0.1:8080/mcp \
  -H "Authorization: Bearer $MCP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}'

License

MIT. See LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选