Custom GitHub Issue Management MCP Server - n8n Workflow

Build a powerful, secure GitHub Model Context Protocol (MCP) server using this ready-to-use n8n workflow template. Integrate AI agents with GitHub tasks.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Developers and DevOps teams looking to integrate AI agents with issue tracking.

  • Users seeking secure, granular control over AI access to their GitHub repositories.

  • n8n users who want to build custom AI tools using n8n workflow logic.

Overview

This specialized n8n workflow demonstrates how to construct your own custom GitHub MCP server. Instead of relying on a generic server, this n8n template allows you to define precise access and functionality for your AI agents (such as Claude or other MCP clients). The key value proposition is enhanced security and customization, ensuring the agent only performs specific, guarded operations on designated GitHub repositories. By using n8n to manage the logic, you can easily extend this foundation to include interactions with pull requests, generate reports, or customize the output structure. This approach leverages the power of the n8n node ecosystem to create robust AI-powered solutions.

How it Works

The entire automation is initiated by a specialized n8n trigger, the Github MCP Server node. This n8n trigger waits for commands from a compatible MCP client (like an AI agent). Three dedicated Tool Workflow nodes are defined, making specific GitHub actions callable by the agent: 'Get Latest Issues,' 'Get Issue Comments,' and 'Add Issue Comment.'


  1. Tool Invocation: When an AI agent calls one of these tools, the command executes the 'When Executed by Another Workflow' n8n node, passing parameters like operation, repo, and issueNumber.

  2. Routing: A Switch n8n node named 'Operation' inspects the operation parameter to route the flow to the correct task branch.

  3. Task Execution:

For Get Latest Issues, a GitHub n8n node retrieves the last 10 issues, which are then simplified using a Set n8n node before being aggregated.
For Get Issue Comments, the workflow uses a GitHub n8n node to fetch the issue details, followed by an HTTP Request n8n node to retrieve associated comments, simplifying and aggregating the results.
* For Add Issue Comment, a GitHub n8n node executes the createComment operation using the provided issueNumber and text, confirming successful execution with a final Set n8n node that returns 'ok'.

This structure ensures a clean, modular execution where the n8n workflow securely handles all interactions with the underlying GitHub API.

Installation Guide

To install this robust n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and navigate to your n8n instance. Select 'Workflows' > 'New' > 'Import from JSON' and paste the code.

  2. Set Up GitHub Credentials: This n8n template requires valid GitHub API credentials. You must set up a credential resource that the GitHub n8n node can use to authenticate with the API. Ensure this account has necessary read and write permissions for the target repository (e.g., 'n8n-io/n8n' used in the default configuration).

  3. Configure the MCP Server n8n Trigger: Activate the 'Github MCP Server' n8n trigger. Before moving to production, it is highly recommended (as noted in the Sticky Note) to enable authentication on this n8n trigger for security.

  4. Connect Your Client: Use the endpoint URL generated by the MCP Server n8n trigger to connect your preferred MCP client (such as Claude Desktop) and begin testing queries like, 'Can you get me the latest issues about MCP?'.

Node Details

Github MCP Server (n8n trigger): The starting point for the entire n8n workflow. It acts as an API endpoint, waiting for structured commands from an AI agent via the Model Context Protocol.
Tool Workflow (n8n node): Three separate Tool Workflow nodes ('Get Latest Issues', 'Get Issue Comments', 'Add Issue Comment') are configured. These wrap the complex GitHub actions into simple, descriptive tools that the AI agent can intelligently call. They define the inputs required (e.g., issueNumber, text).
When Executed by Another Workflow (n8n node): This acts as the internal entry point when a Tool Workflow calls back to the same n8n workflow instance, receiving the inputs passed by the agent.
Operation (Switch n8n node): Essential flow control. This n8n node dynamically routes the incoming request based on the operation parameter (getLatestIssues, getIssueComments, addIssueComment) to the correct subsequent GitHub action branch.
GitHub (n8n node): Used across the branches for core operations: 'Get Many Issues' (to find latest issues), 'Get Single Issue' (to start fetching comments), and 'Create Comment' (to respond to issues). The configuration uses expressions to pull repository and issue numbers from the incoming data.
HTTP Request (n8n node): Specifically used in the getIssueComments flow to fetch comments using the dedicated URL provided in the initial issue payload, requiring authenticated access.


  • Set (n8n node): Used extensively (e.g., 'Simplify Issues', 'Simplify Comments') to clean and structure the data returned by the GitHub n8n node, ensuring the final output is concise and relevant for the AI agent.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
Jimleuk
Jimleuk

Freelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at [email protected] LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk

Featured*