Sponsored by Deepsite.site

🔄 MCP + Cursor GitHub Setup

Created By
Ankitkushwaha908 months ago
Content

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!

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"