Tapo

Productivity and workflow

MCP server for discovering and controlling TP-Link Tapo smart home devices via AI Agents.

Your AI app calls the Tapo MCP server, which does the productivity and workflow work and sends the result back to the chat.

About Tapo

Tapo is a community MCP server from mihai-dinculescu, filed in our directory under productivity and workflow. MCP server for discovering and controlling TP-Link Tapo smart home devices via AI Agents.

Tapo runs on your own machine: your AI app starts it with the command docker run -i --rm and talks to it over standard input and output. It needs TAPO_MCP_USERNAME, TAPO_MCP_PASSWORD, TAPO_MCP_DISCOVERY_TARGET and TAPO_MCP_API_KEY set before Tapo starts.

Tapo is listed in the official MCP registry as io.github.mihai-dinculescu/tapo-mcp, version 0.7.0.

At a glance

Publisher
mihai-dinculescu (community)
Runs
Locally on your machine
Install from
Docker image: ghcr.io/mihai-dinculescu/tapo-mcp:0.7.0
Written in
Rust
License
MIT
GitHub stars
884
Official MCP registry
io.github.mihai-dinculescu/tapo-mcp

How to set up Tapo

  1. Have Docker running on the machine that runs your AI app, because Tapo starts as a container.
  2. Create TAPO_MCP_USERNAME, TAPO_MCP_PASSWORD, TAPO_MCP_DISCOVERY_TARGET and TAPO_MCP_API_KEY for Tapo in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Tapo to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Tapo tools to confirm the connection.
  5. Run one read-only task with Tapo first, and keep your app asking before each tool call until the results look right.

Tapo compared with similar servers

  • Mineru Tianshu by magicyuan876 has fewer GitHub stars than Tapo (862 against 884); both are community servers, and both run locally.
  • Notion (suekou) by suekou has more GitHub stars than Tapo (925 against 884); both are community servers, and both run locally.
  • Obsidian (StevenStavrakis) by StevenStavrakis has fewer GitHub stars than Tapo (754 against 884); both are community servers, and both run locally.

Before you connect Tapo

  • Give Tapo its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Tapo tool call until you trust what it does with them.
  • Treat text that Tapo fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Tapo on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Tapo

How marketing and sales teams put Tapo to work, by company size. Pick the size closest to yours and start Tapo on one use case.

Small business

  • A busy owner can use Tapo to turn a brain dump into tasks with due dates, and get a short list of what matters today.
  • Small marketing teams can ask Tapo what slipped last week and which campaign tasks have no owner yet.
  • Tapo runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing ops can connect Tapo to build launch checklists from a template and post status updates without a weekly meeting.
  • Team leads can use Tapo to see where work piles up across projects and move it before deadlines slip.
  • Start Tapo on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise PMOs can use Tapo to roll up status across many teams into one view for leadership, with links back to each source task.
  • Large orgs can give Tapo scoped access per workspace, so an agent helps one department without reading another's plans.
  • Tapo is a community server, so have security review the code and pin a version before Tapo touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Tapo README

From mihai-dinculescu/tapo on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

tapo-mcp

MCP server that exposes Tapo smart-home devices as AI-callable tools and resources via the Model Context Protocol.

Built on the tapo crate and the rmcp SDK. Runs as an HTTP server (Streamable HTTP transport).

Example Prompts

"List all my Tapo devices"

"Turn off the office light"

"Turn on smart plug 4 on the power strip"

"Is the office light on?"

"Set the bedroom light to 50% brightness"

"Change the living room light to Coral"

"Take a snapshot from the baby monitor"

"What's the temperature in the kitchen?"

"Show me the last 24 hours of temperature from the living room temperature and humidity sensor"

"List the 5 most recent events on the smart button"

"How much energy did the washing machine plug use each day this month?"

"Show me the TV's power draw over the last 6 hours"

Tools

Tool Description
list_devices List available Tapo devices on the network (includes set and get capabilities).
get_device_state Get a device's current state (e.g. {"type": "DeviceInfo"}). Checks the capability's parameters, then verifies the device ID matches at the given IP.
control_device Control a device by applying 1 to 12 set capabilities, in order. Checks the count and values, then verifies the device ID matches at the given IP; a capability the device does not support fails before any is applied. Returns the device's state afterwards, read back from the device.
take_snapshot Capture a still JPEG snapshot from a Tapo camera (~640x360), with the device id, capture time and size as text, plus a short-lived link when TAPO_MCP_PUBLIC_URL is set (see Snapshot links). Verifies the device ID matches at the given IP first.

Resources

URI Description
tapo://devices JSON list of discovered Tapo devices.

Capabilities

Devices and child devices expose separate lists of set and get capabilities they support. Child devices have no IP of their own; their ip is their parent's, which is the one to pass with the child's id.

Set Capabilities
Capability Description
Brightness Set the device brightness (1-100)
Color Set the device color using a preset name
HueSaturation Set the device color using a hue (0-360) and saturation (1-100)
ColorTemperature Set the device color temperature (2500-6500)
OnOff Turn the device on or off
Get Capabilities
Capability Description
Detections Read the detections stored on a camera's SD card, with the events detected (person, motion, ...), for up to 24 hours (C120, C210, C220, C225, C325WB, C520WS, TC40, TC70)
DeviceInfo Read the device's current state
EnergyDataHourly Read the energy used per hour, in Wh, for up to 8 days (P110, P110M, P115, P304M, P316M)
EnergyDataDaily Read the energy used per day, in Wh, for a quarter of a year (P110, P110M, P115, P304M, P316M)
EnergyDataMonthly Read the energy used per month, in Wh, for a year (P110, P110M, P115, P304M, P316M)
EnergyMeterData Read the live voltage, current and power, and the energy used since the device last restarted (P110, P110M, P115, P304M, P316M)
PowerDataEvery5Minutes Read the power draw every 5 minutes, in W, for up to 12 hours (P110, P110M, P115, P304M, P316M)
PowerDataHourly Read the power draw every hour, in W, for up to 6 days (P110, P110M, P115, P304M, P316M)
Snapshot Capture a still JPEG snapshot. Served by the dedicated take_snapshot tool (binary, not JSON state)
TemperatureHumidityRecords Read the last 24 hours of temperature and humidity records (T310, T315) at 15 minute intervals
TriggerLogs Read paginated trigger logs from a hub child sensor (S200, T100, T110, T300)

Configuration

All configuration is via environment variables prefixed with TAPO_MCP_:

Variable Required Default Description
TAPO_MCP_USERNAME Yes , Tapo account email
TAPO_MCP_PASSWORD Yes , Tapo account password
TAPO_MCP_CAMERA_USERNAME No , Camera account username[^camera]. Required by take_snapshot.
TAPO_MCP_CAMERA_PASSWORD No , Camera account password[^camera]. Required by take_snapshot.
TAPO_MCP_DISCOVERY_TARGET Yes , IP address for device discovery, usually the network's broadcast address (e.g. 192.168.1.255)
TAPO_MCP_HTTP_ADDR No 127.0.0.1:3000 Address the server listens on
TAPO_MCP_DISCOVERY_TIMEOUT No 5 Discovery timeout in seconds. Must be between 1 and 60[^discovery]
TAPO_MCP_DISCOVERY_INTERVAL No 600 Seconds between background discoveries that refresh the device list. Must be at least TAPO_MCP_DISCOVERY_TIMEOUT and at most 86400 (one day)[^discovery]
TAPO_MCP_API_KEY No , Bearer token for HTTP authentication (see below)
TAPO_MCP_ALLOWED_HOSTS No loopback only Comma-separated Host header allowlist (see Network exposure)
TAPO_MCP_PUBLIC_URL No , Base URL clients reach the server at (e.g. https://tapo.example.com). Enables short-lived snapshot links (see Snapshot links)

[^camera]: Set on each camera in the Tapo app under Camera Settings > Advanced Settings > Camera Account. Distinct from your TP-Link cloud account.

[^discovery]: While a background discovery runs, tool calls that contact a device wait for it to finish, and the discovery waits for calls already in progress. A run takes about TAPO_MCP_DISCOVERY_TIMEOUT seconds plus a few more to log in to the devices, and longer if a device is slow to respond. A short interval means these pauses happen often: at 15 with the default timeout, tool calls can be held up for several seconds out of every 15. list_devices and the tapo://devices resource never wait.

Clients connect to the MCP endpoint at /mcp on that address, for example http://127.0.0.1:3000/mcp. / still works but is deprecated: it logs a warning and will be removed in a later release.

Authentication

When TAPO_MCP_API_KEY is set, the server requires every HTTP request except /livez and snapshot links to include an Authorization: Bearer <key> header. Requests with a missing or invalid token receive a 401 Unauthorized response.

When the variable is unset (or empty/whitespace-only), the server runs without authentication.

Network exposure

The server enforces the MCP Streamable HTTP DNS-rebinding protection. By default only loopback Host headers (localhost, 127.0.0.1, ::1) are accepted, which prevents a malicious web page from reaching a locally running server via DNS rebinding. Requests to the MCP endpoint with any other Host receive a 403 Forbidden response, and the server logs a warning that names the refused host. Snapshot links are not covered by this check (see Snapshot links).

To reach the server over the LAN or from another host, set TAPO_MCP_ALLOWED_HOSTS to the exact hostname(s) or host:port authorities clients connect to, for example TAPO_MCP_ALLOWED_HOSTS="tapo-mcp.lan:3000,192.168.1.50:3000". This replaces the loopback default, so include loopback entries as well if you still need them.

To avoid shipping unauthenticated smart-home control, the server refuses to start when it binds to a non-loopback address (for example 0.0.0.0:3000) without TAPO_MCP_API_KEY set. Set an API key, or bind to a loopback address.

Snapshot links

Some MCP clients don't pass image results on to the model, and others show the image to the model but give it nothing it can hand to the user. When TAPO_MCP_PUBLIC_URL is set, take_snapshot also returns a url (and its expires_at) pointing at <TAPO_MCP_PUBLIC_URL>/snapshots/<token>.jpg, so the agent can share the link or download the file.

  • The link is served without the API key, so a browser can open it directly. The Host allowlist from TAPO_MCP_ALLOWED_HOSTS does not apply to it either. The random token in the path is the only credential: anyone holding the link can view that frame until it expires.
  • Each link is valid for 5 minutes. Snapshots are kept in memory only and never written to disk. Expired snapshots are cleared out within a minute, and at most the 1024 most recent are kept.
  • Behind an authenticating reverse proxy (Cloudflare Access and similar), links opened in a browser that is already signed in to the proxy work. Non-browser fetches (curl, an agent downloading the file) need the proxy's own credential or a policy exception for /snapshots/.

When TAPO_MCP_PUBLIC_URL is unset, no link is returned and the /snapshots/ route is not served.

OpenTelemetry

To export traces, set OTEL_EXPORTER_OTLP_ENDPOINT to the base URL of an OTLP/HTTP collector (e.g. http://alloy.monitoring:4318); the server sends them to /v1/traces under it. To send them to another path, set OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to the full URL instead. OTEL_RESOURCE_ATTRIBUTES adds resource attributes. RUST_LOG (default tapo_mcp=info) also decides which spans are exported.

What gets traced:

  • Tool calls. Each tools/call request gets one server span named tools/call <tool>, covering the whole call, following the OpenTelemetry MCP semantic conventions. It carries mcp.method.name, gen_ai.tool.name (only for tools the server provides), gen_ai.operation.name, jsonrpc.request.id, mcp.session.id and mcp.protocol.version, plus tapo.device.id and tapo.device.ip where the tool takes them. A failed call has error status and error.type (the JSON-RPC error code, or tool_error). Inside it, the check_device span covers the verification that the device ID matches at the given IP, and get_capability, set_capability or capture_snapshot covers the device request. get_capability and set_capability carry tapo.capability, and control_device has one set_capability span for each capability it applies, then a get_capability span for the device info it reads back. A failed step has error status and error.type set to the kind of failure, such as DeviceNotFound or WrongDeviceType.
  • Background jobs. refresh_devices for each device discovery, and prune_snapshots for each sweep of expired snapshot links.

Credentials, the API key and image data are never recorded. Tool arguments are not recorded either, except id and ip, and a failed call's error message, which can repeat the value that was rejected.

Incoming W3C trace context is honoured. When the request's params._meta has a traceparent (and optionally tracestate), as MCP clients that trace their calls send, the tool call span becomes its child and joins that trace. A traceparent header on the HTTP request that carries the call, for example from a tracing reverse proxy, is then recorded as a span link. Without _meta context, the HTTP header is used as the parent instead. Without either, the span starts a new trace.

Deployment

Docker
docker run --rm \
  --network host \
  --read-only \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  -e TAPO_MCP_USERNAME="you@example.com" \
  -e TAPO_MCP_PASSWORD="<YOUR_TAPO_PASSWORD>" \
  -e TAPO_MCP_CAMERA_USERNAME="<YOUR_CAMERA_ACCOUNT_USERNAME>" \
  -e TAPO_MCP_CAMERA_PASSWORD="<YOUR_CAMERA_ACCOUNT_PASSWORD>" \
  -e TAPO_MCP_DISCOVERY_TARGET="192.168.1.255" \
  -e TAPO_MCP_API_KEY="<YOUR_TAPO_MCP_API_KEY>" \
  ghcr.io/mihai-dinculescu/tapo-mcp:latest

Note: The image binds to 0.0.0.0:3000, so TAPO_MCP_API_KEY is required, the server refuses to start on a non-loopback address without it (see Network exposure). To reach the server by hostname or LAN IP rather than loopback, also set TAPO_MCP_ALLOWED_HOSTS. To get snapshot links, add -e TAPO_MCP_PUBLIC_URL="https://tapo.example.com".

Note: --network host is required so the container can reach Tapo devices on your local network via UDP broadcast for discovery. On macOS and Windows, --network host is not supported, you can use -p 3000:3000 instead, but device discovery won't work as Docker Desktop runs containers inside a VM without LAN access.

Note: --read-only, --cap-drop ALL and --security-opt no-new-privileges are optional hardening. The server runs as a non-root user, writes nothing to disk and needs no Linux capabilities.

Verifying the image

Each image is signed by the GitHub Actions workflow that builds it. To check that an image was built from this repository, use the GitHub CLI:

gh attestation verify oci://ghcr.io/mihai-dinculescu/tapo-mcp:latest --repo mihai-dinculescu/tapo
Kubernetes

Create the Secret and ConfigMap first:

kubectl create secret generic tapo-mcp-secrets \
  --from-literal=TAPO_MCP_USERNAME="you@example.com" \
  --from-literal=TAPO_MCP_PASSWORD="<YOUR_TAPO_PASSWORD>" \
  --from-literal=TAPO_MCP_CAMERA_USERNAME="<YOUR_CAMERA_ACCOUNT_USERNAME>" \
  --from-literal=TAPO_MCP_CAMERA_PASSWORD="<YOUR_CAMERA_ACCOUNT_PASSWORD>" \
  --from-literal=TAPO_MCP_API_KEY="<YOUR_TAPO_MCP_API_KEY>"

kubectl create configmap tapo-mcp-config \
  --from-literal=TAPO_MCP_DISCOVERY_TARGET="192.168.1.255"

Then apply the Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tapo-mcp
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: tapo-mcp
  template:
    metadata:
      labels:
        app: tapo-mcp
    spec:
      hostNetwork: true
      containers:
        - name: tapo-mcp
          image: ghcr.io/mihai-dinculescu/tapo-mcp:latest
          env:
            - name: TAPO_MCP_USERNAME
              valueFrom:
                secretKeyRef:
                  name: tapo-mcp-secrets
                  key: TAPO_MCP_USERNAME
            - name: TAPO_MCP_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: tapo-mcp-secrets
                  key: TAPO_MCP_PASSWORD
            - name: TAPO_MCP_CAMERA_USERNAME
              valueFrom:
                secretKeyRef:
                  name: tapo-mcp-secrets
                  key: TAPO_MCP_CAMERA_USERNAME
            - name: TAPO_MCP_CAMERA_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: tapo-mcp-secrets
                  key: TAPO_MCP_CAMERA_PASSWORD
            - name: TAPO_MCP_API_KEY
              valueFrom:
                secretKeyRef:
                  name: tapo-mcp-secrets
                  key: TAPO_MCP_API_KEY
            - name: TAPO_MCP_DISCOVERY_TARGET
              valueFrom:
                configMapKeyRef:
                  name: tapo-mcp-config
                  key: TAPO_MCP_DISCOVERY_TARGET
          securityContext:
            runAsNonRoot: true
            runAsUser: 65532
            readOnlyRootFilesystem: true
            allowPrivilegeEscalation: false
            capabilities:
              drop: ["ALL"]
            seccompProfile:
              type: RuntimeDefault
          livenessProbe:
            httpGet:
              path: /livez
              port: 3000
            periodSeconds: 30
          resources:
            requests:
              cpu: 10m
              memory: 32Mi
            limits:
              memory: 256Mi

Note: hostNetwork: true is required for UDP broadcast discovery, similar to --network host in Docker. Because clients reach the server by node IP or hostname rather than loopback, set TAPO_MCP_ALLOWED_HOSTS accordingly (see Network exposure). To get snapshot links, add TAPO_MCP_PUBLIC_URL to the ConfigMap and the Deployment's env.

Health checks

GET /livez answers 200 OK while the server is running. It needs neither the API key nor a Host from TAPO_MCP_ALLOWED_HOSTS, so a liveness probe works as it is.

The server uses about 15 MiB of memory. Snapshots for snapshot links are kept in memory for 5 minutes, which is what the 256 MiB limit above leaves room for.

OpenClaw

The tapo skill for OpenClaw makes it easy to use a deployed tapo MCP server from OpenClaw agents.

Install it with:

npx clawhub install tapo

Contributing

Contributions are welcome and encouraged! See /tapo-mcp/CONTRIBUTING.md.

Questions about Tapo

What is the Tapo MCP server?

MCP server for discovering and controlling TP-Link Tapo smart home devices via AI Agents. Tapo is maintained by mihai-dinculescu on GitHub at mihai-dinculescu/tapo, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Tapo MCP server?

Add Tapo to your AI app's MCP config with the command docker run -i --rm -e TAPO_MCP_USERNAME -e TAPO_MCP_PASSWORD -e TAPO_MCP_CAMERA_USERNAME -e TAPO_MCP_CAMERA_PASSWORD -e TAPO_MCP_DISCOVERY_TARGET -e TAPO_MCP_API_KEY -e TAPO_MCP_ALLOWED_HOSTS -e TAPO_MCP_PUBLIC_URL -e TAPO_MCP_DISCOVERY_TIMEOUT -e TAPO_MCP_DISCOVERY_INTERVAL -e OTEL_EXPORTER_OTLP_ENDPOINT ghcr.io/mihai-dinculescu/tapo-mcp:0.7.0. In Claude Code, run claude mcp add --transport stdio mihai-dinculescu-tapo -- docker run -i --rm -e TAPO_MCP_USERNAME -e TAPO_MCP_PASSWORD -e TAPO_MCP_CAMERA_USERNAME -e TAPO_MCP_CAMERA_PASSWORD -e TAPO_MCP_DISCOVERY_TARGET -e TAPO_MCP_API_KEY -e TAPO_MCP_ALLOWED_HOSTS -e TAPO_MCP_PUBLIC_URL -e TAPO_MCP_DISCOVERY_TIMEOUT -e TAPO_MCP_DISCOVERY_INTERVAL -e OTEL_EXPORTER_OTLP_ENDPOINT ghcr.io/mihai-dinculescu/tapo-mcp:0.7.0. To run Tapo this way you need Docker running.

Does Tapo need an API key?

Yes. Tapo expects TAPO_MCP_USERNAME, TAPO_MCP_PASSWORD, TAPO_MCP_DISCOVERY_TARGET and TAPO_MCP_API_KEY to be set. Create the key for Tapo in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Tapo an official MCP server?

No. Tapo is a community server maintained by mihai-dinculescu. Community servers can be excellent; read the code and the open issues before you give Tapo access to company data.

What license is Tapo under?

Tapo is released under the MIT license, according to its GitHub repository. The license covers the code of Tapo; the service it connects to has its own terms.