API / Getting started / AI assistants (MCP)

AI assistants (MCP)

sourhost connects to AI assistants through MCP, the open standard assistants use to work with outside services. Once connected, just ask: "why is my server lagging?", "switch to de_dust2 with 24 slots", "restart every night at 5", "renew everything for a month".

What the assistant can do

  • See projects, servers, status and load, balance, plans and prices.
  • Start, stop and restart servers.
  • Send console commands and read the latest console output.
  • Show the map, player count and player list.
  • Read and edit server files such as server.cfg.
  • Change startup parameters and the port; reinstall a server.
  • Create scheduled tasks and backups; restore backups.
  • Give access to a server and show SFTP details.
  • Renew and rent servers, change plans, make a top-up link.
  • See FastDL and compress its files.
  • Write to support and reply in tickets.

It works with the rights of your API token and can't do more than the token allows.

Step 1. A token

Open account menu → Settings → API tokens and click Connect to AI. The form opens with the scopes for looking after servers already ticked. Spending the balance is off by default: if you want the assistant to renew and rent, tick billing:spend and set a limit.

Once it's created, the dialog shows the token and ready-made connection lines. Copy them right away — the token isn't shown again.

Token for the AI assistant created

  1. The token itself.
  2. The command for Claude Code.
  3. Settings for Cursor and other MCP clients.
  4. Links to the sourhost skill and the setup guide.

Step 2. Connecting

Claude Code. Run the command from the dialog:

curl
claude mcp add --transport http sourhost https://sourhost.net/mcp --header "Authorization: Bearer sh_live_your_token"

Cursor and other clients with MCP settings. Add this to their MCP settings file (for Cursor, ~/.cursor/mcp.json):

JSON
{
  "mcpServers": {
    "sourhost": {
      "url": "https://sourhost.net/mcp",
      "headers": { "Authorization": "Bearer sh_live_your_token" }
    }
  }
}

Claude Desktop and clients without header settings. Connect through the mcp-remote bridge (needs Node.js):

JSON
{
  "mcpServers": {
    "sourhost": {
      "command": "npx",
      "args": ["mcp-remote", "https://sourhost.net/mcp", "--header", "Authorization:Bearer sh_live_your_token"]
    }
  }
}

One-click connection from claude.ai and ChatGPT in the browser, with no token to copy, is coming later.

Step 3. The skill (recommended)

The skill is a guide for the assistant: how to track down lag, where CS2 configs live, what errors mean, when to ask before spending. Answers get noticeably better with it.

  • Claude apps: download the skill and upload the archive in Claude's settings, under Skills.
  • Claude Code: unzip it into ~/.claude/skills/ so that you get ~/.claude/skills/sourhost.

The full Claude Code plugin (skill and connection together) is sourhost-plugin.zip; it reads the token from the SOURHOST_API_TOKEN environment variable.

Safety

  • Money only on your yes. Before any purchase the assistant gets a quote and tells you the amount. Nothing is charged until you confirm, and never past the token's limit.
  • Dangerous actions need a yes. Reinstalling, restoring a backup and deleting files or backups all need an explicit confirmation.
  • No hijacking through text. The assistant treats console output, files and player names as data, not as commands.
  • Event log. Every action is logged, marked "API token "name"".
  • Switching it off. Revoke the token under Settings → API tokens and access ends at once.