# How to use MCP Connect your AI to Port OS with MCP (Model Context Protocol). ## Prerequisites - A Port OS account. - An AI client that supports remote MCP servers and OAuth sign-in. - A connected device or a [simulator light](/docs/getting-started/) to test. ## 1. Add the MCP server Open your AI client's MCP connector page. Enter this server URL: Choose Streamable HTTP if the client asks for a transport. If your AI client asks you to set up a client yourself, use dynamic client registration (DCR) or client ID metadata documents (CIMD). Both let your AI client register itself, with nothing to copy. If your client supports neither, [register an OAuth client](/oauth-clients/) on the clients page and enter its details in your AI client. ## 2. Authorize your AI Click your AI client's Connect button and sign in to your Port OS account. Review the permissions and grant the access you want your agent to have. For example, you can let the agent list devices without letting it control them. ## 3. Test the connection Ask your AI to list your connected devices. Then, if you granted control access, try: > Turn off the simulator light via @Port OS. Use the name of your test light. Check that its state changes to off. ## Congratulations! Your AI is now connected to Port OS with MCP. ## What your AI can do ## Connection problems | Problem | What to check | | --- | --- | | Sign-in is requested again | Reconnect using the client's authorization flow. The previous access may have expired. | | Access is denied | Check the account and endpoint access rules. | | No matching devices | Check [Your devices](/dashboard/) and see if the device is there. Connect the provider if the device is missing there too. | | A command is rejected | Check the device's declared messages and payload schema in the [capability reference](/docs/reference/capabilities/). | | Device state is unavailable | Check that the device is online and plugged in, and that the provider connection is stable. | ## Next steps