Connect the AI in VS Code to the panel (MCP)
Let Claude Code, Copilot or any MCP-capable AI in VS Code run your panel: create a token, add the server to mcp.json and ask it to migrate a server.
Read this first
The AI does everything the token allows, with no confirmation prompt. Use a token with an expiry (at most one year) and revoke it when you finish. Operations that need a person, such as setting passwords or second factors, stay closed to tokens. Everything the AI does is written to the audit log under the token's name.
Steps
- In the admin interface open Panel, API tokens and create a token named "VS Code" with a short expiry. Copy it: it is shown once and stored as a hash.
- In your project create
.vscode/mcp.jsonwith this content, replacing the host with your node:{
"servers": {
"tns-panel": {
"type": "http",
"url": "https://panel.example.com:2087/api/mcp",
"headers": { "Authorization": "Bearer ${input:tns-token}" }
}
},
"inputs": [
{ "id": "tns-token", "type": "promptString", "description": "TNS Panel API token", "password": true }
]
}
- Open the Chat view in VS Code, switch to Agent mode and start the server from the tools list (or run MCP: List Servers). VS Code asks for the token the first time and keeps it out of the file.
- Ask for what you need, for example: "Inventory the server at old.example.com, then import the account acme and verify it before I cut DNS."
- When you finish, revoke the token in Panel, API tokens.
Claude Code from the terminal
Claude Code reads the same endpoint. Add it once with:
claude mcp add --transport http tns-panel https://panel.example.com:2087/api/mcp --header "Authorization: Bearer YOUR_TOKEN"
Troubleshooting
- 401 Unauthorized: the token expired or was revoked. Create a new one.
- Certificate error: while the panel still uses its self-signed certificate, VS Code cannot verify it. Install a real certificate on the panel, or add the panel's certificate to the trust store of the machine running VS Code.
- Cannot connect: the admin port (2087) must be reachable from your machine, and the firewall rule for it must allow your address.
FAQ
Is the AI allowed to delete things?
It can do anything the token allows, and tokens are admin-only. That is why the token should expire soon and be revoked after use.
Does this cost anything?
The panel side is free. Your AI tool bills you however it normally does.
Is this the same as the assistant inside the panel?
They use the same tool catalog. The assistant runs inside the panel with your provider keys; the MCP server lets the AI you already use in VS Code connect from outside.
Last updated: 2026-10-10