Skill: Agents can auto-configure MCP.

This commit is contained in:
Adam Outler
2026-02-03 16:18:36 +00:00
parent 8211816b37
commit a1a6c7e1cf
3 changed files with 87 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
---
name: devcontainer-management
description: Guide for identifying, managing, and running commands within the NetAlertX development container. Use this when asked to run backend logic, setup scripts, or troubleshoot container issues.
description: Guide for identifying, managing, and running commands within the NetAlertX development container. Use this when asked to run commands, testing, setup scripts, or troubleshoot container issues.
---
# Devcontainer Management

View File

@@ -0,0 +1,52 @@
---
name: mcp-activation
description: Enables live interaction with the NetAlertX runtime. This skill configures the Model Context Protocol (MCP) connection, granting full API access for debugging, troubleshooting, and real-time operations including database queries, network scans, and device management.
---
# MCP Activation Skill
This skill configures the NetAlertX development environment to expose the Model Context Protocol (MCP) server to AI agents.
## Why use this?
By default, agents only have access to the static codebase (files). To perform dynamic actions—such as:
- **Querying the database** (e.g., getting device lists, events)
- **Triggering actions** (e.g., network scans, Wake-on-LAN)
- **Validating runtime state** (e.g., checking if a fix actually works)
...you need access to the **MCP Server** running inside the container. This skill sets up the necessary authentication tokens and connection configs to bridge your agent to that live server.
## Prerequisites
1. **Devcontainer:** You must be connected to the NetAlertX devcontainer.
2. **Server Running:** The backend server must be running (to generate `app.conf` with the API token).
## Activation Steps
1. **Activate Devcontainer Skill:**
If you are not already inside the container, activate the management skill:
```text
activate_skill("devcontainer-management")
```
2. **Generate Configurations:**
Run the configuration generation script *inside* the container. This script extracts the API Token and creates the necessary settings files (`.gemini/settings.json` and `.vscode/mcp.json`).
```bash
# Run inside the container
/workspaces/NetAlertX/.devcontainer/scripts/generate-configs.sh
```
3. **Apply Changes:**
* **For Gemini CLI:**
The agent session must be **restarted** to load the new `.gemini/settings.json`.
> "I have generated the MCP configuration. Please **restart this session** to activate the `netalertx-devcontainer` tools."
* **For VS Code (GitHub Copilot / Cline):**
The VS Code window must be **reloaded** to pick up the new `.vscode/mcp.json`.
> "I have generated the MCP configuration. Please run **'Developer: Reload Window'** in VS Code to activate the MCP server."
## Verification
After restarting, you should see new tools available (e.g., `netalertx-devcontainer__get_devices`).

34
.github/skills/mcp-activation/SKILL.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: mcp-activation
description: Enables live interaction with the NetAlertX runtime. This skill configures the Model Context Protocol (MCP) connection, granting full API access for debugging, troubleshooting, and real-time operations including database queries, network scans, and device management.
---
# MCP Activation Skill
This skill configures the environment to expose the Model Context Protocol (MCP) server to AI agents running inside the devcontainer.
## Usage
This skill assumes you are already running within the NetAlertX devcontainer.
1. **Generate Configurations:**
Run the configuration generation script to extract the API Token and update the VS Code MCP settings.
```bash
/workspaces/NetAlertX/.devcontainer/scripts/generate-configs.sh
```
2. **Reload Window:**
Request the user to reload the VS Code window to activate the new tools.
> I have generated the MCP configuration. Please run the **'Developer: Reload Window'** command to activate the MCP server tools.
> In VS Code: open the Command Palette (Windows/Linux: Ctrl+Shift+P, macOS: Cmd+Shift+P), type Developer: Reload Window, press Enter — or click the Reload button if a notification appears. 🔁
> After you reload, tell me “Window reloaded” (or just “reloaded”) and Ill continue.
## Why use this?
Access the live runtime API to perform operations that are not possible through static file analysis:
- **Query the database**
- **Trigger network scans**
- **Manage devices and events**
- **Troubleshoot real-time system state**