Skip to content

Documentation

MCP Setup

Configure Claude Code, Cursor, or any MCP-compatible agent.

Zero-install setup (recommended)

For Claude Code, add the gs MCP server with a single command:

claude mcp add gs -- npx @gitstack/cli mcp

This uses npx to download and run gs on demand — no global install required.

Manual setup

If gs is already installed globally, add it to your agent's MCP configuration. For Claude Code, edit ~/.claude/settings.json:

{
  "mcpServers": {
    "git-stack": {
      "command": "gs",
      "args": ["mcp"]
    }
  }
}

For other MCP-compatible agents (Cursor, VS Code Copilot, etc.), consult their documentation for where to configure MCP servers. The command is the same: gs mcp.

How the server runs

gs mcp starts a Model Context Protocol server over stdio. The AI agent launches it as a subprocess:

  1. The agent starts gs mcp as a child process
  2. Communication happens over stdin/stdout using JSON-RPC 2.0
  3. The server exposes tools that the agent discovers via tools/list
  4. The agent calls tools by name with structured arguments
  5. The server returns structured JSON results

There is no HTTP, no daemon, no port. The server lives for the duration of the agent session and exits when stdin closes. All logging goes to stderr to keep the protocol clean.