Connect GitHub to VS Code

On this page

The GitHub API has over 400 documented endpoints. For most agent tasks in an IDE, you need five of them: list repos, list issues, get an issue, list pull requests, create an issue. Here’s how to declare those five and expose them to Copilot.

What you’ll build

A GitHub MCP server that lets VS Code Copilot query your repositories and issues. You’ll declare five capabilities, connect the server, and ask Copilot to pull up your open PRs.

Prerequisites

  • VS Code 1.99+ with the GitHub Copilot extension
  • Node.js 18+ or Python 3.10+
  • A GitHub personal access token with repo scope

Install

npm install -g usepaso

Create a declaration

usepaso init --name "GitHub"

Edit usepaso.yaml:

version: "1.0"

service:
  name: GitHub
  description: Code hosting, issue tracking, and pull request management
  base_url: https://api.github.com
  auth:
    type: bearer

capabilities:
  - name: list_repos
    description: List repositories for the authenticated user
    method: GET
    path: /user/repos
    permission: read
    inputs:
      visibility:
        type: enum
        values: [all, public, private]
        default: all
        description: Filter by repository visibility
        in: query
      per_page:
        type: integer
        description: Results per page (max 100)
        in: query

  - name: list_issues
    description: List open issues for a repository
    method: GET
    path: /repos/{owner}/{repo}/issues
    permission: read
    inputs:
      owner:
        type: string
        required: true
        description: Repository owner or organization
        in: path
      repo:
        type: string
        required: true
        description: Repository name
        in: path
      state:
        type: enum
        values: [open, closed, all]
        default: open
        description: Filter by issue state
        in: query

  - name: get_issue
    description: Get a specific issue by number
    method: GET
    path: /repos/{owner}/{repo}/issues/{issue_number}
    permission: read
    inputs:
      owner:
        type: string
        required: true
        in: path
      repo:
        type: string
        required: true
        in: path
      issue_number:
        type: integer
        required: true
        description: Issue number
        in: path

  - name: list_pull_requests
    description: List pull requests for a repository
    method: GET
    path: /repos/{owner}/{repo}/pulls
    permission: read
    inputs:
      owner:
        type: string
        required: true
        in: path
      repo:
        type: string
        required: true
        in: path
      state:
        type: enum
        values: [open, closed, all]
        default: open
        in: query

  - name: create_issue
    description: Create a new issue in a repository
    method: POST
    path: /repos/{owner}/{repo}/issues
    permission: write
    consent_required: true
    inputs:
      owner:
        type: string
        required: true
        in: path
      repo:
        type: string
        required: true
        in: path
      title:
        type: string
        required: true
        description: Issue title
        in: body
      body:
        type: string
        description: Issue body
        in: body

permissions:
  read:
    - list_repos
    - list_issues
    - get_issue
    - list_pull_requests
  write:
    - create_issue

Validate

usepaso validate
valid (GitHub, 5 capabilities, 0 regrets)

Set your token

export USEPASO_AUTH_TOKEN=ghp_your_github_token

Or add it to a .env file in the same directory:

USEPASO_AUTH_TOKEN=ghp_your_github_token

Test before connecting

usepaso test list_repos --dry-run
--- DRY RUN (no request will be made) ---

GET https://api.github.com/user/repos?visibility=all
Authorization: Bearer ...

Looks right. Run a live test:

usepaso test list_repos

If you get a 200, the declaration and token are correct.

Serve

usepaso serve
usepaso serving "GitHub" (5 capabilities). Agents welcome.
Transport: stdio. Waiting for an MCP client...

Connect to VS Code

usepaso connect vscode
Added "GitHub" in VS Code config.
  Config: .vscode/mcp.json

Reload VS Code to connect.

Reload the VS Code window (Cmd+Shift+PDeveloper: Reload Window).

Try it

Open Copilot Chat in agent mode and ask:

  • “What are my open pull requests on the paso repo?” Copilot calls list_pull_requests and returns the list.
  • “Show me issue #42 in my-org/my-repo.” Copilot calls get_issue and returns the details.
  • “File an issue: the login button is broken on mobile.” Copilot shows a confirmation (because consent_required: true), then calls create_issue.

Adding more capabilities

The GitHub API has endpoints for comments, reviews, commits, releases, and more. Add them to capabilities, run usepaso validate, and restart the server. The VS Code config doesn’t need to change.

# After adding capabilities to usepaso.yaml:
usepaso validate
usepaso serve

No config editing. No reconnecting.

Questions

Does this work with GitHub Enterprise? Yes. Change base_url to your GitHub Enterprise API root, e.g., https://github.yourcompany.com/api/v3. Token scope requirements are the same.

Can I use a fine-grained token instead of a classic PAT? Yes. Fine-grained tokens work as long as they have the repository permissions your capabilities need. list_repos needs Repositories: read. create_issue needs Issues: write.

What if I want read-only access? Remove create_issue from the capabilities list, or add it to permissions.forbidden. Agents won’t see it.

Related: