Back to materials

MCP vs skills

Table of Contents

1. Overview

Cursor agents can be extended in two complementary ways:

CapabilityWhat it isWhat it gives the agent
SkillA markdown playbook (SKILL.md)Workflow, conventions, and step-by-step instructions
MCPA Model Context Protocol serverTyped tools and resources (API calls, live data, actions)

Skills and MCP servers work well together: a skill defines a repeatable workflow, while an MCP server exposes external tools the agent can call.

MCP queries use more tokens than a skill invocation. A skill that wraps a CLI tool is more token-efficient but may lack features the MCP server provides. For example, GitHub's MCP server and the gh CLI (or GitLab's MCP and glab) both manage issues and pull requests.

For more on the technical side of MCP, see the MCP introduction.

This guide creates a skill for reviewing code against static rules, then configures a Git provider MCP server for querying issues, merge requests, and pipelines.

2. Create a skill with /create-skill

What gets created

Running /create-skill scaffolds a skill folder with SKILL.md frontmatter (name, description) and starter instructions.

LocationPathScope
Project.cursor/skills/<skill-name>/SKILL.mdShared with the repo
Personal~/.cursor/skills/<skill-name>/SKILL.mdAvailable in all projects

Create a code review skill

This example creates a skill for reviewing code style based on static rules (TalTech clean code rules in Estonian).

  1. Open Cursor CLI (or Agent chat) in your project root.

  2. Run:

    /create-skill
    
  3. When prompted, describe the skill. Example prompt:

    Create a project skill for general code review:
    - flag DRY violations and duplicated logic
    - evaluate naming, function length, and readability
    - check separation of concerns and single responsibility
    - follow clean code standards from:
      https://javadoc.pages.taltech.ee/code_style/clean-code.html
    
  4. Confirm the scaffolded path, for example:

    .cursor/skills/code-review-basics/SKILL.md
    
  5. Review and refine SKILL.md so it is actionable. Minimal example:

    ---
    name: code-review-basics
    description: >-
      Performs general code review with focus on DRY and clean code principles.
      Use when reviewing pull requests, refactors, and new feature implementations.
    ---
    
    # Code Review Basics
    
    ## Review focus
    
    1. Find duplicated logic and suggest shared abstractions (DRY)
    2. Flag unclear naming and suggest clearer alternatives
    3. Point out overly long functions and mixed responsibilities
    4. Check that code is easy to read and reason about
    
    ## Standards
    
    - Use TalTech clean code guidance as baseline:
      https://javadoc.pages.taltech.ee/code_style/clean-code.html
    - Prefer concrete findings with file-level references
    - Prioritize correctness and maintainability over style-only notes
    
  6. Try it out:

    /code-review-basics
    Review the current changes and list DRY and clean-code issues first.
    

Docs: Skills

3. Configure a Git provider MCP in your project

This section combines general MCP configuration with concrete setups for GitLab (GitLab.com or self-hosted) and GitHub.

Configure MCPs per project. Each project may need different servers, and unused servers add token overhead.

Create the project config file

Create .cursor/mcp.json in your project root:

your-project/
├── .cursor/
│   ├── mcp.json
│   └── skills/
│       └── code-review-basics/
│           └── SKILL.md
└── ...

Config locations

ScopeFile
Project.cursor/mcp.json
Global~/.cursor/mcp.json

Project config overrides global config for the same server name.

Keep secrets out of git

Do not commit tokens in mcp.json.

  • GitLab (official): uses OAuth in the browser; no PAT in .env required.
  • GitLab (community): store a PAT in .env and load it with envFile.
  • GitHub: store a PAT in your shell environment and reference it with ${env:...} in headers (remote servers do not support envFile).

Add .env to .gitignore when you use PAT-based setups loaded from files. Also add it to .cursorignore so the agent cannot read your tokens (see Agent security guide).

Set up a provider:

GitLab MCP (GitLab.com or self-hosted)

There are two options for GitLab: official and community. Official is recommended for GitLab Premium/Ultimate users.

GitLab ships a built-in MCP endpoint at:

https://<your-gitlab-host>/api/v4/mcp

Cursor connects over HTTP and authenticates with OAuth (no PAT in mcp.json).

Cursor also has a built-in GitLab integration (repository connection and Bugbot), which is separate from this MCP setup. This guide shows the manual MCP configuration.

Prerequisites (from GitLab docs):

  • GitLab Premium/Ultimate (GitLab.com, Self-Managed, or Dedicated)
  • GitLab Duo enabled (for self-managed)
  • Beta/experimental features enabled where required by your admin

Add this to .cursor/mcp.json:

{
  "mcpServers": {
    "GitLab": {
      "type": "http",
      "url": "https://gitlab.example.com/api/v4/mcp"
    }
  }
}

For GitLab.com, use https://gitlab.com/api/v4/mcp.

Verify official GitLab MCP is loaded

  1. Open Settings > Tools & MCP.

  2. Confirm GitLab appears and is connected.

  3. Save mcp.json and approve OAuth in the browser when prompted (restart Cursor if the browser window does not open).

  4. In Agent chat, ask:

    Using GitLab MCP tools, list open merge requests in our main project and summarize pipeline status.
    

Docs: GitLab MCP server, MCP

Community MCP server (PAT-based alternative)

If your instance does not expose the official endpoint (GitLab Community Edition), use zereight/gitlab-mcp (@zereight/mcp-gitlab on npm).

GitLab .env example:

GITLAB_PERSONAL_ACCESS_TOKEN=glpat-...
GITLAB_API_URL=https://gitlab.example.com/api/v4

For GitLab.com, use GITLAB_API_URL=https://gitlab.com/api/v4.

Create the token at https://<your-host>/-/user_settings/personal_access_tokens with at least api scope (add read_repository if your workflow needs it).

Add this to .cursor/mcp.json:

{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@zereight/mcp-gitlab"],
      "envFile": "${workspaceFolder}/.env"
    }
  }
}

What the fields mean:

FieldPurpose
commandExecutable to start the MCP server (npx, node, python, docker, etc.)
argsArguments passed to the command
envInline environment variables (alternative to envFile)
envFileLoad secrets from a file (recommended for tokens)

Verify community GitLab MCP is loaded

  1. Open Settings > Tools & MCP.

  2. Confirm gitlab appears and is connected.

  3. In Agent chat, ask:

    Using GitLab MCP tools, list open merge requests in our main project and summarize pipeline status.
    

GitHub MCP

Prerequisites

Set the token in your environment (do not commit it in mcp.json):

export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...

Add this server to .cursor/mcp.json:

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${env:GITHUB_PERSONAL_ACCESS_TOKEN}"
      }
    }
  }
}

What the fields mean:

FieldPurpose
urlRemote MCP endpoint (HTTP / Streamable HTTP)
headersAuth and other request headers (use ${env:...} for secrets)

Verify GitHub MCP is loaded

  1. Restart Cursor after saving mcp.json.

  2. Open Settings > Tools & MCP.

  3. Confirm github appears and is connected (healthy/green state).

  4. In Agent chat, ask:

    Using the GitHub MCP tools, list open pull requests for this repository and summarize their CI status.
    

Docs: Install GitHub MCP in Cursor

4. Workflow tips

Combine skills and MCP servers for repeatable project workflows:

WorkflowSkill responsibilityMCP responsibility
Feature branchNaming, MR template, review rulesCreate/list MRs, fetch diffs, comment
Build validationDefine required jobs per platformRead pipeline status and failed jobs
Release candidateChangelog + approval checklistList tags/releases, verify green pipelines
HotfixFast-track process and ownersCreate hotfix branch/MR, monitor CI

For common operations (listing PRs, checking CI) the agent can use gh or glab directly in the shell without MCP setup. Use skills for multi-step workflows: define the steps once and share them with the team instead of re-prompting each time.

5. Troubleshooting

ProblemWhat to check
MCP server not listed.cursor/mcp.json path, JSON validity, restart Tools & MCP
Auth failuresToken value, scopes, expired token, wrong host URL
GitLab /api/v4/mcp returns 404Official MCP may be disabled on your tier/instance; use community stdio option or ask your GitLab admin
Self-hosted GitLab TLS errorsInstance URL, cert trust settings, server-specific TLS env vars
GitHub MCP fails to connectCursor v0.48.0+, GITHUB_PERSONAL_ACCESS_TOKEN exported in shell, PAT scopes valid
GitHub Streamable HTTP errorsUpdate Cursor, verify URL is https://api.githubcopilot.com/mcp/, check proxy/firewall
Skill not in / menuSkill path is .cursor/skills/<name>/SKILL.md; invoke explicitly with /<name>
Agent ignores skillMention skill directly: Follow /code-review-basics ...
npx fails on WindowsUse Cursor docs pattern: command: "cmd" with args: ["/c", "npx", ...]

6. Reference

Documentation

Example MCP servers