Beginner's Guide

VS Code + GitHub Copilot + Xero MCP Server

A step-by-step guide to setting up your AI-powered development environment and connecting it to Xero for accounting automation. No prior experience required.

1

Visual Studio Code (VS Code)

Your code editor. Think of it as Microsoft Word, but for code.

What is it?

VS Code is a free code editor made by Microsoft. It's the most popular editor in the world, used by millions of developers. It runs on Windows, Mac, and Linux. You can write any programming language in it, and it has thousands of extensions that add extra features.

How to install

  1. Go to code.visualstudio.com
  2. Click the big download button (it detects your operating system automatically)
  3. Run the installer and follow the prompts
  4. Open VS Code once it's installed

Key things to know

  • Extensions are add-ons that give VS Code new abilities (like GitHub Copilot). Install them from the Extensions panel on the left sidebar (the icon looks like four squares).
  • The Terminal is built into VS Code. Open it with Ctrl+` (or Cmd+` on Mac). This lets you run commands without leaving the editor.
  • The Command Palette (Ctrl+Shift+P / Cmd+Shift+P) is your best friend. It lets you search for any action in VS Code.
  • Settings Sync backs up your configuration to your GitHub account, so you get the same setup on any machine.

💡 Tip: VS Code updates automatically. You'll see a notification when a new version is ready. Just restart to apply it.

2

GitHub Copilot

An AI coding assistant that lives inside VS Code.

What is it?

GitHub Copilot is an AI tool made by GitHub (owned by Microsoft). It integrates directly into VS Code and helps you write code by suggesting completions, answering questions, and even building entire features from a description. Think of it as having a very knowledgeable coding partner sitting next to you.

What can it do?

  • Code completion — as you type, it suggests the next lines of code. Press Tab to accept a suggestion.
  • Chat — open the chat panel and ask questions in plain English. "How do I connect to a database?" or "Explain this code to me."
  • Agents — describe a whole feature ("build me a contact form that sends an email") and Copilot will plan the approach, write the code across multiple files, and test it.
  • Inline edits — highlight some code, press Ctrl+I, and describe what you want changed.

How to set it up

  1. Get a GitHub account — sign up at github.com if you don't have one.
  2. Get Copilot access — there's a free tier (Copilot Free) that gives you a generous amount of completions and chat messages per month. Go to github.com/settings/copilot to activate it.
  3. Install the extension — in VS Code, go to Extensions (Ctrl+Shift+X), search "GitHub Copilot", and click Install.
  4. Sign in — VS Code will prompt you to sign in to your GitHub account. Follow the browser flow.
  5. Start using it — open any file and start typing. Copilot suggestions appear as grey text. Press Tab to accept, or keep typing to ignore.

💡 Tip: The Copilot Chat panel is the most useful feature for beginners. Open it from the sidebar or press Ctrl+Shift+I. Ask it anything: "What does this error mean?", "Write a function that...", "How do I install Node.js?"

3

What is MCP?

The protocol that lets AI tools connect to external services.

The simple explanation

MCP stands for Model Context Protocol. It's an open standard created by Anthropic (the company behind Claude AI) that lets AI tools connect to external services and data sources in a standardised way.

Think of it like a USB-C port for AI. Just as USB-C gives you one standard plug that works with chargers, monitors, hard drives, and phones, MCP gives AI tools one standard way to connect to any external service.

How does it work?

MCP Client (e.g. VS Code with Copilot, Claude Desktop)

The AI application you're using. It knows how to talk the MCP protocol.

MCP Server (e.g. Xero MCP Server, a file system server)

A small program that exposes a specific service (like Xero) to AI tools via the MCP protocol.

External Service (e.g. Xero API, Google Calendar, a database)

The actual service the AI is connecting to.

So the flow is: You ask the AIAI talks to MCP ServerMCP Server talks to XeroResults come back to you.

Why does it matter?

  • Without MCP, every AI tool would need its own custom integration with every service. That doesn't scale.
  • With MCP, you build one server for Xero and it works with VS Code, Claude Desktop, Cursor, and any other MCP-compatible tool.
  • It's supported by major tools: VS Code, Claude, ChatGPT, Cursor, and many more.

💡 Key insight: You don't need to understand the protocol itself. You just need to know how to install and configure an MCP server, which is usually just adding a few lines to a config file. The AI handles the rest.

4

Xero MCP Server

Connect your AI tools directly to Xero's accounting data.

What is it?

The Xero MCP Server is an official MCP server built by Xero. It connects AI tools to Xero's accounting API, letting you interact with your Xero data using natural language. Instead of clicking through Xero's interface, you can ask your AI assistant to do it.

What can you do with it?

  • List and search contacts, invoices, accounts, and payments
  • Create invoices and credit notes
  • Pull profit & loss, balance sheet, and trial balance reports
  • View bank transactions and manual journals
  • Access payroll data (employees, leave, timesheets) for NZ and UK
  • View quotes, items, and tax rates

Prerequisites

  1. Node.js v18+ — download from nodejs.org. Pick the LTS version. This is the runtime that the MCP server runs on.
  2. A Xero account — sign up at xero.com/signup (free trial available). We recommend starting with a Demo Company so you're working with sample data, not real finances.
  3. Xero API credentials — you'll need a Client ID and Client Secret from the Xero Developer portal.

Getting your Xero API credentials

  1. Go to developer.xero.com/app/manage and log in
  2. Click "New app"
  3. For the integration type, select "Custom connection" (this is simplest for personal use)
  4. Follow the Custom Connections guide to set up the app and grant it access to your organisation
  5. Note down your Client ID and Client Secret

Adding it to VS Code (Copilot)

VS Code supports MCP servers natively. You configure them in a settings file:

  1. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Search for "MCP: Add Server" or manually edit your .vscode/mcp.json file
  3. Add this configuration:
{
  "servers": {
    "xero": {
      "command": "npx",
      "args": ["-y", "@xeroapi/xero-mcp-server@latest"],
      "env": {
        "XERO_CLIENT_ID": "your_client_id_here",
        "XERO_CLIENT_SECRET": "your_client_secret_here"
      }
    }
  }
}

Replace the yellow values with your actual Xero credentials.

Adding it to Claude Desktop (alternative)

If you use Claude Desktop instead of VS Code, the setup is similar:

  1. Go to Settings → Developer → Edit Config
  2. Add the Xero server to your claude_desktop_config.json:
{
  "mcpServers": {
    "xero": {
      "command": "npx",
      "args": ["-y", "@xeroapi/xero-mcp-server@latest"],
      "env": {
        "XERO_CLIENT_ID": "your_client_id_here",
        "XERO_CLIENT_SECRET": "your_client_secret_here"
      }
    }
  }
}

⚠️ Important: If you use Node Version Manager (nvm), replace "npx" with the full path to your npx executable, e.g. /home/you/.nvm/versions/node/v22.14.0/bin/npx. Otherwise the MCP client may not find Node.

5

Putting It All Together

How these three pieces connect.

📝
VS Code

Your editor. Where you work.

🤖
GitHub Copilot

Your AI assistant. Lives inside VS Code.

📊
Xero MCP Server

The bridge. Connects Copilot to Xero.

Example workflow

Once everything is set up, here's what using it looks like:

  1. Open VS Code and open the Copilot Chat panel
  2. Type: "Show me all unpaid invoices from the last 30 days"
  3. Copilot recognises this needs Xero data, calls the Xero MCP Server
  4. The MCP Server queries Xero's API and returns the invoice data
  5. Copilot presents you with a formatted list of unpaid invoices

More things to try

  • "Create an invoice for ACME Corp for £500 for consulting services"
  • "Show me the profit and loss for this quarter"
  • "List all contacts that have overdue invoices"
  • "What's the balance on my current account?"
  • "Show me all bank transactions from last week"
  • "Create a credit note for invoice INV-0042"

💡 Pro tip: Start with read-only queries (listing, reporting) before trying write operations (creating invoices). Use a Demo Company in Xero to experiment safely without touching real data.

Common Issues

"npx: command not found"

Node.js isn't installed or isn't in your PATH. Download it from nodejs.org and restart VS Code after installing.

Copilot isn't suggesting anything

Check you're signed in to GitHub (look for the Copilot icon in the bottom status bar). If it shows a warning icon, click it to re-authenticate.

Xero MCP Server won't connect

Double-check your Client ID and Client Secret. Make sure you've authorised the Custom Connection to access your Xero organisation. Check the VS Code Output panel (View → Output, then select "MCP" from the dropdown) for error messages.

MCP server not showing in Copilot

Restart VS Code after adding the MCP config. Make sure the .vscode/mcp.json file is in the root of your workspace folder.

Further Reading & Resources