MCP vs skills
Table of Contents
- 1. Overview
- 2. Create a skill with
/create-skill - 3. Configure a Git provider MCP in your project
- 4. Workflow tips
- 5. Troubleshooting
- 6. Reference
1. Overview
Cursor agents can be extended in two complementary ways:
| Capability | What it is | What it gives the agent |
|---|---|---|
| Skill | A markdown playbook (SKILL.md) | Workflow, conventions, and step-by-step instructions |
| MCP | A Model Context Protocol server | Typed 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.
| Location | Path | Scope |
|---|---|---|
| Project | .cursor/skills/<skill-name>/SKILL.md | Shared with the repo |
| Personal | ~/.cursor/skills/<skill-name>/SKILL.md | Available 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).
-
Open Cursor CLI (or Agent chat) in your project root.
-
Run:
/create-skill -
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 -
Confirm the scaffolded path, for example:
.cursor/skills/code-review-basics/SKILL.md -
Review and refine
SKILL.mdso 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 -
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
| Scope | File |
|---|---|
| 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
.envrequired. - GitLab (community): store a PAT in
.envand load it withenvFile. - GitHub: store a PAT in your shell environment and reference it with
${env:...}inheaders(remote servers do not supportenvFile).
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.
- Official GitLab MCP (requires GitLab Premium/Ultimate)
- Community stdio MCP (for GitLab Community Edition and self-hosted)
Official GitLab MCP (recommended)
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
-
Open Settings > Tools & MCP.
-
Confirm
GitLabappears and is connected. -
Save
mcp.jsonand approve OAuth in the browser when prompted (restart Cursor if the browser window does not open). -
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:
| Field | Purpose |
|---|---|
command | Executable to start the MCP server (npx, node, python, docker, etc.) |
args | Arguments passed to the command |
env | Inline environment variables (alternative to envFile) |
envFile | Load secrets from a file (recommended for tokens) |
Verify community GitLab MCP is loaded
-
Open Settings > Tools & MCP.
-
Confirm
gitlabappears and is connected. -
In Agent chat, ask:
Using GitLab MCP tools, list open merge requests in our main project and summarize pipeline status.
GitHub MCP
Prerequisites
- Cursor v0.48.0+ (Streamable HTTP support)
- GitHub Personal Access Token with minimum scopes needed (
repo, andread:orgif required)
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:
| Field | Purpose |
|---|---|
url | Remote MCP endpoint (HTTP / Streamable HTTP) |
headers | Auth and other request headers (use ${env:...} for secrets) |
Verify GitHub MCP is loaded
-
Restart Cursor after saving
mcp.json. -
Open Settings > Tools & MCP.
-
Confirm
githubappears and is connected (healthy/green state). -
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:
| Workflow | Skill responsibility | MCP responsibility |
|---|---|---|
| Feature branch | Naming, MR template, review rules | Create/list MRs, fetch diffs, comment |
| Build validation | Define required jobs per platform | Read pipeline status and failed jobs |
| Release candidate | Changelog + approval checklist | List tags/releases, verify green pipelines |
| Hotfix | Fast-track process and owners | Create 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
| Problem | What to check |
|---|---|
| MCP server not listed | .cursor/mcp.json path, JSON validity, restart Tools & MCP |
| Auth failures | Token value, scopes, expired token, wrong host URL |
GitLab /api/v4/mcp returns 404 | Official MCP may be disabled on your tier/instance; use community stdio option or ask your GitLab admin |
| Self-hosted GitLab TLS errors | Instance URL, cert trust settings, server-specific TLS env vars |
| GitHub MCP fails to connect | Cursor v0.48.0+, GITHUB_PERSONAL_ACCESS_TOKEN exported in shell, PAT scopes valid |
| GitHub Streamable HTTP errors | Update Cursor, verify URL is https://api.githubcopilot.com/mcp/, check proxy/firewall |
Skill not in / menu | Skill path is .cursor/skills/<name>/SKILL.md; invoke explicitly with /<name> |
| Agent ignores skill | Mention skill directly: Follow /code-review-basics ... |
npx fails on Windows | Use Cursor docs pattern: command: "cmd" with args: ["/c", "npx", ...] |