Skip to content

How to connect VS Code

View as Markdown

This guide teaches you how to connect Port OS to VS Code, so GitHub Copilot's agent mode can list and control your devices. You need VS Code 1.101 or later, GitHub Copilot, and a Port OS account with at least one connected device.

Check supported smart-home devices and alpha availability before linking your account.

Before you start: set up your devices

  1. Go to portoperatingsystem.com and sign in.
  2. Open the plugin catalog and add the plugins for your providers, such as Philips Hue, Sonos or SmartThings. Sign in to each provider on its own page; Port OS never sees your provider password.
  3. Open Your Devices. If your devices are listed there, you're ready to connect VS Code.

Connection details

Enter this server URL:

MCP server URL
https://api.portoperatingsystem.com/mcp

Then use these settings:

SettingValue
TransportStreamable HTTP
AuthenticationOAuth

1. Add Port OS

Choose one of two ways.

Install Port OS Smart Home MCP from the VS Code Marketplace, or open it in VS Code. You can also press Ctrl+P (Cmd+P on macOS) and run:

Text
ext install portos.portos-smart-home-mcp

The extension registers the hosted Port OS server with VS Code. Nothing runs on your computer.

Manual: add the server yourself

Run MCP: Add Server from the Command Palette, choose HTTP, and enter the server URL above. Choose whether to save it for your user or for the current workspace.

You can instead add this entry to .vscode/mcp.json, keeping your other servers:

JSON
{
  "servers": {
    "portos": {
      "type": "http",
      "url": "https://api.portoperatingsystem.com/mcp"
    }
  }
}

2. Start the server and sign in

  1. Go to the Agents tab in VS Code and click the configuration button.
  2. Click Start on Port OS Smart Home to activate it. With the extension, you can also click Port OS: Connect in the status bar, or run Port OS: Connect Smart Home MCP from the Command Palette.
  3. VS Code asks to let the server sign in. Click Allow, and your browser opens to sign in to Port OS.
  4. Review the permissions and approve them.

3. Verify in Agent

Open Copilot Chat in Agent mode and ask “Show my connected devices.” Compare the names with Your Devices.

Troubleshooting

  • If VS Code shows a 401 or “unauthorized” error for the server, usually after an extension update, run Developer: Reload Window from the Command Palette, then click Start on Port OS Smart Home again. You stay signed in.
  • If the error remains after reloading, run Authentication: Remove Dynamic Authentication Providers, remove the Port OS entry, and click Start to sign in again.
  • If no devices appear, confirm you signed in to the same Port OS account as Your Devices and that it has connected devices.

References

  1. Official VS Code MCP server instructions
  2. Port OS Smart Home MCP extension on the Marketplace
  3. Port OS authentication guide