-
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 21 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,4 +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 |
|---|---|---|
| @@ -1,39 +1,55 @@ | ||
| { | ||
| "name": "serodynamics R Development", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| "name": "serodynamics R Package Development", | ||
| "image": "rocker/tidyverse:latest", | ||
|
|
||
| // Features to add to the dev container | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {} | ||
| "ghcr.io/devcontainers/features/git:1": {}, | ||
| "ghcr.io/devcontainers/features/github-cli:1": {}, | ||
| "ghcr.io/devcontainers/features/node:1": { | ||
| "version": "lts" | ||
| } | ||
| }, | ||
|
|
||
| // Configure tool-specific properties | ||
|
|
||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "REditorSupport.r", | ||
| "GitHub.copilot" | ||
| ], | ||
| "settings": { | ||
| "r.rterm.linux": "/usr/local/bin/R", | ||
| "r.rpath.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" | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| // Use 'postCreateCommand' to run commands after the container is created | ||
|
|
||
| "postCreateCommand": "bash .devcontainer/setup.sh", | ||
|
|
||
| // Set the default shell | ||
|
|
||
| "remoteUser": "rstudio", | ||
|
|
||
| // Forward ports for RStudio Server (optional) | ||
| "forwardPorts": [8787], | ||
|
|
||
| // Persist command history across container rebuilds | ||
| "portsAttributes": { | ||
| "8787": { | ||
| "label": "RStudio Server", | ||
| "onAutoForward": "notify" | ||
| } | ||
| }, | ||
|
|
||
| "mounts": [ | ||
| "source=serodynamics-bashhistory,target=/commandhistory,type=volume" | ||
| ] | ||
| "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 |
|---|---|---|
| @@ -1,21 +1,63 @@ | ||
| #!/bin/bash | ||
| # Post-creation setup script for the serodynamics dev container | ||
|
|
||
| set -e # Exit on error | ||
| set -e | ||
|
|
||
| echo "Setting up serodynamics development environment..." | ||
|
|
||
| # Set up persistent bash history | ||
| echo "Configuring bash history persistence..." | ||
| mkdir -p /commandhistory | ||
| touch /commandhistory/.bash_history | ||
| ln -sf /commandhistory/.bash_history /home/rstudio/.bash_history | ||
| # 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()" | ||
|
|
||
| # Install project-specific R dependencies | ||
| echo "Installing R package dependencies..." | ||
| if ! Rscript -e 'devtools::install_dev_deps(dependencies = TRUE)'; then | ||
| echo "Error: Failed to install R dependencies. Please check the output above for details." | ||
| exit 1 | ||
| fi | ||
| # Clean up | ||
| echo "Cleaning up..." | ||
| apt-get clean | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| echo "Setup complete! The environment is ready for development." | ||
| 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
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,117 @@ | ||
| # Model Context Protocol (MCP) Configuration | ||
|
|
||
| This directory contains the MCP server configuration for the serodynamics R package development environment. | ||
|
|
||
| ## What is MCP? | ||
|
|
||
| Model Context Protocol (MCP) is an open protocol that enables seamless integration between AI assistants and development tools. It allows AI assistants to interact with your development environment through standardized servers. | ||
|
|
||
| ## Configured MCP Servers | ||
|
|
||
| The `mcp-config.json` file configures the following MCP servers: | ||
|
|
||
| ### 1. Filesystem Server | ||
| - **Purpose**: Provides file system access to the repository | ||
| - **Use cases**: Reading/writing files, searching code, managing project structure | ||
| - **Scope**: `/home/runner/work/serodynamics/serodynamics` | ||
|
|
||
| ### 2. GitHub Server | ||
| - **Purpose**: Integrates with GitHub for repository operations | ||
| - **Use cases**: Issue tracking, pull requests, workflow management, CI/CD status | ||
| - **Authentication**: Uses `GITHUB_TOKEN` environment variable | ||
|
|
||
| ### 3. Git Server | ||
| - **Purpose**: Provides Git version control operations | ||
| - **Use cases**: Status checks, diff viewing, log inspection, commits, branch management | ||
| - **Scope**: Repository at `/home/runner/work/serodynamics/serodynamics` | ||
|
|
||
| ### 4. Brave Search Server | ||
| - **Purpose**: Enables web search capabilities | ||
| - **Use cases**: Finding R package documentation, CRAN resources, troubleshooting | ||
| - **Authentication**: Uses `BRAVE_API_KEY` environment variable (optional) | ||
|
|
||
| ## Setup Instructions | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| 1. **Node.js**: Required to run the MCP servers via `npx` | ||
| ```bash | ||
| # Check if Node.js is installed | ||
| node --version | ||
| npm --version | ||
| ``` | ||
|
|
||
| 2. **Environment Variables**: | ||
| - `GITHUB_TOKEN`: GitHub Personal Access Token (required for GitHub server) | ||
| - `BRAVE_API_KEY`: Brave Search API key (optional, for web search) | ||
|
|
||
| ### Using with GitHub Copilot | ||
|
|
||
| 1. **In VS Code**: | ||
| - Install the latest GitHub Copilot extension | ||
| - The MCP configuration will be automatically detected from `.github/mcp/mcp-config.json` | ||
| - Copilot will use these servers to enhance code suggestions and operations | ||
|
|
||
| 2. **In JetBrains IDEs**: | ||
| - Install GitHub Copilot plugin | ||
| - Configure MCP servers through the Copilot settings | ||
| - Point to this `mcp-config.json` file | ||
|
|
||
| ### Using with Claude Desktop | ||
|
|
||
| If you want to use these MCP servers with Claude Desktop: | ||
|
|
||
| 1. Copy the `mcpServers` section from `mcp-config.json` | ||
| 2. Add it to your Claude Desktop configuration: | ||
| - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json` | ||
| - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json` | ||
| - **Linux**: `~/.config/Claude/claude_desktop_config.json` | ||
|
|
||
| 3. Update the repository path in the configuration to your local clone path | ||
|
|
||
| ## Development Workflow Integration | ||
|
|
||
| The MCP servers are particularly useful for: | ||
|
|
||
| 1. **Code Navigation**: Quickly finding and reading R source files | ||
| 2. **Testing**: Checking test results and coverage | ||
| 3. **CI/CD**: Monitoring workflow status and debugging failures | ||
| 4. **Documentation**: Finding R package documentation and CRAN resources | ||
| 5. **Version Control**: Managing commits, branches, and reviewing changes | ||
|
|
||
| ## Best Practices | ||
|
|
||
| 1. **Always check Git status** before making commits using the Git MCP server | ||
| 2. **Use the GitHub server** to monitor CI/CD workflows and PR status | ||
| 3. **Leverage filesystem search** to find similar code patterns in the repository | ||
| 4. **Search the web** for R package documentation when implementing new features | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### MCP servers not starting | ||
|
|
||
| 1. Ensure Node.js is installed and `npx` is available | ||
| 2. Check that environment variables are set correctly | ||
| 3. Verify repository paths are correct for your system | ||
|
|
||
| ### GitHub authentication issues | ||
|
|
||
| 1. Ensure `GITHUB_TOKEN` is set with appropriate scopes: | ||
| - `repo` (full control of private repositories) | ||
| - `workflow` (update GitHub Action workflows) | ||
| - `read:org` (read org and team membership) | ||
|
|
||
| 2. Generate a new token at: https://github.com/settings/tokens | ||
|
|
||
| ### Permission issues | ||
|
|
||
| 1. Ensure the filesystem server has read/write access to the repository | ||
| 2. Check that you have the necessary GitHub repository permissions | ||
|
|
||
| ## References | ||
|
|
||
| - [MCP Specification](https://modelcontextprotocol.io/) | ||
| - [MCP Filesystem Server](https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem) | ||
| - [MCP GitHub Server](https://github.com/modelcontextprotocol/servers/tree/main/src/github) | ||
| - [MCP Git Server](https://github.com/modelcontextprotocol/servers/tree/main/src/git) | ||
| - [GitHub Copilot Documentation](https://docs.github.com/en/copilot) |
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)".