Skip to content

Commit 9bc62fc

Browse files
committed
fix(mcp): move mcp scripts to folder linters can read
1 parent 6ede6f7 commit 9bc62fc

8 files changed

Lines changed: 24 additions & 19 deletions

File tree

.vscode/mcp.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"type": "stdio",
55
"command": "python3",
66
"args": [
7-
".vscode/mcps/koji-mcp.py"
7+
"scripts/mcps/koji-mcp.py"
88
]
99
},
1010
"fedora-distgit": {
1111
"type": "stdio",
1212
"command": "python3",
1313
"args": [
14-
".vscode/mcps/fedora-distgit-mcp.py"
14+
"scripts/mcps/fedora-distgit-mcp.py"
1515
]
1616
},
1717
"azure-mcp-server": {
@@ -70,4 +70,4 @@
7070
"password": false
7171
}
7272
]
73-
}
73+
}

DEVELOPING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ The `azl-diagnose` agent and Koji-related tools require:
3434

3535
1. **MCP Python packages** — the MCP servers won't start without them:
3636
```bash
37-
pip3 install --user -r .vscode/mcps/requirements.txt
37+
pip3 install --user -r scripts/mcps/requirements.txt
3838
```
3939
2. **Network access to the internal Koji instance** — The internal Koji is only accessible via VPN or the corporate network. If the agent reports connection errors, verify you are connected before retrying.
40-
3. **(Optional) `.env` configuration** — Create a `.env` file (in the workspace root or `.vscode/mcps/`) to pre-configure MCP server settings like the Koji base URL and pre-approved insecure URLs. This avoids the agent having to set the URL or approve self-signed certificates every session. See [.vscode/mcps/.env.example](.vscode/mcps/.env.example) for available variables.
40+
3. **(Optional) `.env` configuration** — Create a `.env` file (in the workspace root or `scripts/mcps/`) to pre-configure MCP server settings like the Koji base URL and pre-approved insecure URLs. This avoids the agent having to set the URL or approve self-signed certificates every session. See [scripts/mcps/.env.example](scripts/mcps/.env.example) for available variables.
4141

4242
Ask Copilot about any aspect of the project — it can reference the instructions and skills to provide detailed, actionable answers or perform tasks. For example:
4343

scripts/batch-triage/triage.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ REPO_ROOT="$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel)"
7878

7979
# Always build — layer caching makes this fast when nothing changed
8080
# Copy requirements.txt into the build context (COPY can't reach outside it)
81-
cp "${REPO_ROOT}/.vscode/mcps/requirements.txt" "${SCRIPT_DIR}/requirements.txt"
81+
cp "${REPO_ROOT}/scripts/mcps/requirements.txt" "${SCRIPT_DIR}/requirements.txt"
8282
# Trap will not fire for exec, but will cover cleanup if the build step fails
8383
trap 'rm -f "${SCRIPT_DIR}/requirements.txt"' EXIT
8484

@@ -103,13 +103,16 @@ DOCKER_ARGS+=( -u "$(id -u):$(id -g)" )
103103

104104
# Require a .env file for MCP server config (Koji URL, auth, etc.)
105105
ENV_FILE=""
106-
if [[ -f "${REPO_ROOT}/.vscode/mcps/.env" ]]; then
107-
ENV_FILE="${REPO_ROOT}/.vscode/mcps/.env"
108-
elif [[ -f "${REPO_ROOT}/.env" ]]; then
106+
if [[ -f "${REPO_ROOT}/.env" ]]; then
109107
ENV_FILE="${REPO_ROOT}/.env"
108+
elif [[ -f "${REPO_ROOT}/scripts/mcps/.env" ]]; then
109+
ENV_FILE="${REPO_ROOT}/scripts/mcps/.env"
110+
elif [[ -f "${REPO_ROOT}/.vscode/mcps/.env" ]]; then
111+
# Legacy location from when MCP scripts lived under .vscode/mcps/
112+
ENV_FILE="${REPO_ROOT}/.vscode/mcps/.env"
110113
else
111-
echo "Error: No .env file found. Create one at .env in the repo root or .vscode/mcps/.env" >&2
112-
echo "See .vscode/mcps/.env.example for required variables." >&2
114+
echo "Error: No .env file found. Create one at .env in the repo root or scripts/mcps/.env" >&2
115+
echo "See scripts/mcps/.env.example for required variables." >&2
113116
echo "Koji MCP will not auto-configure without this file." >&2
114117
exit 1
115118
fi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copy this file to .env to one of the following locations to set environment variables for the MCP servers:
44
# - .env in the workspace root
5-
# - .vscode/mcps/.env
5+
# - scripts/mcps/.env
66
#
77
# These variables are loaded by the MCP servers at startup. They can also
88
# be set as regular environment variables (env vars take precedence).
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Shared utilities for Azure Linux MCP servers.
1+
"""Shared utilities for Azure Linux MCP servers.
32
43
Provides common helpers for URL validation, SSRF guards, output handling,
54
and .env file loading so individual MCP servers stay DRY.
@@ -18,7 +17,7 @@
1817
# Return type for all MCP tools — values may be str, int, list, or None.
1918
StatusDict = dict[str, Any]
2019

21-
_INSTALL_HINT = "Install with: pip3 install --user -r .vscode/mcps/requirements.txt"
20+
_INSTALL_HINT = "Install with: pip3 install --user -r scripts/mcps/requirements.txt"
2221

2322
try:
2423
from dotenv import load_dotenv
@@ -50,8 +49,9 @@ def load_env(env_path: str | Path | None = None) -> None:
5049
1. Explicit ``env_path`` argument
5150
2. ``.env`` in the current working directory
5251
3. ``.env`` in the workspace root (two dirs up from this source file)
53-
4. ``.vscode/mcps/.env`` relative to the working directory
54-
5. ``.vscode/mcps/.env`` next to this source file
52+
4. ``scripts/mcps/.env`` next to this source file
53+
5. ``.vscode/mcps/.env`` relative to the working directory (legacy)
54+
6. ``.vscode/mcps/.env`` in the workspace root (legacy)
5555
5656
Uses python-dotenv for parsing. Existing env vars are NOT overridden.
5757
"""
@@ -60,8 +60,10 @@ def load_env(env_path: str | Path | None = None) -> None:
6060
candidates.append(Path(env_path))
6161
candidates.append(Path.cwd() / ".env")
6262
candidates.append(Path(__file__).resolve().parent.parent.parent / ".env")
63-
candidates.append(Path.cwd() / ".vscode" / "mcps" / ".env")
6463
candidates.append(Path(__file__).resolve().parent / ".env")
64+
# Legacy locations from when MCP scripts lived under .vscode/mcps/
65+
candidates.append(Path.cwd() / ".vscode" / "mcps" / ".env")
66+
candidates.append(Path(__file__).resolve().parent.parent.parent / ".vscode" / "mcps" / ".env")
6567

6668
for c in candidates:
6769
if c.is_file():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
)
7676

7777

78-
def _add_status(result: StatusDict, *, full: bool) -> StatusDict:
78+
def _add_status(result: StatusDict, full: bool) -> StatusDict:
7979
"""Build a snapshot of the MCP server's current state."""
8080
status = {
8181
"default_base_url": _base_url,

0 commit comments

Comments
 (0)