mcpField
πŸ”„
πŸ”„ MCP + Cursor GitHub Setup

πŸ”„ MCP + Cursor GitHub Setup

Local
github.com/Ankitkushwaha90Developer Tools2Updated 80w ago

About πŸ”„ MCP + Cursor GitHub Setup

This setup guide explains connecting Cursor to an MCP server for GitHub repository operations. It is aimed at developers configuring Cursor and covers server settings, token handling, and example tool usage.

Key features

  1. 01Configure Cursor's MCP connection
  2. 02Set server and token details in mcp.json
  3. 03Manage repositories with GitHub tools
  4. 04Trigger repository actions through prompts
  5. 05Includes terminal command examples

Use cases

  1. 01Create GitHub repositories from Cursor
  2. 02Search GitHub repositories
  3. 03Read or update repository files
  4. 04Trigger repository actions from the command line

MCP support

The guide describes connecting Cursor to a local MCP server and configuring GitHub plugin tools. Once connected, repository actions can be initiated through Cursor prompts or the command line.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

title: Connect Cursor to MCP for GitHub Control

πŸ”„ MCP + Cursor GitHub Setup

Set up full GitHub control via Cursor once your MCP server is running.

πŸ› οΈ Step-by-Step Cursor Setup for MCP

🧭 1. Open Cursor Editor
  • Launch Cursor, the AI-first code editor.
  • Click Settings (bottom-left corner βš™οΈ).
🌐 2. Navigate to MCP Section
  • In Settings, scroll down to the MCP (Model Context Protocol) section.
  • Click "Add Server".
πŸ”§ 3. Fill in MCP Server Details
  • Name: Local MCP Server
  • URL: http://localhost:3333 (or your configured port from server.js)
  • Client: Select ollama or your preferred LLM engine.
  • Auth: Leave blank for local use (behind firewall). Add headers if using token-based auth.

βœ… Cursor is now connected to your MCP server!

βš™οΈ Make Sure Your MCP Server Is Running

Run your server locally from your terminal:

node server.js

Expected output:

βœ… MCP server running at http://localhost:3333

πŸ€– Use Cursor Prompts to Control GitHub

With MCP connected, use the Cursor command palette:

⌘ + K / Ctrl + K β†’ Type:

Create a private GitHub repo named ai-lab
Add README.md to ai-lab repo with initial text
Search repositories about 'android hacking tools'

MCP GitHub plugin (@smithery-ai/github) handles GitHub API calls via your server.

βœ… Available GitHub Tools via MCP

ToolDescription
create_or_update_fileCreate or update files
create_repositoryCreate a new GitHub repository
delete_repositoryDelete a repository (if supported)
get_file_contentsRead contents of files
search_repositoriesDiscover GitHub repositories

These tools can be triggered through Cursor's prompt bar or:

npx @smithery/cli

🧠 Best Practice Tips

  • Keep your mcp.json secure (especially GitHub tokens).
  • Use environment variables for secrets in production.
  • Test server connection with:
curl http://localhost:3333

Logs will show tool calls and API responses for easier debugging.


title: "MCP Server + GitHub Cursor Setup Guide" description: "Step-by-step guide for setting up MCP server with Cursor GitHub integration for repo automation, creation, deletion, and commit control."

πŸš€ MCP Server + GitHub Cursor Integration

This tutorial walks you through setting up MCP with GitHub using Cursor and controlling repositories from the terminal or automation workflows.

πŸ“¦ Prerequisites

  • Node.js & npm installed
  • Cursor CLI downloaded for your OS
  • A GitHub account
  • An MCP-compatible agent setup with @modelcontextprotocol/sdk

πŸ” Step 1: Create a GitHub Personal Access Token

  1. Go to GitHub Developer Settings
  2. Click "Fine-grained tokens" β†’ Generate new token
  3. Set:
    • Name: just_think
    • Expiration: May 18, 2025 (or your preferred)
    • Permissions:
      • Repositories: Full Read/Write
      • User: Full Read/Write
  4. Copy the token now. You will not see it again!
github_pat_11A4PP7FQ07lGRHVynbe5e_... (keep it secret!)

βš™οΈ Step 2: Configure mcp.json

{
  "defaultClient": "ollama",
  "ollama": {
    "baseUrl": "http://localhost:11434",
    "model": "llama2"
  },
  "github": {
    "token": "<your_copied_github_token>"
  },
  "agent": {
    "name": "DevOpsAgent",
    "persona": "An automation assistant for GitHub repo management"
  }
}

Save it as mcp.json in your project folder.


πŸ’» Step 3: Run the MCP Studio Server

// server.js
import { studio } from '@modelcontextprotocol/sdk/server/studio.js';

studio.run({
  config: './mcp.json',
  port: 3333
});

Then run:

node server.js

🧠 Step 4: Connect Cursor to GitHub

npx -y @smithery/cli@latest install @smithery-ai/github --client claude --config mcp.json

This will install the GitHub Cursor adapter and register the token from mcp.json.


πŸ”§ Step 5: Automate Repo Control via Cursor

Use the terminal to create, delete, or manage GitHub repos:

βœ… Create a Repository
npx @smithery/cli ask "Create a new private repo called test-automation"
❌ Delete a Repository
npx @smithery/cli ask "Delete the repo named old-project"
πŸ“₯ Commit Code
npx @smithery/cli ask "Commit all changes to the repo my-app with message 'Init commit'"

πŸ“š Use Cases

  • πŸš€ CI/CD Pipelines – Deploy workflows via GitHub Actions
  • 🧠 LLM Automation – Agents can trigger repo events
  • πŸ›‘ Secure DevOps – Use fine-grained tokens to maintain security
  • 🧰 Full Dev Automation – No manual clicking, fully terminal-driven

πŸ“Ž Resources


If you'd like a complete ready-to-clone repo with these files, just ask and I’ll generate one!

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.