How to connect VS Code
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
- Go to portoperatingsystem.com and sign in.
- 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.
- Open Your Devices. If your devices are listed there, you're ready to connect VS Code.
Connection details
Enter this server URL:
https://api.portoperatingsystem.com/mcpThen use these settings:
| Setting | Value |
|---|---|
| Transport | Streamable HTTP |
| Authentication | OAuth |
1. Add Port OS
Choose one of two ways.
Recommended: install the extension
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:
ext install portos.portos-smart-home-mcpThe 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:
{
"servers": {
"portos": {
"type": "http",
"url": "https://api.portoperatingsystem.com/mcp"
}
}
}2. Start the server and sign in
- Go to the Agents tab in VS Code and click the configuration button.
- 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.
- VS Code asks to let the server sign in. Click Allow, and your browser opens to sign in to Port OS.
- 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.