-
Notifications
You must be signed in to change notification settings - Fork 0
Test mcp #163
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
d-morrison
wants to merge
24
commits into
main
Choose a base branch
from
test-mcp
base: main
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.
Open
Test mcp #163
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
493f765
Initial plan
Copilot c2a2e1f
Add MCP configuration, dev environment, and enhance Copilot instructions
Copilot ed3b35f
Add DEVELOPMENT.md guide and MCP verification script
Copilot 2d5dde2
Add comprehensive MCP and dev environment documentation
Copilot 23438e1
Fix code review issues: correct URLs, improve error handling, update …
Copilot 551a550
Merge branch 'main' into copilot/configure-model-context-protocol-ser…
d-morrison 71e2e67
Merge remote-tracking branch 'origin/copilot/configure-model-context-…
d-morrison c46866f
Initial plan
Copilot e1d7822
Initial plan
Copilot 8c4bec5
Fix pkgdown workflow: correct file paths and update deprecated actions
Copilot 6ff113f
Optimize JAGS dependencies: remove unused platform steps from test-co…
Copilot d62b98d
Update pkgdown.yaml
d-morrison 7d022a1
ignore pdfs
d-morrison 969b20a
Fix getting-started.qmd: correct data variable references and remove …
Copilot e79c669
Remove Rplots.pdf and add to .gitignore
Copilot a6c08a0
Update pkgdown.yaml
d-morrison e485f0c
Merge branch 'test-mcp' into copilot/sub-pr-163-again
d-morrison ddfc3d4
Merge pull request #164 from UCD-SERG/copilot/sub-pr-163
d-morrison 432dbac
Merge pull request #165 from UCD-SERG/copilot/sub-pr-163-again
d-morrison ffd2370
Merge branch 'main' into test-mcp
d-morrison 0914ed2
Merge branch 'main' into test-mcp
d-morrison fe57e7d
Initial plan
Copilot 0b13d9f
Address PR review comments: fix indentation, update paths, use offici…
Copilot 3c7d7a0
Merge pull request #169 from UCD-SERG/copilot/sub-pr-163-again
d-morrison 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,6 @@ | |
|
|
||
| ^_quarto\.yml$ | ||
| ^\.quarto$ | ||
| ^\.vscode$ | ||
| ^\.devcontainer$ | ||
| ^DEVELOPMENT\.md$ | ||
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,155 @@ | ||
| # Development Container Configuration | ||
|
|
||
| This directory contains the configuration for a containerized development environment for the serodynamics R package. | ||
|
|
||
| ## What is a Dev Container? | ||
|
|
||
| Dev Containers allow you to use a Docker container as a full-featured development environment. This ensures that all developers work in a consistent environment with the same dependencies, tools, and configurations. | ||
|
|
||
| ## Features | ||
|
|
||
| The serodynamics dev container includes: | ||
|
|
||
| - **R Environment**: Based on `rocker/tidyverse:latest` with R and tidyverse packages | ||
| - **JAGS**: Pre-installed JAGS 4.3.1 for Bayesian MCMC modeling | ||
| - **System Dependencies**: All required system libraries for R package development | ||
| - **R Development Tools**: devtools, roxygen2, testthat, lintr, spelling, covr | ||
| - **Quarto**: For rendering vignettes and documentation | ||
| - **VS Code Extensions**: R debugger, language support, GitHub Copilot, and more | ||
| - **Git & GitHub CLI**: For version control and GitHub integration | ||
| - **Node.js**: For MCP server support | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| 1. **Docker Desktop**: Install from https://www.docker.com/products/docker-desktop | ||
| 2. **VS Code**: Install from https://code.visualstudio.com/ | ||
| 3. **Dev Containers Extension**: Install from VS Code marketplace | ||
|
|
||
| ### Opening the Dev Container | ||
|
|
||
| 1. Open the serodynamics repository in VS Code | ||
| 2. Press `F1` or `Ctrl+Shift+P` (Cmd+Shift+P on macOS) | ||
| 3. Select "Dev Containers: Reopen in Container" | ||
| 4. Wait for the container to build (first time may take 5-10 minutes) | ||
| 5. Once ready, you'll have a fully configured development environment | ||
|
|
||
| ### Using the Dev Container | ||
|
|
||
| After opening in the container: | ||
|
|
||
| ```r | ||
| # Load the package in development mode | ||
| devtools::load_all() | ||
|
|
||
| # Run tests | ||
| devtools::test() | ||
|
|
||
| # Check the package | ||
| devtools::check() | ||
|
|
||
| # Generate documentation | ||
| devtools::document() | ||
|
|
||
| # Lint the code | ||
| lintr::lint_package() | ||
| ``` | ||
|
|
||
| You can also use VS Code tasks (Ctrl+Shift+P -> "Tasks: Run Task") to run common operations. | ||
|
|
||
| ## Container Configuration | ||
|
|
||
| ### devcontainer.json | ||
|
|
||
| The main configuration file that defines: | ||
| - Base Docker image | ||
| - VS Code extensions to install | ||
| - VS Code settings | ||
| - Port forwarding (8787 for RStudio Server) | ||
| - Environment variables | ||
| - Post-create commands | ||
|
|
||
| ### setup.sh | ||
|
|
||
| Runs after the container is created to: | ||
| - Install JAGS | ||
| - Install system dependencies | ||
| - Install Quarto | ||
| - Install R development packages | ||
| - Install package dependencies | ||
| - Verify JAGS installation | ||
|
|
||
| ## RStudio Server Access | ||
|
|
||
| The container includes RStudio Server running on port 8787. To access it: | ||
|
|
||
| 1. After the container starts, open http://localhost:8787 in your browser | ||
| 2. Login with: | ||
| - Username: `rstudio` | ||
| - Password: `rstudio` (default) | ||
|
|
||
| ## Customization | ||
|
|
||
| ### Adding R Packages | ||
|
|
||
| Edit `setup.sh` to add more R packages to the base installation. | ||
|
|
||
| ### Adding VS Code Extensions | ||
|
|
||
| Edit the `extensions` array in `devcontainer.json`. | ||
|
|
||
| ### Adding System Dependencies | ||
|
|
||
| Edit the `apt-get install` command in `setup.sh`. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Container fails to build | ||
|
|
||
| 1. Ensure Docker Desktop is running | ||
| 2. Check that you have sufficient disk space (container is ~2-3 GB) | ||
| 3. Try rebuilding: "Dev Containers: Rebuild Container" | ||
|
|
||
| ### JAGS not found | ||
|
|
||
| The setup script should install JAGS automatically. If it fails: | ||
|
|
||
| 1. Rebuild the container | ||
| 2. Check the setup.sh logs for errors | ||
| 3. Manually install JAGS in the container terminal | ||
|
|
||
| ### R packages not installing | ||
|
|
||
| 1. Check internet connection | ||
| 2. Try installing manually: `Rscript -e "devtools::install_dev_deps()"` | ||
| 3. Check for system dependency errors in the logs | ||
|
|
||
| ### Performance issues | ||
|
|
||
| 1. Allocate more resources to Docker Desktop (Settings -> Resources) | ||
| 2. Close other containers and applications | ||
| 3. Use a local R installation for better performance on simple tasks | ||
|
|
||
| ## Benefits of Using Dev Containers | ||
|
|
||
| 1. **Consistency**: Everyone works in the same environment | ||
| 2. **Isolation**: Development environment is separate from your system | ||
| 3. **Reproducibility**: Easy to share and recreate the environment | ||
| 4. **Onboarding**: New contributors can start immediately | ||
| 5. **Clean System**: No need to install R, JAGS, or dependencies on your system | ||
|
|
||
| ## Alternative: Codespaces | ||
|
|
||
| This dev container configuration also works with GitHub Codespaces: | ||
|
|
||
| 1. Navigate to the repository on GitHub | ||
| 2. Click "Code" -> "Codespaces" -> "Create codespace on main" | ||
| 3. Wait for the environment to set up | ||
| 4. Start coding in your browser or connect from VS Code | ||
|
|
||
| ## References | ||
|
|
||
| - [Dev Containers Documentation](https://code.visualstudio.com/docs/devcontainers/containers) | ||
| - [Rocker Project](https://rocker-project.org/) | ||
| - [GitHub Codespaces](https://github.com/features/codespaces) |
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,55 @@ | ||
| { | ||
| "name": "serodynamics R Package Development", | ||
| "image": "rocker/tidyverse:latest", | ||
|
|
||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {}, | ||
| "ghcr.io/devcontainers/features/github-cli:1": {}, | ||
| "ghcr.io/devcontainers/features/node:1": { | ||
| "version": "lts" | ||
| } | ||
| }, | ||
|
|
||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { | ||
| "r.rterm.linux": "/usr/local/bin/R", | ||
| "r.rpath.linux": "/usr/local/bin/R", | ||
| "terminal.integrated.defaultProfile.linux": "bash" | ||
| }, | ||
| "extensions": [ | ||
| "rdebugger.r-debugger", | ||
| "reditorsupport.r", | ||
| "github.copilot", | ||
| "github.copilot-chat", | ||
| "quarto.quarto", | ||
| "redhat.vscode-yaml", | ||
| "yzhang.markdown-all-in-one", | ||
| "streetsidesoftware.code-spell-checker", | ||
| "eamodio.gitlens" | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| "postCreateCommand": "bash .devcontainer/setup.sh", | ||
|
|
||
| "remoteUser": "rstudio", | ||
|
|
||
| "forwardPorts": [8787], | ||
|
|
||
| "portsAttributes": { | ||
| "8787": { | ||
| "label": "RStudio Server", | ||
| "onAutoForward": "notify" | ||
| } | ||
| }, | ||
|
|
||
| "mounts": [ | ||
| "source=${localWorkspaceFolder}/.Rprofile,target=/home/rstudio/.Rprofile,type=bind,consistency=cached" | ||
| ], | ||
|
|
||
| "containerEnv": { | ||
| "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}", | ||
| "TZ": "UTC" | ||
| } | ||
| } |
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,63 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "Setting up serodynamics development environment..." | ||
|
|
||
| # Update package list | ||
| echo "Updating package list..." | ||
| apt-get update | ||
|
|
||
| # Install JAGS (required for serodynamics) | ||
| echo "Installing JAGS..." | ||
| apt-get install -y jags | ||
|
|
||
| # Install system dependencies for R packages | ||
| echo "Installing system dependencies..." | ||
| apt-get install -y \ | ||
| libcurl4-openssl-dev \ | ||
| libssl-dev \ | ||
| libxml2-dev \ | ||
| libfontconfig1-dev \ | ||
| libharfbuzz-dev \ | ||
| libfribidi-dev \ | ||
| libfreetype6-dev \ | ||
| libpng-dev \ | ||
| libtiff5-dev \ | ||
| libjpeg-dev \ | ||
| libgit2-dev | ||
|
|
||
| # Install Quarto | ||
| echo "Installing Quarto..." | ||
| QUARTO_VERSION="1.6.40" # Updated to latest stable version (January 2026) | ||
| wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb | ||
| dpkg -i quarto-${QUARTO_VERSION}-linux-amd64.deb | ||
| rm quarto-${QUARTO_VERSION}-linux-amd64.deb | ||
|
|
||
| # Install R packages needed for development | ||
| echo "Installing R development packages..." | ||
| Rscript -e "install.packages(c('devtools', 'roxygen2', 'testthat', 'lintr', 'spelling', 'covr', 'rcmdcheck', 'pak'), repos = 'https://cloud.r-project.org')" | ||
|
|
||
| # Install rjags from source (required for JAGS interface) | ||
| echo "Installing rjags..." | ||
| Rscript -e "install.packages('rjags', repos = 'https://cloud.r-project.org', type = 'source')" | ||
|
|
||
| # Install package dependencies | ||
| echo "Installing package dependencies..." | ||
| Rscript -e "if (!requireNamespace('pak', quietly = TRUE)) install.packages('pak', repos = 'https://cloud.r-project.org'); pak::local_install_dev_deps(dependencies = TRUE)" | ||
|
|
||
| # Verify JAGS installation | ||
| echo "Verifying JAGS installation..." | ||
| Rscript -e "library(rjags); library(runjags); runjags::testjags()" | ||
|
|
||
| # Clean up | ||
| echo "Cleaning up..." | ||
| apt-get clean | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| echo "Development environment setup complete!" | ||
| echo "" | ||
| echo "You can now:" | ||
| echo " - Run 'devtools::load_all()' to load the package" | ||
| echo " - Run 'devtools::test()' to run tests" | ||
| echo " - Run 'devtools::check()' to check the package" | ||
| echo " - Use VS Code tasks (Ctrl+Shift+P -> Tasks: Run Task)" | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pak package is installed twice: first in line 38 as part of the development packages array, and then checked again in line 46 with a conditional install. This is redundant. Since pak is already installed in line 38, the conditional check in line 46 is unnecessary and can be simplified to just "pak::local_install_dev_deps(dependencies = TRUE)".