Skip to content

Development and Docker

João Miguel Tabosa Vaz Marques Silva edited this page Nov 17, 2025 · 2 revisions

This page describes how to develop, build, and run the TP-Link Omada MCP server, including devcontainer and Docker usage.


Prerequisites

From the main README:

You also need suitable Omada credentials and controller configuration to obtain an OAuth client ID and secret.


Local Development

Installation

npm install

Run in dev mode

npm run dev

This:

  • Compiles and runs the TypeScript server with tsx.
  • Watches files and reloads automatically.
  • Uses stdio or HTTP based on your environment variables.

Build

npm run build

This compiles TypeScript to JavaScript into the dist directory.

Lint and checks

npm run check

This runs linting and type checks according to the repo’s configuration.


Running the MCP Server

Stdio (default)

npm start

This starts the compiled MCP server over stdio. Configure your MCP client (e.g. Claude Desktop) to run:

  • Command: npm start
  • Working directory: repo root
  • Environment variables: your .env file or equivalent

HTTP

To enable HTTP transport:

export MCP_SERVER_USE_HTTP=true
npm run dev    # or: npm start

Defaults:

  • Port: 3000
  • Bind address: 127.0.0.1
  • Transport: Streamable HTTP (MCP_HTTP_TRANSPORT=stream)
  • Endpoints:
    • /mcp – MCP (SSE + JSON-RPC)
    • /healthz – healthcheck

For details on configuration and options, see Configuration and HTTP Transport.


Docker Images

The repository provides two Docker images:

  • CLI/stdio image
  • HTTP/SSE image

Build and run CLI/stdio image

npm run docker:build       # Build CLI/stdio image:
                           # ghcr.io/migueltvms/tplink-omada-mcp-cli:latest

npm run docker:run         # Run CLI/stdio image with your .env file

The docker:run script typically:

  • Mounts your .env file inside the container.
  • Runs the server over stdio (useful for MCP clients that exec a container).

Build and run HTTP/SSE image

npm run docker:build:http  # Build HTTP/SSE image:
                           # ghcr.io/migueltvms/tplink-omada-mcp-http:latest

npm run docker:run:http    # Launch HTTP/SSE image and publish port 3000

The HTTP image:

  • Starts the MCP HTTP server by default (MCP_SERVER_USE_HTTP=true).
  • Exposes port 3000 (by default) on the host.

You can override environment variables when running the container:

docker run --rm \
  -p 3000:3000 \
  -e OMADA_BASE_URL=https://omada-controller.local \
  -e OMADA_CLIENT_ID=... \
  -e OMADA_CLIENT_SECRET=... \
  -e OMADA_OMADAC_ID=... \
  ghcr.io/migueltvms/tplink-omada-mcp-http:latest

Pushing Docker Images

If you have access to the GitHub Container Registry for this project:

# Authenticate with GitHub Container Registry, then:
npm run docker:push         # Push CLI/stdio image
npm run docker:push:http    # Push HTTP/SSE image

These tags follow the pattern:

  • ghcr.io/migueltvms/tplink-omada-mcp-cli:latest
  • ghcr.io/migueltvms/tplink-omada-mcp-http:latest

Devcontainer Support

The repository includes a devcontainer configuration with:

  • A Node.js development environment preconfigured for this repo.
  • A sidecar Omada controller service for local testing.

You can open the repo in a devcontainer using:

  • VS Code Remote Containers
  • GitHub Codespaces
  • Any other devcontainer-compatible environment

See .devcontainer/README.md in the repo for specific details and how to connect the Omada MCP server to the sidecar controller.


For configuration options, see Configuration.
For tool usage and Omada API mappings, see Tools.
For transport details, see HTTP Transport.

Clone this wiki locally