From 5006202f8c24ca2e9118b772727cf9f6cc34b692 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 14 May 2026 14:34:51 -0500 Subject: [PATCH 1/3] fix: don't set COPILOT_HOME, and provide MCP instructions instead --- .../eic/copilot/mcp-config.instructions.md | 41 +++++++++++++++++++ containers/eic/profile.d/z23_copilot_mcp.sh | 14 +++---- 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 containers/eic/copilot/mcp-config.instructions.md diff --git a/containers/eic/copilot/mcp-config.instructions.md b/containers/eic/copilot/mcp-config.instructions.md new file mode 100644 index 00000000..7967c685 --- /dev/null +++ b/containers/eic/copilot/mcp-config.instructions.md @@ -0,0 +1,41 @@ +## Container Environment: Available MCP Servers + +This session is running inside a container that has the following MCP servers +pre-installed and ready to use. They are **not active by default** — the user +must add them to their personal configuration once. + +### Available servers + +| Name | Description | +|------|-------------| +| `eic-xrootd-mcp-server` | Access EIC data via XRootD from the JLab data transfer node (`root://dtn-eic.jlab.org`) | +| `eic-zenodo-mcp-server` | Browse and retrieve EIC datasets and publications from Zenodo (`https://zenodo.org`) | + +### How to enable + +If the user asks about EIC data, simulation inputs, published datasets, or anything +that would benefit from remote file or repository access, suggest they enable the +relevant server(s) by editing `~/.copilot/mcp-config.json`. + +If the file does not exist, create it. Add or merge the following: + +```json +{ + "mcpServers": { + "eic-xrootd-mcp-server": { + "command": "/opt/local/bin/xrootd-mcp-server", + "env": { + "XROOTD_SERVER": "root://dtn-eic.jlab.org" + } + }, + "eic-zenodo-mcp-server": { + "command": "/opt/local/bin/zenodo-mcp-server", + "env": { + "ZENODO_BASE_URL": "https://zenodo.org" + } + } + } +} + +After saving the file, run /mcp show to confirm the servers are active. The configuration persists across +sessions in the user's home directory. diff --git a/containers/eic/profile.d/z23_copilot_mcp.sh b/containers/eic/profile.d/z23_copilot_mcp.sh index bf0633dc..ecd92848 100644 --- a/containers/eic/profile.d/z23_copilot_mcp.sh +++ b/containers/eic/profile.d/z23_copilot_mcp.sh @@ -1,18 +1,16 @@ #!/bin/sh -## Set COPILOT_HOME to /etc/copilot so github-copilot reads MCP server -## configuration directly from the system-level config, rather than from -## ~/.copilot. This works for Singularity/Apptainer users whose home -## directory is bind-mounted from the host at runtime. +## Set COPILOT_CUSTOM_INSTRUCTIONS_DIRS to /etc/copilot so github-copilot +## reads custom instructions with a pointer to MCP server configuration. ## ## To revert to ~/.copilot (or any other directory), add the following ## to your ~/.bashrc: -## unset COPILOT_HOME +## unset COPILOT_CUSTOM_INSTRUCTIONS_DIRS -if [ -z "${COPILOT_HOME:-}" ]; then - export COPILOT_HOME=/etc/copilot +if [ -z "${COPILOT_CUSTOM_INSTRUCTIONS_DIRS:-}" ]; then + export COPILOT_CUSTOM_INSTRUCTIONS_DIRS=/etc/copilot else case "$-" in - *i*) printf '%s\n' "Note: COPILOT_HOME is already set to '${COPILOT_HOME}'; not overriding with /etc/copilot." >&2 ;; + *i*) printf '%s\n' "Note: COPILOT_CUSTOM_INSTRUCTIONS_DIRS is already set to '${COPILOT_CUSTOM_INSTRUCTIONS_DIRS}'; not overriding with /etc/copilot." >&2 ;; esac fi From 802c33d879744c6e6a64836094081ae4984be974 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 14 May 2026 14:49:01 -0500 Subject: [PATCH 2/3] fix: close code fence --- containers/eic/copilot/mcp-config.instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/containers/eic/copilot/mcp-config.instructions.md b/containers/eic/copilot/mcp-config.instructions.md index 7967c685..01209395 100644 --- a/containers/eic/copilot/mcp-config.instructions.md +++ b/containers/eic/copilot/mcp-config.instructions.md @@ -36,6 +36,7 @@ If the file does not exist, create it. Add or merge the following: } } } +``` After saving the file, run /mcp show to confirm the servers are active. The configuration persists across sessions in the user's home directory. From b5286de1807d1b9c38513c321000b9626f45fc70 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 14 May 2026 14:50:18 -0500 Subject: [PATCH 3/3] fix: install all of copilot/ into /etc/copilot Removed specific MCP server configuration and updated the copy command to include the entire copilot directory. --- containers/eic/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/containers/eic/Dockerfile b/containers/eic/Dockerfile index 9bc99e13..89660f43 100644 --- a/containers/eic/Dockerfile +++ b/containers/eic/Dockerfile @@ -376,10 +376,8 @@ COPY eic-env.sh /etc/eic-env.sh COPY profile.d/* /etc/profile.d COPY singularity.d /.singularity.d -## System-level Copilot MCP server defaults. -## /opt/local/bin/xrootd-mcp-server is the Spack view path for the -## xrootd-mcp-server package (installed like github-copilot via npm --global). -COPY copilot/mcp-config.json /etc/copilot/mcp-config.json +## System-level Copilot server defaults. +COPY copilot/ /etc/copilot/ ## set ROOT TFile forward compatibility RUN sed --in-place --follow-symlinks 's/# \(TFile.v630forwardCompatibility:\) no/\1 yes/' /opt/local/etc/root/system.rootrc