Sharing is caring! All contributions to this repository are very welcome. This guidance should help you getting started contributing to the PnP PowerShell MCP Server by just following some easy steps.
There are various ways to accomplish the same goal. We'll go through a process here that should be easy to follow and accomplish for anyone. If you prefer using other tools over the ones mentioned here, such as using the cloning feature within Visual Studio, feel free to use that instead.
Follow the paragraphs below to get yourself started with contributing to this repository.
We'll be using the command line Git Tools to complete the steps. If you prefer using other tools, such as Visual Studio or the desktop client of Git, feel free to use that instead.
-
If you haven't got them already, install the Git Tools for your environment. They're available for Windows, Linux and Mac. Simply download the latest installer from: https://git-scm.com/downloads
-
There will be a lot of questions asked during the installer. Just use all defaults and next-next-finish through the installation process.
This project requires PowerShell 7 when you run and test the MCP server behavior that depends on pwsh and the PnP PowerShell module.
-
Navigate to the PowerShell 7 download page and download the latest version of PowerShell 7: https://learn.microsoft.com/powershell/scripting/install/installing-powershell
-
You can accept all the defaults and just do a next-next-finish installation.
To be able to compile this repository, you need to have the .NET SDK 10 installed. If you don't have it installed yet, follow the steps below.
-
Navigate to the .NET download page and download the latest .NET 10 SDK: https://dotnet.microsoft.com/download
-
You can accept all the defaults and just do a next-next-finish installation.
To contribute to a GitHub project, what you do first is create a fork. Basically it means you will get your own copy of the source code. To do so, follow the steps below.
-
Go to the repository on GitHub: https://github.com/pnp/pnp-powershell-mcp-server
-
Make sure you're logged on to GitHub. If you don't have a GitHub account yet, create one and log on first before you continue.
-
Click the Fork button in the top right corner of the page.
-
In the fork creation options, uncheck Copy the main branch only.
Now that you have your own fork, you need to make sure it's up to date with the latest changes from the main repository. Do this every time before you start working on a change. If you don't do so, it will become much harder for us to review and merge your changes.
Important: this project accepts pull requests against the dev branch only.
-
First identify if your forked dev branch is already up to date.
-
If it is behind, click Sync fork and then Update branch in GitHub.
-
If you prefer command line, run:
git fetch upstream git checkout dev git merge upstream/dev git push origin dev
The next step is to download, or clone, your fork of the repository to your local machine so you can work on updating it.
-
Open a command prompt or PowerShell window and navigate to the folder where you want to clone the repository to. For example, if you want to clone it to your C:\Source folder, you would do the following:
cd C:\Source
-
Look up the URL of your fork. You can find it by clicking on the Code button on your forked repository on GitHub.
-
In the command prompt or PowerShell window, type the following command and replace the URL with the URL of your fork:
git clone <URL of repository>
-
Add a reference to the upstream repository. This will allow you to pull in changes from the main repository to your local copy:
git remote add upstream https://github.com/pnp/pnp-powershell-mcp-server.git
-
Validate if the upstream has been added successfully by executing:
git remote -v -
Ensure you have a local
devbranch that tracks your fork'sdevbranch:git fetch origin git checkout -b dev origin/dev
If you already have a local
devbranch, use:git checkout dev git pull origin dev
You are now ready to start making changes to the code.
-
Open Visual Studio Code and use File > Open Folder.
-
Select the folder you cloned for this repository.
-
If a dialog pops up asking if you trust the authors of the files in the folder, click Yes, I trust the authors.
-
Before starting to make changes, create a new branch for your changes from dev.
git checkout dev git pull origin dev git checkout -b <your-branch-name>
-
Double-check that your feature branch is based on
devand notmain. -
Use a distinctive branch name that makes it easy to identify the change.
Some hints on how to work with Visual Studio Code more easily:
- Use CTRL+P to search for existing files quickly.
- Please only submit one type of change per pull request. If you want to submit multiple changes, please submit them as separate pull requests.
If you have only updated documentation files, there is usually no need to run deeper validation. Read through your changes once more to ensure there are no typos.
If you have updated code, you need to test your changes to make sure they work as expected.
-
Build from the repository root:
dotnet build
-
Run the MCP server from source:
dotnet run --project ./PnPPowerShell.MCPServer.csproj
-
Optionally use MCP Inspector to validate tools locally:
npx @modelcontextprotocol/inspector dotnet run --project ./PnPPowerShell.MCPServer.csproj
-
If you are making packaging changes, verify your publish flow on at least one RID:
dotnet publish -c Release -r win-x64 --self-contained
Once you're done making and testing your changes, you need to submit them for review in a Pull Request, or PR in short.
-
Within Visual Studio Code, go to Source Control, review your changes and commit them with a meaningful commit message.
-
Push your branch to GitHub.
-
Open your browser and go to: https://github.com/pnp/pnp-powershell-mcp-server
-
Click Compare and pull request.
-
Important: set the base branch to dev. Pull requests must target dev only.
-
Provide a meaningful title and a description that explains what you changed and why.
-
Keep Allow edits from maintainers enabled.
Thanks for contributing!
-
First proceed with the steps in the Cloning the repository to your local file system section to make sure you have a local copy of your version of the code.
-
In a command prompt or PowerShell window, navigate to the folder where you cloned the repository to and execute:
git fetch upstream
-
Execute the following command to reset your local dev branch to the upstream dev branch:
git checkout dev git reset --hard upstream/dev git push origin dev --force
Visual Studio Code shows a dialog mentioning Make sure you configure your user.name and user.email in git
If Visual Studio Code shows this dialog, click Cancel and open a PowerShell window and execute the following commands, replacing the values with your information:
git config --global user.name "John Doe"
git config --global user.email "johndoe@outlook.com"You only need to do this once on your machine.
Native AOT requires platform-specific toolchains:
- Windows: Visual Studio Desktop development with C++ workload
- macOS: Xcode command line tools
- Linux: clang and zlib1g-dev
For complete release instructions, see RELEASING.md.