Gocode
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.
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
Maintainer
Works with
Installation
Manual Installation
npx gocodeConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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@latestSet 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_keyVerify 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 sonnetStart 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-serveAdd 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.
Gocode Alternatives — Similar Coding Agents Servers
Looking for alternatives to Gocode? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up Gocode in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.