Gocode

v1.0.0Coding Agentsstable

Claude Code rewritten in Go.. High-performance AI agent harness runtime in Go. MCP server, CLI tool orchestration, session management, Kiro integration. Single binary, zero dependencies.

aiai-agentsai-toolsantigravityclaude-code
Share:
34
Stars
0
Downloads
0
Weekly
0/5

What is Gocode?

Gocode is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to claude code rewritten in go.. high-performance ai agent harness runtime in go. mcp server, cli tool orchestration, session management, kiro integration. single binary, zero dependencies.

Claude Code rewritten in Go.. High-performance AI agent harness runtime in Go. MCP server, CLI tool orchestration, session management, Kiro integration. Single binary, zero dependencies.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Claude Code rewritten in Go.. High-performance AI agent harn

Use Cases

High-performance AI agent runtime
CLI tool orchestration
Session management in Go
AlleyBo55

Maintainer

LicenseMIT
Languagego
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx gocode

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Gocode

Gocode is a high-performance AI agent harness written in Go that reimplements the Claude Code experience as a single self-contained binary with zero external dependencies. It supports multiple LLM providers (Anthropic, OpenAI, Gemini, DeepSeek, and more), features LSP-powered code intelligence, multi-agent swarm coordination with up to five concurrent background agents, a cross-session memory system, and Git checkpoint-based undo. As an MCP server (via 'gocode mcp-serve'), it integrates with Claude Desktop, Cursor, VS Code, and Kiro, offering a drop-in coding agent that is faster to start and easier to deploy than Node.js-based alternatives.

Prerequisites

  • At least one LLM provider API key (e.g., ANTHROPIC_API_KEY for Claude, OPENAI_API_KEY for GPT, GEMINI_API_KEY for Gemini)
  • Go 1.21 or later if building from source
  • An MCP-compatible client such as Claude Desktop, Cursor, or VS Code with MCP support
  • Optional: git installed for checkpoint and undo features
1

Install the gocode binary

Choose the installation method that suits your platform. The curl installer is the fastest option for macOS and Linux; Windows users can use the PowerShell script. Alternatively, install via Go toolchain.

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/AlleyBo55/gocode/main/install.sh | bash

# Windows (PowerShell)
irm https://raw.githubusercontent.com/AlleyBo55/gocode/main/install.ps1 | iex

# Via Go toolchain
go install github.com/AlleyBo55/gocode/cmd/gocode@latest
2

Set your LLM provider API key

Export the API key for your chosen provider. Gocode reads these from the environment at startup. You only need one key to get started.

# For Anthropic Claude
export ANTHROPIC_API_KEY=your_anthropic_api_key

# For OpenAI
export OPENAI_API_KEY=your_openai_api_key

# For Google Gemini
export GEMINI_API_KEY=your_gemini_api_key
3

Verify the installation

Run a quick interactive chat to confirm the binary works and your API key is recognized. Use the --model flag to select a specific model.

gocode chat --model sonnet
4

Start gocode as an MCP server

Use the 'mcp-serve' subcommand to expose gocode as a compliant MCP server over stdio, ready for Claude Desktop, Cursor, or any other MCP-compatible client.

gocode mcp-serve
5

Add gocode to your MCP client configuration

Add the following block to your claude_desktop_config.json (or equivalent), setting the appropriate API key for your chosen provider. Restart your MCP client after saving.

{
  "mcpServers": {
    "gocode": {
      "command": "gocode",
      "args": ["mcp-serve"],
      "env": {
        "ANTHROPIC_API_KEY": "your_anthropic_api_key"
      }
    }
  }
}

Gocode Examples

Client configuration

claude_desktop_config.json for connecting to gocode as an MCP server using Anthropic Claude.

{
  "mcpServers": {
    "gocode": {
      "command": "gocode",
      "args": ["mcp-serve"],
      "env": {
        "ANTHROPIC_API_KEY": "your_anthropic_api_key"
      }
    }
  }
}

Prompts to try

Sample prompts covering code intelligence, multi-agent coordination, and session management features.

- "Find all TODO comments in this repository and create a prioritized list."
- "Refactor the database connection module to use connection pooling — use LSP to find all call sites."
- "Start a background agent to run the test suite while I continue working on the feature branch."
- "Undo the last 3 changes I made and restore the git checkpoint from before the refactor."
- "Search for all usages of the deprecated 'fetchUser' function and replace them with 'getUser'."

Troubleshooting Gocode

gocode: command not found after installation

The installer places the binary in ~/bin or /usr/local/bin depending on your system. Ensure that directory is in your PATH. Run 'echo $PATH' and add the directory if missing: export PATH="$HOME/bin:$PATH".

API authentication errors when starting the MCP server

Verify the API key environment variable is correctly set for your provider (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY). When using the MCP client config env block, the value must not have surrounding quotes. Test the key directly with 'ANTHROPIC_API_KEY=your_key gocode chat --model sonnet'.

MCP client shows no tools after connecting to gocode mcp-serve

Confirm gocode is in your system PATH and can be invoked without absolute paths. Try specifying the full binary path in the 'command' field of your MCP config (e.g., /usr/local/bin/gocode). Also ensure you are using a recent version by running 'gocode --version'.

Frequently Asked Questions about Gocode

What is Gocode?

Gocode is a Model Context Protocol (MCP) server that claude code rewritten in go.. high-performance ai agent harness runtime in go. mcp server, cli tool orchestration, session management, kiro integration. single binary, zero dependencies. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Gocode?

Follow the installation instructions on the Gocode GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Gocode?

Gocode works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Gocode free to use?

Yes, Gocode is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "gocode": { "command": "npx", "args": ["-y", "gocode"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Gocode?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides