salekin.dev
ls ..engineering notes
AI-Driven QA · 9 min read

GitHub Copilot + Azure Boards MCP: Where AI Actually Helps in QA

A practical look at AI-assisted test case ideation and MCP-driven defect reporting — including the parts that did not work, and what I would do differently.

The honest starting point

Most AI-in-QA conversations start with the weakest use case: "AI writes my tests." If your team struggles to maintain the tests it already has, adding a faster generator of tests makes the maintenance problem larger, not smaller.

I started from the other end. Where does a senior QA engineer spend time that a machine could genuinely do better? For me it was three places: expanding a requirement into edge cases, triaging a stack trace, and writing the same five sentences of defect description for the fortieth time.

Test case ideation as a breadth problem

When you read a requirement, the cases you forget are the boring ones — the empty field, the expired token, the request that arrives twice, the timezone that is not local. Asking an LLM for "edge cases for this requirement" produces a broad list cheaply, and broad is exactly what you want here.

The trick is giving it the requirement in its raw form. I paste the acceptance criteria, the API contract, and the domain rules, then ask for cases grouped by risk category rather than by feature area. Grouping by risk is what makes the output triageable — a list grouped by feature is just a longer list.

textcopilot prompt — test case ideation
You are a senior QA engineer working on a payment API.

ACCEPTANCE CRITERIA
  1. A booking is created for a valid customer and vehicle.
  2. A booking for an overlapping time window is rejected with 409.
  3. A booking is idempotent on the same idempotency key.

DOMAIN RULES
  - Booking windows are 15 minutes.
  - A vehicle that is "in service" cannot be booked.

Produce test cases grouped by RISK CATEGORY, not by feature.
For each case give: id, precondition, steps, expected result.
Do not repeat the happy path across groups.

MCP: connecting the model to the tracker

The Model Context Protocol is the piece that makes AI useful beyond the chat window. An MCP server exposes a tool — "create a defect in Azure Boards", "read the sprint board" — and the model can call it.

The first practical win for me was defect reporting. Writing a good defect takes four things: a title, steps to reproduce, actual vs expected, and the environment. The model already has the failing test, the stack trace, and the run URL. With an Azure Boards MCP server, it can assemble those into a correctly-linked, correctly-labelled work item.

typescriptmcp/azure-boards-defect.ts
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new Server(
  { name: 'azure-boards-qa', version: '1.0.0' },
  { capabilities: { tools: {} } },
);

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: 'create_defect',
      description: 'Create a QA defect work item from a failed test run.',
      inputSchema: {
        type: 'object',
        properties: {
          title: { type: 'string' },
          reproSteps: { type: 'array', items: { type: 'string' } },
          actual: { type: 'string' },
          expected: { type: 'string' },
          runUrl: { type: 'string' },
        },
        required: ['title', 'reproSteps', 'actual', 'expected'],
      },
    },
  ],
}));

// The tool handler keeps Azure auth server-side. The model never sees
// a PAT — it only ever calls this function.
server.setRequestHandler(CallToolRequestSchema, async (req) => {
  if (req.params.name === 'create_defect') {
    const args = req.params.arguments as CreateDefectInput;
    const workItem = await azureBoards.createWorkItem({
      type: 'Bug',
      title: args.title,
      reproSteps: args.reproSteps.join('\n'),
      tags: ['qa-automation'],
    });
    return {
      content: [{ type: 'text', text: `Created work item ${workItem.id}` }],
    };
  }
  throw new Error(`Unknown tool: ${req.params.name}`);
});

await server.connect(new StdioServerTransport());

Where it fell short

Being specific here saves everyone time. The model was unreliable at triaging intermittent failures — it would confidently attribute a timeout to the wrong subsystem because the log did not contain the information needed to distinguish them.

It also needed a lot of guarding. A defect-creation tool that runs without validation will happily file duplicate work items on every CI retry, so I had to make the idempotency key the test run ID.

And the security boundary is the thing to get right early: the model should never hold a personal access token. The MCP server holds the credential and the model only calls the tool.

  • Triage of intermittent failures stayed manual — the logs lacked the context
  • Idempotency had to be enforced server-side using the CI run ID
  • Credentials stayed in the MCP server; the model only ever calls tools

Key Takeaways

  • Start with breadth of edge cases, not speed of test generation — breadth is the case a machine wins.
  • MCP is what turns a chat assistant into a workflow tool: it can act in Azure Boards, not just advise.
  • Keep every credential server-side. The model calls tools; it never holds tokens.
  • Guard non-idempotent tools with a CI run ID or you will file duplicates on every retry.
Next articleBuilding a Zero-Dependency Playwright Summary Reporter