Claude Code, Codex and Mistral Vibe (MCP)

With the Mugnsoft MCP server, an AI agent such as Claude Code, Codex or Mistral Vibe can list your probes and monitors, test a check, create, update, pause, run and delete monitors, all from plain-language requests such as:

Monitor TCP port 5432 of db01.example.com from probe p1, every 5 minutes.

The agent works through the webserver API with its own agent account, which can only manage monitors.

This page sets it up on a Windows workstation. Count about 20 minutes.

What you need

  • A Mugnsoft webserver whose user dialog offers the AGENT group, and an admin account on it.
  • The webserver’s API address: https://<webserver>:<PortAPI> (PortAPI in webserver.json, 8050 by default). Your workstation must reach it.
  • Claude Code (or Codex, or Mistral Vibe) installed on the workstation.
  • Go 1.25 or later, only to build the server in step 1.

Step 1: build the MCP server

Open a command prompt (cmd) in the webserver sources:


cd tools\mcp\mugnsoft-mcp

go build -o mugnsoft-mcp.exe .

Copy mugnsoft-mcp.exe to C:\Mugnsoft\mugnsoft-mcp\, then check it:


C:\Mugnsoft\mugnsoft-mcp\mugnsoft-mcp.exe --version

You see mugnsoft-mcp followed by a version number.

Step 2: create the agent account

In the web UI, open user management and Add user:

Field Value
Name ai-agent
Group AGENT
Password a long random password
Tags recommended, e.g. ai

An AGENT account can only manage monitors: no users, no settings, no web UI. With tags, it only sees and changes the monitors carrying one of them, and every monitor it creates must carry one.

Step 3: store the password in a protected file

The password must not appear in Claude Code’s configuration. Create a file that only your Windows account can read:


mkdir "%USERPROFILE%\.mugnsoft"

notepad "%USERPROFILE%\.mugnsoft\mcp-password.txt"

Type the password on the first line, save, close Notepad. Then lock the file:


icacls "%USERPROFILE%\.mugnsoft\mcp-password.txt" /inheritance:r /grant:r "%USERDOMAIN%\%USERNAME%:R"

Check it: the next command must list only your account, with (R).


icacls "%USERPROFILE%\.mugnsoft\mcp-password.txt"

Step 4: register the server in Claude Code

Type this on one line, with your API address:


claude mcp add --env MNS_URL=https://mns.example.com:8050 --env MNS_USERNAME=ai-agent --env MNS_PASSWORD_FILE=%USERPROFILE%\.mugnsoft\mcp-password.txt --transport stdio mugnsoft -- "C:\Mugnsoft\mugnsoft-mcp\mugnsoft-mcp.exe"

Keep the order: every --env first, then --transport stdio, then the name mugnsoft.

If the webserver uses a self-signed certificate, add --env MNS_CA_FILE=C:\path\to\ca.pem before --transport stdio.

Check it:


claude mcp list

mugnsoft must show as connected.

Step 5: make Claude Code ask before every change

Open %USERPROFILE%\.claude\settings.json (create it if it does not exist) and add:


{
  "permissions": {
    "ask": [
      "mcp__mugnsoft__mugnsoft_create_monitor",
      "mcp__mugnsoft__mugnsoft_update_monitor",
      "mcp__mugnsoft__mugnsoft_delete_monitor",
      "mcp__mugnsoft__mugnsoft_set_monitor_state",
      "mcp__mugnsoft__mugnsoft_run_monitor",
      "mcp__mugnsoft__mugnsoft_compute_thresholds"
    ],
    "deny": [
      "Read(~/.mugnsoft/**)"
    ]
  }
}

If the file already has a permissions block, merge these lines into it. Claude Code now asks you before it creates, changes, pauses, runs or deletes a monitor, and never opens the password file.

Step 6: first requests

Start claude in any folder and try, one at a time:

  1. List the Mugnsoft probes.
  2. Test, without saving, a TCP check of db01.example.com port 5432 from probe p1.
  3. Create it as "db01 postgres", every 5 minutes, with the tag ai.
  4. Show the Mugnsoft monitors that are failing.

Step 2 runs the check once on the probe and saves nothing. Step 3 asks for your approval, then creates the monitor: it appears in the web UI.

What it did

  • On your workstation: every tool call is logged in %AppData%\mugnsoft-mcp\audit.jsonl (field names only, never values).
  • On the webserver: log\api_audit.log records every change made through the API, and every request of the agent account.

Options

Add any of these as --env NAME=value in step 4 (before --transport stdio):

Option Effect
MNS_READ_ONLY=true the agent can list and test, never change
MNS_ALLOW_DELETE=true allows deleting monitors (off by default: the agent pauses instead)
MNS_SCOPE_PREFIX=ai- the agent only changes monitors whose name starts with ai-
MNS_MAX_WRITES=20 at most 20 changes per session (default 50)

To change an option, remove the server and register it again:


claude mcp remove mugnsoft

Codex

Steps 1 to 3 are the same. Then:


codex mcp add mugnsoft --env MNS_URL=https://mns.example.com:8050 --env MNS_USERNAME=ai-agent --env MNS_PASSWORD_FILE=%USERPROFILE%\.mugnsoft\mcp-password.txt -- "C:\Mugnsoft\mugnsoft-mcp\mugnsoft-mcp.exe"

Check it with codex mcp list.

Mistral Vibe

Steps 1 to 3 are the same. Open %USERPROFILE%\.vibe\config.toml (create it if it does not exist) and add, with your API address and the full path of the password file (%USERPROFILE% is not expanded in this file):


[[mcp_servers]]
name = "mugnsoft"
transport = "stdio"
command = 'C:\Mugnsoft\mugnsoft-mcp\mugnsoft-mcp.exe'
env = { "MNS_URL" = "https://mns.example.com:8050", "MNS_USERNAME" = "ai-agent", "MNS_PASSWORD_FILE" = 'C:\Users\you\.mugnsoft\mcp-password.txt' }

[tools.mugnsoft_mugnsoft_create_monitor]
permission = "ask"

[tools.mugnsoft_mugnsoft_update_monitor]
permission = "ask"

[tools.mugnsoft_mugnsoft_delete_monitor]
permission = "ask"

[tools.mugnsoft_mugnsoft_set_monitor_state]
permission = "ask"

[tools.mugnsoft_mugnsoft_run_monitor]
permission = "ask"

[tools.mugnsoft_mugnsoft_compute_thresholds]
permission = "ask"

[tools.read_file]
denylist = ["**/.mugnsoft/**"]
  • If the file holds the line mcp_servers = [], delete it. Merge any [tools.…] block that already exists.
  • Vibe names an MCP tool <server>_<tool>, hence the double mugnsoft_.
  • Do not use auto-approve mode (--auto-approve, --yolo) with this server: it approves every call, and skips both the ask rules and the read_file denylist.
  • Older Vibe versions called the file tool read: Vibe renames a [tools.read] block to [tools.read_file] itself.
  • Add the options to env, for example "MNS_READ_ONLY" = "true".

Restart vibe, type /mcp to see the server, then try the requests of step 6. Tested with Vibe 3.1.5 on Windows, over stdio and HTTP.

For a shared HTTP server, declare it this way and put your token in the MNS_MCP_TOKEN environment variable:


[[mcp_servers]]
name = "mugnsoft"
transport = "streamable-http"
url = "https://mcp.example.com:8765/mcp"

[mcp_servers.auth]
type = "static"
api_key_env = "MNS_MCP_TOKEN"
api_key_header = "Authorization"
api_key_format = "Bearer {token}"

Other MCP clients

Any MCP client that supports the stdio or streamable HTTP transport can use this server. Give it the command and the MNS_* variables, and make it ask for your approval before every change.

Troubleshooting

Symptom Fix
error: missing required argument 'commandOrUrl' put --transport stdio between the last --env and mugnsoft (step 4)
mugnsoft is not connected in claude mcp list check the .exe path, the API address and port, and that the password file exists
the agent reports wrong credentials check the password file’s first line. After 5 failures the webserver locks your address out for 5 minutes: do not retry in a loop
certificate error add MNS_CA_FILE (step 4)
a request answers 403 the agent account may not do it: monitors outside its tags, or a route that is not a monitor route
the agent cannot delete expected: add MNS_ALLOW_DELETE=true

Good to know

  • EUM (browser) monitors cannot be created by an agent account: their script runs on the probe. Create them in the web UI.
  • A shared server for a team (one install, a token per person) is possible over HTTP: see the README of tools/mcp/mugnsoft-mcp, section Shared server over HTTP.

See also

Translations