-
Notifications
You must be signed in to change notification settings - Fork 4
fix: don't set COPILOT_HOME, and provide MCP instructions instead #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wdconinc
wants to merge
3
commits into
master
Choose a base branch
from
copilot-home
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+50
−12
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| ## Container Environment: Available MCP Servers | ||
|
wdconinc marked this conversation as resolved.
|
||
|
|
||
| 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. | ||
|
wdconinc marked this conversation as resolved.
|
||
|
|
||
| ### 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 | ||
|
wdconinc marked this conversation as resolved.
|
||
| sessions in the user's home directory. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.