Repository navigation
Testing and Sandbox
This page describes how to run the automated tests and set up a safe, isolated sandbox environment to test the Azure DevOps MCP server tools without impacting production projects.
Caution
CRITICAL WARNING: Destructive Actions & Work Item Deletions
- Using the testing commands or playing with the API can lead to unintended deletions.
- Azure DevOps does NOT keep a recycle bin or trashcan for work items deleted via the REST API. Always test deletions and other modification tools inside a sandbox environment rather than a live production organization.
To test the tools safely, we recommend creating a free Azure DevOps sandbox organization:
- Go to Azure DevOps (dev.azure.com).
- Sign in with a personal Microsoft Account (MSA) or corporate identity.
- Create a new organization (e.g.,
my-mcp-sandbox-org). - Create a new private project (e.g.,
TestProject).
To make sure all tools (Git, WIT, Pipelines, and Identities) have resources to interact with, populate the project with some test data:
- Navigate to Repos > Files.
- If the repository is empty, click Initialize to create a default repository with a
mainbranch and aREADME.md. - Optionally, add a folder (e.g.,
src/) and a few dummy files (e.g.,src/index.htmlorsrc/config.json).
- Navigate to Boards > Work Items.
- Create at least two work items:
- A Bug with the title
Test Bugand a basic description. - A Task with the title
Test Task.
- A Bug with the title
- Note the IDs of these work items (they will be integers like
1,2, etc.).
- Navigate to Pipelines > Pipelines.
- Click Create Pipeline.
- Choose Azure Repos Git and select your repository.
- Select Starter pipeline (this generates a simple pipeline that runs echo commands).
- Click Save and Run.
- Note the Pipeline ID (visible in the URL, e.g.,
definitionId=1).
- Navigate to Project Settings > Permissions or Teams.
- Invite a second test email or note your own display name and email address to verify identity search.
The codebase includes an integrated test suite in src/test.ts that tests internal helper functions (URL parser, crypto, config store, offline API database).
To run these tests:
npm run testThe tests are self-contained and use placeholder organizations (my-org, anotherorg) with fake tokens, so no changes to src/test.ts are required and no network access to Azure DevOps is needed.
However, the configuration-store test writes these dummy entries into your local encrypted credential file (.azure-devops-config.enc in the project folder). If you already saved real credentials there, back the file up before running the tests and restore it afterwards (or simply re-run npm run setup).