MCP Go Server is a Model Context Protocol (MCP) server implementation designed to provide AI assistants with comprehensive tools for executing, optimizing, and managing Go projects. The project acts as a bridge between AI assistants (like Claude) and the Go runtime, enabling AI to interact with and control Go-based development workflows.
- Quick Start
- Features
- Quick Reference
- Prerequisites
- Installation Methods
- Platform-Specific Guides (36 platforms - click to expand)
- Configuration
- Troubleshooting (click to expand)
- FAQ
- Available Tools (click to expand for detailed docs)
- Available Resources
- Available Prompts
- Usage Examples (click to expand)
- Resources Usage
- Advanced Patterns (click to expand)
- Security Considerations
- License
- Contributing (see CONTRIBUTING.md for development guide)
- Changelog
Choose your platform to get started quickly:
- Claude Desktop - Most popular desktop app
- Cursor - AI-powered code editor
- VS Code - Popular code editor with MCP support
- Docker - Container-based installation
- Pre-built Binaries - Direct binary download
- Go Install - Install via Go toolchain (recommended)
- From Source - Build from GitHub repository
- Pre-built Binaries - Download ready-made binaries
- Docker - Use containerized version
- Go 1.24 or higher - Check with
go version - Git - For cloning the repository (if building from source)
| Platform | macOS | Windows | Linux | Difficulty |
|---|---|---|---|---|
| Claude Desktop | ✅ | ✅ | ✅ | ⭐ Easy |
| Cursor | ✅ | ✅ | ✅ | ⭐ Easy |
| VS Code | ✅ | ✅ | ✅ | ⭐ Easy |
| Docker | ✅ | ✅ | ✅ | ⭐⭐ Medium |
| JetBrains IDEs | ✅ | ✅ | ✅ | ⭐⭐ Medium |
| Windsurf | ✅ | ✅ | ✅ | ⭐ Easy |
| Zed | ✅ | ✅ | ✅ | ⭐ Easy |
| Method | Speed | Requires Go | Requires Docker | Best For |
|---|---|---|---|---|
| Go Install | ⚡ Fast | ✅ Yes | ❌ No | Most users |
| Pre-built Binaries | ⚡ Fast | ❌ No | ❌ No | No Go installed |
| From Source | 🐌 Slower | ✅ Yes | ❌ No | Development |
| Docker | ⚡ Fast | ❌ No | ✅ Yes | Containers |
| Platform | macOS | Windows | Linux |
|---|---|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json |
%APPDATA%\Claude\claude_desktop_config.json |
~/.config/Claude/claude_desktop_config.json |
| VS Code | ~/.vscode/settings.json or workspace .vscode/settings.json |
%APPDATA%\Code\User\settings.json |
~/.config/Code/User/settings.json |
| Cursor | ~/.cursor/settings.json |
%APPDATA%\Cursor\User\settings.json |
~/.config/Cursor/User/settings.json |
| Issue | Quick Fix |
|---|---|
| Command not found | Add to PATH: export PATH=$PATH:$HOME/go/bin |
| Permission denied | chmod +x /path/to/mcp-go |
| Config not working | Validate JSON, check path, restart client |
| Tools don't appear | Restart client, verify config, check logs |
| LSP not available | Install gopls: go install golang.org/x/tools/gopls@latest |
Code Execution (1):
go_run- Execute Go files directly
Go Operations (7):
go_build- Build Go packagesgo_test- Run tests with coveragego_fmt- Format Go codego_mod- Manage Go modulesgo_doc- Generate documentationgo_lint- Lint Go codego_cross_compile- Cross-compile for different platforms
Optimization (6):
go_profile- Generate performance profilesgo_trace- Generate execution tracesgo_benchmark- Run benchmarksgo_race_detect- Detect race conditionsgo_memory_profile- Generate memory profilesgo_optimize_suggest- Get optimization suggestions
Server Management (5):
go_server_start- Start background serversgo_server_stop- Stop serversgo_server_list- List running serversgo_server_logs- Get server logsgo_server_status- Get server status
Package Documentation (3):
go_pkg_docs- Fetch package docs from go.devgo_pkg_search- Search for packagesgo_pkg_examples- Extract examples
LSP Tools (5, optional - requires ENABLE_LSP=true):
lsp_start_session- Start LSP sessionlsp_shutdown_session- Shutdown LSP sessionlsp_request- Send LSP requestlsp_notify- Send LSP notificationlsp_subscribe_diagnostics- Subscribe to diagnostics
go://modules- Go modules and dependenciesgo://build-tags- Build tags and constraintsgo://tests- Test files and benchmarksgo://workspace- Workspace structurego://pkg-docs/{path}- Package documentationgo://tools- List all available toolsgo://prompts- List all available promptsgo://resources- List all available resources
setup-go-project- Project setup guidewrite-go-tests- Test writing templateoptimize-go-performance- Performance optimization guidedebug-go-issue- Debugging guideadd-go-dependency- Dependency management guidego-code-review- Code review checklistgo-server-deployment- Deployment guide
- 22 Comprehensive Tools: Code execution, Go operations, optimization, server management, package documentation, and optional LSP support
- 8 Discovery Resources: Access Go modules, build tags, tests, workspace structure, and package documentation
- 7 Guided Prompts: Step-by-step guides for project setup, testing, optimization, debugging, dependencies, code review, and deployment
- Code Execution: Execute Go files directly with
go run - Go Operations: Build, test, format, and manage Go modules
- Optimization Tools: Performance profiling, benchmarking, and race detection
- Server Management: Start, stop, and monitor long-running Go servers
- Package Documentation: Fetch package documentation from go.dev (pkg.go.dev)
- Project Discovery: Discover Go modules, build tags, test files, and workspace structure
- LSP Support: Optional Language Server Protocol integration (requires
ENABLE_LSP=true) - Cross-Platform: Support for Linux, macOS, and Windows
- Cross-Compilation: Build for different platforms and architectures
Required:
- Go 1.24 or higher - Check with
go version - Git - For cloning the repository (if building from source)
✅ Verify Prerequisites:
go version # Should show go1.24 or higher
git --version # Should show git versionChoose the installation method that works best for you:
| Method | Best For | Speed | Difficulty |
|---|---|---|---|
| Go Install | Most users | ⚡ Fast | ⭐ Easy |
| Pre-built Binaries | No Go needed | ⚡ Fast | ⭐ Easy |
| From Source | Development | 🐌 Slower | ⭐⭐ Medium |
| Docker | Containers | ⚡ Fast | ⭐⭐ Medium |
✅ Recommended for most users
Steps:
- Run the install command:
go install github.com/inja-online/golang-mcp/cmd/mcp-go@latest- Verify installation:
mcp-go --version✅ Success: You should see the version number (e.g., mcp-go v0.0.1)
💡 Tip: The binary will be installed to $GOPATH/bin or $HOME/go/bin. Make sure this is in your PATH.
- If
mcp-gocommand not found, add$HOME/go/binto your PATH - On macOS/Linux:
export PATH=$PATH:$HOME/go/bin - On Windows: Add
%USERPROFILE%\go\binto your PATH
🔧 Best for development or custom builds
Steps:
- Clone the repository:
git clone https://github.com/inja-online/golang-mcp.git
cd golang-mcp- Build the project:
make build- Verify installation:
./bin/mcp-go --version✅ Success: The binary will be in the bin/ directory
💡 Tip: You can also use go build -o mcp-go ./cmd/mcp-go if you don't have make
✅ Fastest method - no Go installation needed
Steps:
-
Download from releases page
-
For Linux/macOS:
curl -L https://github.com/inja-online/golang-mcp/releases/latest/download/golang-mcp_Linux_x86_64.tar.gz | tar xz
sudo mv mcp-go /usr/local/bin/- For Windows:
- Download the
.zipfile for Windows - Extract and move
mcp-go.exeto a directory in your PATH (e.g.,C:\Program Files\mcp-go\)
- Verify installation:
mcp-go --version✅ Success: You should see the version number
💡 Tip: Choose the binary that matches your OS and architecture (Linux/macOS/Windows, x86_64/arm64)
🔧 Best for containerized environments
Steps:
- Pull the image:
docker pull ghcr.io/inja-online/golang-mcp:latest- Verify:
docker images | grep golang-mcp✅ Success: You should see the image listed
Steps:
- Clone and build:
git clone https://github.com/inja-online/golang-mcp.git
cd golang-mcp
docker build -t mcp-go:latest .- Verify:
docker images | grep mcp-go✅ Success: You should see the image listed
Basic usage:
docker run -it --rm \
-v $(pwd):/workspace \
-w /workspace \
mcp-go:latestUsing docker-compose:
docker-compose upThe project includes a docker-compose.yml for local development:
Commands:
docker-compose up # Start the server
docker-compose up --build # Build and start
docker-compose up -d # Run in detached mode
docker-compose logs -f # View logs
docker-compose down # Stop the server✅ Success: Server should start without errors
The Docker image includes:
- Alpine Linux base for minimal size
- Go runtime environment
- Pre-configured working directory
- Environment variable support
🔧 Configure MCP Go Server using environment variables or config file settings.
The server can be configured using environment variables:
export DISABLE_NOTIFICATIONS=true # Disable permission prompts
export DEBUG_MCP=true # Enable debug logging
export ENABLE_LSP=true # Enable LSP tools (optional)
export GOROOT=/path/to/go # Custom GOROOT
export GOPATH=/path/to/gopath # Custom GOPATH
export GOOS=linux # Target OS for cross-compilation
export GOARCH=amd64 # Target architecture
export GOPROXY=https://proxy.golang.org # Go proxy URL| Variable | Type | Default | Description |
|---|---|---|---|
| DISABLE_NOTIFICATIONS | boolean | false |
Set to true to disable permission prompts for command execution |
| DEBUG_MCP | boolean | false |
Set to true to enable debug logging (useful for troubleshooting) |
| ENABLE_LSP | boolean | false |
Set to true to enable LSP tools. Requires gopls in PATH |
| GOROOT | string | auto-detected | Custom Go root directory |
| GOPATH | string | default | Custom Go workspace path |
| GOOS | string | current OS | Target OS for cross-compilation |
| GOARCH | string | current arch | Target architecture for cross-compilation |
| GOPROXY | string | https://proxy.golang.org |
Go module proxy URL |
What this means:
- DISABLE_NOTIFICATIONS: Prevents permission prompts (useful for automation)
- DEBUG_MCP: Shows detailed logs (helpful when troubleshooting)
- ENABLE_LSP: Enables Language Server Protocol tools (requires
goplsinstalled) - GOROOT/GOPATH: Override Go installation paths (usually auto-detected)
- GOOS/GOARCH: Set target platform for cross-compilation
- GOPROXY: Change where Go fetches modules from
💡 Development with LSP support:
export DEBUG_MCP=true
export ENABLE_LSP=true
export DISABLE_NOTIFICATIONS=true✅ Production build configuration:
export DISABLE_NOTIFICATIONS=true
export GOOS=linux
export GOARCH=amd64
export GOPROXY=https://proxy.golang.org🔧 Custom Go installation:
export GOROOT=/usr/local/go
export GOPATH=$HOME/goenv section for them to take effect.
Configure MCP Go Server for your platform. Each guide includes step-by-step instructions, config file locations, and verification steps.
| Platform | Config Location | Difficulty |
|---|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)%APPDATA%\Claude\claude_desktop_config.json (Windows) |
⭐ Easy |
| Cursor | Settings → MCP Servers | ⭐ Easy |
| VS Code | .vscode/settings.json or User Settings |
⭐ Easy |
| Docker | docker-compose.yml or command line |
⭐⭐ Medium |
1. Claude Desktop - ⭐ Easy - Most popular desktop app
Prerequisites:
- Claude Desktop installed
mcp-gobinary installed (see Installation Methods)
Steps:
-
Find your config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
Open or create the config file
-
Add the MCP server configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}
}-
Update the command path:
- Replace
/usr/local/bin/mcp-gowith your actualmcp-gopath - Find it with:
which mcp-go(macOS/Linux) orwhere mcp-go(Windows)
- Replace
-
Restart Claude Desktop
✅ Verify:
- Open Claude Desktop
- Check that MCP tools are available
- Try asking Claude to run a Go command
- If tools don't appear, check the config file JSON is valid
- Verify the binary path is correct
- Check Claude Desktop logs for errors
2. Cursor - ⭐ Easy - AI-powered code editor
Prerequisites:
- Cursor installed
mcp-gobinary installed
Steps:
-
Open Cursor Settings:
- Press
Cmd+,(macOS) orCtrl+,(Windows/Linux) - Or: Cursor → Settings → Settings
- Press
-
Navigate to MCP Servers:
- Search for "MCP" in settings
- Or go to: Settings → Features → MCP Servers
-
Add server configuration:
- Click "Add Server" or edit settings JSON
- Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}
}-
Update the command path to match your installation
-
Reload Cursor (restart or reload window)
✅ Verify:
- Open a Go file
- Check that MCP tools are available in the command palette
- Try using Go-related AI features
3. VS Code - ⭐ Easy - Popular code editor with MCP support
Prerequisites:
- VS Code with MCP extension installed
mcp-gobinary installed
Steps:
-
Choose configuration location:
- Workspace:
.vscode/settings.json(project-specific) - User: User Settings JSON (global)
- Workspace:
-
Open settings JSON:
- Press
Cmd+Shift+P(macOS) orCtrl+Shift+P(Windows/Linux) - Type "Preferences: Open Settings (JSON)"
- Or edit
.vscode/settings.jsonin your workspace
- Press
-
Add MCP server configuration:
{
"mcp.servers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}
}-
Update the command path
-
Reload VS Code window
✅ Verify:
- Check Output panel for MCP server messages
- Verify Go environment:
go versionin integrated terminal - Test tools: Try calling
go_fmtorgo_test
💡 Tip: For workspace settings, create .vscode/settings.json in your project root
4. Cline (VS Code Extension) - ⭐ Easy - VS Code extension for AI coding
Prerequisites:
- VS Code with Cline extension installed
mcp-gobinary installed
Steps:
-
Install Cline extension from VS Code marketplace
-
Open Cline settings:
- Go to: Settings → Extensions → Cline
- Or edit settings JSON
-
Add MCP server:
{
"cline.mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update command path and reload
✅ Verify: Cline should recognize MCP Go tools
5. Windsurf - ⭐ Easy - AI-powered IDE
Prerequisites:
- Windsurf installed
mcp-gobinary installed
Steps:
-
Open Windsurf Settings:
- Go to Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}
}- Update path and restart Windsurf
✅ Verify: MCP tools available in Windsurf
6. Zed - ⭐ Easy - Modern code editor
Prerequisites:
- Zed installed
mcp-gobinary installed
Steps:
-
Open Zed Settings:
Cmd+,(macOS) orCtrl+,(Windows/Linux)
-
Navigate to MCP configuration:
- Settings → Features → MCP
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart Zed
✅ Verify: MCP integration working
7. JetBrains AI Assistant - ⭐⭐ Medium - Works with all JetBrains IDEs
Prerequisites:
- JetBrains IDE with AI Assistant enabled
mcp-gobinary installed
Steps:
-
Open IDE Settings:
- Go to: Settings/Preferences → Tools → AI Assistant → MCP Servers
-
Add MCP server:
- Click "Add" or edit configuration
- Add:
{
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}- Update path and restart IDE
✅ Verify: AI Assistant can use Go tools
💡 Tip: Works with IntelliJ IDEA, GoLand, WebStorm, PyCharm, etc.
8. Perplexity Desktop - ⭐ Easy - Desktop AI assistant
Prerequisites:
- Perplexity Desktop installed
mcp-gobinary installed
Steps:
-
Open Perplexity Settings:
- Settings → Integrations → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Perplexity can access Go tools
9. Amazon Q Developer CLI - ⭐ Easy - AWS AI coding assistant CLI
Prerequisites:
- Amazon Q Developer CLI installed
mcp-gobinary installed
Steps:
-
Create or edit config file:
- Location:
~/.aws-q/config.jsonor%USERPROFILE%\.aws-q\config.json
- Location:
-
Add MCP server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Run aws-q commands with Go support
10. Smithery - ⭐ Easy - MCP server management tool
Prerequisites:
- Smithery installed
mcp-gobinary installed
Steps:
-
Open Smithery configuration:
- Edit
~/.smithery/config.jsonor use Smithery UI
- Edit
-
Add server:
{
"servers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart Smithery
✅ Verify: Server appears in Smithery
11. Claude Code CLI - ⭐ Easy - Command-line Claude interface
Prerequisites:
- Claude Code CLI installed
mcp-gobinary installed
Steps:
-
Edit config file:
- Location:
~/.claude-code/config.json
- Location:
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: CLI can use Go tools
12. Amp - ⭐ Easy - AI coding assistant
Prerequisites:
- Amp installed
mcp-gobinary installed
Steps:
-
Open Amp Settings:
- Settings → MCP Servers
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Amp integration working
13. Warp Terminal - ⭐ Easy - Modern terminal with AI
Prerequisites:
- Warp Terminal installed
mcp-gobinary installed
Steps:
-
Open Warp Settings:
Cmd+,(macOS) orCtrl+,(Windows/Linux)
-
Navigate to AI → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart Warp
✅ Verify: AI features in Warp can use Go tools
14. Copilot Coding Agent - ⭐ Easy - GitHub Copilot agent
Prerequisites:
- Copilot Coding Agent installed
mcp-gobinary installed
Steps:
-
Edit config:
- Location:
~/.copilot/config.json
- Location:
-
Add MCP server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Copilot agent can use Go tools
15. Copilot CLI - ⭐ Easy - GitHub Copilot command line
Prerequisites:
- GitHub Copilot CLI installed
mcp-gobinary installed
Steps:
-
Configure Copilot CLI:
- Edit
~/.github/copilot/config.json
- Edit
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: CLI commands work with Go
16. LM Studio - ⭐ Easy - Local LLM interface
Prerequisites:
- LM Studio installed
mcp-gobinary installed
Steps:
-
Open LM Studio Settings:
- Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: LM Studio can use Go tools
17. Visual Studio 2022 - ⭐⭐ Medium - Microsoft IDE
Prerequisites:
- Visual Studio 2022 with MCP extension
mcp-gobinary installed
Steps:
-
Install MCP extension for Visual Studio 2022
-
Open Tools → Options → MCP Servers
-
Add server:
- Name:
mcp-go - Command: Path to
mcp-go.exe - Args: (empty)
- Name:
-
Save and restart Visual Studio
✅ Verify: MCP tools available in Visual Studio
18. Roo Code - ⭐ Easy - AI coding assistant
Prerequisites:
- Roo Code installed
mcp-gobinary installed
Steps:
-
Open Roo Code Settings:
- Settings → MCP Configuration
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Roo Code integration working
19. Gemini CLI - ⭐ Easy - Google Gemini command line
Prerequisites:
- Gemini CLI installed
mcp-gobinary installed
Steps:
-
Edit config:
- Location:
~/.gemini/config.json
- Location:
-
Add MCP server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Gemini CLI can use Go tools
20. Qwen Coder - ⭐ Easy - AI coding assistant
Prerequisites:
- Qwen Coder installed
mcp-gobinary installed
Steps:
-
Open Settings:
- Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Qwen Coder integration working
21. Opencode - ⭐ Easy - Open-source AI coding tool
Prerequisites:
- Opencode installed
mcp-gobinary installed
Steps:
-
Edit config:
- Location:
~/.opencode/config.json
- Location:
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Opencode can use Go tools
22. OpenAI Codex - ⭐ Easy - OpenAI coding assistant
Prerequisites:
- OpenAI Codex access
mcp-gobinary installed
Steps:
-
Configure Codex:
- Edit
~/.openai/codex/config.json
- Edit
-
Add MCP server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Codex integration working
23. Kiro - ⭐ Easy - AI coding assistant
Prerequisites:
- Kiro installed
mcp-gobinary installed
Steps:
-
Open Kiro Settings:
- Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Kiro can use Go tools
24. Trae - ⭐ Easy - AI development tool
Prerequisites:
- Trae installed
mcp-gobinary installed
Steps:
-
Edit config:
- Location:
~/.trae/config.json
- Location:
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Trae integration working
25. Bun Runtime - ⭐ Easy - JavaScript runtime with MCP support
Prerequisites:
- Bun installed
mcp-gobinary installed
Steps:
-
Create MCP config:
- Location:
~/.bun/mcp/config.json
- Location:
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Bun can use MCP Go server
26. Deno Runtime - ⭐ Easy - JavaScript/TypeScript runtime
Prerequisites:
- Deno installed
mcp-gobinary installed
Steps:
-
Configure Deno MCP:
- Edit
~/.deno/mcp/config.json
- Edit
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Deno MCP integration working
27. Docker - ⭐⭐ Medium - Container-based installation
Prerequisites:
- Docker installed
- Docker Compose (optional, for easier management)
Steps:
- Pull the image:
docker pull ghcr.io/inja-online/golang-mcp:latest- Run the container:
docker run -it --rm \
-v $(pwd):/workspace \
-w /workspace \
ghcr.io/inja-online/golang-mcp:latest- Or use docker-compose:
- Create
docker-compose.yml:
- Create
version: '3.8'
services:
mcp-go:
image: ghcr.io/inja-online/golang-mcp:latest
volumes:
- .:/workspace
working_dir: /workspace
stdin_open: true
tty: true- Start with docker-compose:
docker-compose up✅ Verify:
docker run --rm ghcr.io/inja-online/golang-mcp:latest mcp-go --version💡 Tip: Use volumes to mount your Go projects into the container
28. Desktop Extension (.mcpb) - ⭐ Easy - MCP bundle format for easy installation
Prerequisites:
- MCP-compatible client that supports
.mcpbfiles
Steps:
-
Download the .mcpb file from releases
-
Install the bundle:
- Double-click the
.mcpbfile, or - Use your MCP client's "Install Bundle" feature
- Double-click the
-
Follow client-specific installation prompts
✅ Verify: Bundle appears in your MCP client's server list
💡 Tip: .mcpb files are self-contained bundles with all dependencies
29. Windows (Detailed) - ⭐ Easy - Complete Windows installation guide
Prerequisites:
- Windows 10/11
- Go 1.24+ installed (optional, for building from source)
Steps:
-
Download Windows binary:
- Go to releases page
- Download
golang-mcp_Windows_x86_64.zip
-
Extract the archive:
- Right-click → Extract All
- Or use:
Expand-Archive golang-mcp_Windows_x86_64.zip
-
Move to a permanent location:
- Create folder:
C:\Program Files\mcp-go\ - Move
mcp-go.exethere
- Create folder:
-
Add to PATH:
- Open System Properties → Environment Variables
- Edit "Path" variable
- Add:
C:\Program Files\mcp-go - Click OK on all dialogs
-
Verify installation:
- Open PowerShell or Command Prompt
- Run:
mcp-go --version
✅ Success: You should see the version number
- If command not found, restart your terminal after adding to PATH
- Check PATH with:
$env:PATH(PowerShell) orecho %PATH%(CMD) - Verify file exists:
Test-Path "C:\Program Files\mcp-go\mcp-go.exe"
30. BoltAI - ⭐ Easy - AI coding assistant
Prerequisites:
- BoltAI installed
mcp-gobinary installed
Steps:
-
Open BoltAI Settings:
- Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: BoltAI integration working
31. Rovo Dev CLI - ⭐ Easy - Development CLI tool
Prerequisites:
- Rovo Dev CLI installed
mcp-gobinary installed
Steps:
-
Edit config:
- Location:
~/.rovo/config.json
- Location:
-
Add MCP server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Rovo CLI can use Go tools
32. Zencoder - ⭐ Easy - AI code generation tool
Prerequisites:
- Zencoder installed
mcp-gobinary installed
Steps:
-
Open Zencoder Settings:
- Settings → MCP Configuration
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Zencoder can use Go tools
33. Qodo Gen - ⭐ Easy - AI code generator
Prerequisites:
- Qodo Gen installed
mcp-gobinary installed
Steps:
-
Edit configuration:
- Location:
~/.qodo/config.json
- Location:
-
Add MCP server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Qodo Gen integration working
34. Factory - ⭐ Easy - AI development platform
Prerequisites:
- Factory installed
mcp-gobinary installed
Steps:
-
Open Factory Settings:
- Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Factory can use Go tools
35. Crush - ⭐ Easy - AI coding assistant
Prerequisites:
- Crush installed
mcp-gobinary installed
Steps:
-
Edit config:
- Location:
~/.crush/config.json
- Location:
-
Add server:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path
✅ Verify: Crush integration working
36. Augment Code - ⭐ Easy - AI code augmentation tool
Prerequisites:
- Augment Code installed
mcp-gobinary installed
Steps:
-
Open Augment Code Settings:
- Settings → MCP Servers
-
Add configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}- Update path and restart
✅ Verify: Augment Code can use Go tools
Run MCP Go Server directly:
mcp-goThe server communicates via stdio (standard input/output) using JSON-RPC 2.0 protocol.
💡 Tip: Useful for testing or custom integrations
Troubleshooting - Common issues and their solutions
Common issues and their solutions. Use the symptoms to find your problem quickly.
Symptoms:
- Terminal says
mcp-go: command not found - Binary exists but can't be run
Solutions:
-
Check if binary is installed:
which mcp-go # macOS/Linux where mcp-go # Windows
-
Add to PATH:
- macOS/Linux: Add
$HOME/go/binto PATHexport PATH=$PATH:$HOME/go/bin
- Windows: Add
%USERPROFILE%\go\binto PATH in Environment Variables
- macOS/Linux: Add
-
Verify PATH:
echo $PATH # macOS/Linux echo %PATH% # Windows
✅ Success: mcp-go --version should work
Symptoms:
Permission deniederror when runningmcp-go
Solutions:
-
Make binary executable:
chmod +x /path/to/mcp-go
-
Check file permissions:
ls -l /path/to/mcp-go
-
On Windows: Run as Administrator if needed
Symptoms:
- Error about Go version
- Requires Go 1.24+
Solutions:
-
Check Go version:
go version
-
Update Go:
- Visit golang.org
- Download latest version
- Install and restart terminal
Symptoms:
- Platform can't find config file
- Server doesn't start
Solutions:
- Create config file if it doesn't exist
- Check file location (see platform-specific guides)
- Verify JSON syntax is valid
- Check file permissions (readable)
Symptoms:
- Config file has syntax errors
- Server fails to start
Solutions:
-
Validate JSON:
- Use online JSON validator
- Or:
python -m json.tool config.json
-
Common mistakes:
- Missing commas
- Trailing commas
- Unclosed brackets
-
Fix and restart your MCP client
Symptoms:
- Server can't find
mcp-gobinary - Path errors in logs
Solutions:
-
Find correct path:
which mcp-go # macOS/Linux where mcp-go # Windows
-
Use absolute path in config (not relative)
-
On Windows: Use forward slashes or double backslashes:
"command": "C:/Program Files/mcp-go/mcp-go.exe" // or "command": "C:\\Program Files\\mcp-go\\mcp-go.exe"
Symptoms:
- Config file looks correct
- Tools not available in Claude
Solutions:
- Restart Claude Desktop completely
- Check config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Validate JSON syntax
- Check Claude Desktop logs for errors
- Verify binary path is correct and executable
Symptoms:
- MCP extension installed but not working
- No tools available
Solutions:
- Check extension is enabled
- Reload VS Code window:
Cmd+Shift+P→ "Reload Window" - Check Output panel for MCP messages
- Verify settings JSON syntax
- Try workspace settings instead of user settings
Symptoms:
- Docker container exits immediately
- Permission errors
Solutions:
-
Check Docker is running:
docker ps
-
Check image exists:
docker images | grep golang-mcp -
Check volume mounts:
- Verify paths are correct
- Check permissions on mounted directories
-
View logs:
docker logs <container-id>
Symptoms:
- MCP server can't find
gocommand - Go tools fail
Solutions:
-
Verify Go is installed:
go version
-
Check PATH includes Go:
echo $PATH # Should include Go bin directory
-
Set GOROOT if needed:
export GOROOT=/usr/local/go
Symptoms:
- LSP tools don't appear
ENABLE_LSP=truebut no tools
Solutions:
-
Check gopls is installed:
which gopls go install golang.org/x/tools/gopls@latest
-
Verify ENABLE_LSP is set:
echo $ENABLE_LSP # Should be "true"
-
Restart MCP server after setting environment variable
Symptoms:
- Permission prompts for every command
- Want to disable them
Solutions:
-
Set DISABLE_NOTIFICATIONS:
export DISABLE_NOTIFICATIONS=true -
Add to config file
envsection:"env": { "DISABLE_NOTIFICATIONS": "true" }
-
Restart MCP client
Symptoms:
- Commands take too long
- Timeouts
Solutions:
-
Enable debug logging:
export DEBUG_MCP=true -
Check system resources (CPU, memory)
-
Check Go proxy:
go env GOPROXY
-
Try different GOPROXY:
export GOPROXY=https://proxy.golang.org
Still having issues?
-
Check logs:
- Enable
DEBUG_MCP=true - Check platform-specific log locations
- Enable
-
Verify installation:
mcp-go --version go version
-
Test standalone:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | mcp-go
-
Check GitHub Issues:
- Search existing issues
- Create new issue with:
- Error messages
- Platform information
- Config file (sanitized)
- Debug logs
Common questions and quick answers.
Q: Do I need Go installed to use MCP Go Server?
A: No. You can use pre-built binaries or Docker. Go is only needed if building from source.
Q: Which installation method should I use?
A:
- Most users: Go Install (easiest)
- No Go installed: Pre-built Binaries
- Development: From Source
- Containers: Docker
Q: Can I install on Windows?
A: Yes. Download the Windows binary from releases or use Go Install. See Windows (Detailed) guide.
Q: Do I need to add mcp-go to PATH?
A: Yes, if using Go Install or binaries. Docker doesn't need PATH setup.
Q: Where is the config file?
A: Depends on your platform. See Platform-Specific Guides for your platform's location.
Q: Can I use environment variables?
A: Yes. See Configuration section for available variables.
Q: Do I need to restart after changing config?
A: Yes. Restart your MCP client (Claude Desktop, VS Code, etc.) after config changes.
Q: Can I use multiple MCP servers?
A: Yes. Add multiple entries in your mcpServers object.
Q: Does it work with [Platform X]?
A: If your platform supports MCP protocol, it should work. See Platform-Specific Guides for setup instructions.
Q: Can I use it in multiple IDEs?
A: Yes. Configure it separately in each IDE's settings.
Q: Does it work offline?
A: Most features work offline. Package documentation tools require internet for fetching from go.dev.
Q: What tools are available?
A: 22 tools total. See Quick Reference or Available Tools for complete list.
Q: Do I need LSP support?
A: Optional. Set ENABLE_LSP=true and install gopls if you want LSP tools.
Q: Can I run Go tests?
A: Yes. Use the go_test tool with various options for coverage, benchmarks, etc.
Q: Can I build for different platforms?
A: Yes. Use go_cross_compile tool to build for different OS/architectures.
Q: Tools don't appear in my client. What's wrong?
A:
- Check config file JSON is valid
- Verify binary path is correct
- Restart your MCP client
- Check logs for errors
Q: "Command not found" error?
A: Add mcp-go to your PATH. See Troubleshooting section.
Q: Permission prompts keep appearing?
A: Set DISABLE_NOTIFICATIONS=true in your config or environment.
Q: How do I enable debug logging?
A: Set DEBUG_MCP=true environment variable or in config file.
Q: Can I contribute?
A: Yes! See Contributing section. Pull requests welcome.
Q: Where do I report bugs?
A: Create an issue on GitHub with details about the problem.
Q: How do I build from source?
A: See From Source in Installation Methods section.
Q: Can I customize the server?
A: Yes, if building from source. Fork the repository and modify as needed.
22 comprehensive tools for Go development, testing, optimization, and management.
View detailed tool documentation
Execute a Go file directly using go run.
Parameters:
file(string, required): Path to the Go file to runargs([]string, optional): Command line arguments to pass to the programworking_dir(string, optional): Working directory for the commandenv_vars(map[string]string, optional): Additional environment variables
Examples:
Run a simple Go file:
{
"name": "go_run",
"arguments": {
"file": "main.go"
}
}Run with command line arguments:
{
"name": "go_run",
"arguments": {
"file": "server.go",
"args": ["--port", "8080", "--host", "localhost"]
}
}Run with environment variables:
{
"name": "go_run",
"arguments": {
"file": "app.go",
"env_vars": {
"DEBUG": "true",
"LOG_LEVEL": "info"
}
}
}🔧 7 tools for building, testing, formatting, and managing Go code.
Build Go packages and dependencies with various build flags.
Parameters:
package(string, optional): Package path to build (default: current directory)output(string, optional): Output file namerace(bool, optional): Enable race detectortags([]string, optional): Build tagsldflags(string, optional): Linker flagstrimpath(bool, optional): Remove file system paths from executableworking_dir(string, optional): Working directory
Examples:
Basic build:
{
"name": "go_build",
"arguments": {
"output": "myapp"
}
}Build with race detector:
{
"name": "go_build",
"arguments": {
"output": "myapp",
"race": true
}
}Build with build tags and version info:
{
"name": "go_build",
"arguments": {
"output": "myapp",
"tags": ["production", "linux"],
"ldflags": "-X main.version=1.0.0 -X main.buildTime=$(date +%s)",
"trimpath": true
}
}Run Go tests with coverage, benchmarks, and race detection.
Parameters:
package(string, optional): Package path to testcover(bool, optional): Enable coverage analysiscover_pkg(string, optional): Packages to coverbench(bool, optional): Run benchmarksrace(bool, optional): Enable race detectorverbose(bool, optional): Verbose outputtimeout(string, optional): Test timeout
Examples:
Run all tests:
{
"name": "go_test",
"arguments": {
"verbose": true
}
}Run tests with coverage:
{
"name": "go_test",
"arguments": {
"cover": true,
"cover_pkg": "./..."
}
}Run tests with benchmarks and race detection:
{
"name": "go_test",
"arguments": {
"bench": true,
"race": true,
"timeout": "30s"
}
}Format Go code using go fmt.
Parameters:
paths([]string, optional): Paths to format (default: current directory)working_dir(string, optional): Working directory
Examples:
Format current directory:
{
"name": "go_fmt",
"arguments": {}
}Format specific files:
{
"name": "go_fmt",
"arguments": {
"paths": ["./cmd", "./internal"]
}
}Manage Go modules (init, tidy, download, vendor, get).
Parameters:
operation(string, required): Module operation: init, tidy, download, vendor, getmodule_path(string, optional): Module path (for init or get)packages([]string, optional): Package paths (for get)working_dir(string, optional): Working directory
Examples:
Initialize a new module:
{
"name": "go_mod",
"arguments": {
"operation": "init",
"module_path": "github.com/user/project"
}
}Tidy dependencies:
{
"name": "go_mod",
"arguments": {
"operation": "tidy"
}
}Add a dependency:
{
"name": "go_mod",
"arguments": {
"operation": "get",
"packages": ["github.com/gin-gonic/gin@latest"]
}
}Vendor dependencies:
{
"name": "go_mod",
"arguments": {
"operation": "vendor"
}
}Generate documentation for Go packages.
Parameters:
package(string, required): Package pathall(bool, optional): Show all documentationworking_dir(string, optional): Working directory
Examples:
View package documentation:
{
"name": "go_doc",
"arguments": {
"package": "net/http"
}
}View all documentation including unexported symbols:
{
"name": "go_doc",
"arguments": {
"package": "./internal/utils",
"all": true
}
}Lint Go code using golangci-lint or go vet.
Parameters:
package(string, optional): Package path to lintlinter(string, optional): Linter to use: golangci-lint or vet (default: vet)working_dir(string, optional): Working directory
Examples:
Lint with go vet:
{
"name": "go_lint",
"arguments": {
"package": "./..."
}
}Lint with golangci-lint:
{
"name": "go_lint",
"arguments": {
"linter": "golangci-lint",
"package": "./cmd"
}
}Cross-compile Go code for different platforms.
Parameters:
package(string, optional): Package path to buildoutput(string, required): Output file namegoos(string, required): Target OS (e.g., linux, darwin, windows)goarch(string, required): Target architecture (e.g., amd64, arm64)working_dir(string, optional): Working directory
Examples:
Build for Linux:
{
"name": "go_cross_compile",
"arguments": {
"output": "myapp-linux",
"goos": "linux",
"goarch": "amd64"
}
}Build for Windows:
{
"name": "go_cross_compile",
"arguments": {
"output": "myapp.exe",
"goos": "windows",
"goarch": "amd64"
}
}Build for macOS ARM:
{
"name": "go_cross_compile",
"arguments": {
"output": "myapp-darwin-arm64",
"goos": "darwin",
"goarch": "arm64"
}
}⚡ 6 tools for profiling, benchmarking, and optimizing Go code performance.
Generate performance profile using pprof.
Parameters:
type(string, required): Profile type: cpu or memoutput(string, required): Output profile file pathduration(string, optional): Profile durationpackage(string, optional): Package to profileworking_dir(string, optional): Working directory
Examples:
Generate CPU profile:
{
"name": "go_profile",
"arguments": {
"type": "cpu",
"output": "cpu.prof"
}
}Generate memory profile:
{
"name": "go_profile",
"arguments": {
"type": "mem",
"output": "mem.prof",
"package": "./internal/handlers"
}
}Generate execution trace for Go programs.
Parameters:
output(string, required): Output trace file pathpackage(string, optional): Package to traceworking_dir(string, optional): Working directory
Example:
{
"name": "go_trace",
"arguments": {
"output": "trace.out",
"package": "./..."
}
}Run benchmarks and analyze results.
Parameters:
pattern(string, optional): Benchmark pattern to matchcount(int, optional): Number of iterationstimeout(string, optional): Benchmark timeoutpackage(string, optional): Package to benchmarkworking_dir(string, optional): Working directory
Examples:
Run all benchmarks:
{
"name": "go_benchmark",
"arguments": {}
}Run specific benchmark pattern:
{
"name": "go_benchmark",
"arguments": {
"pattern": "BenchmarkSort",
"count": 5
}
}Run benchmarks with timeout:
{
"name": "go_benchmark",
"arguments": {
"timeout": "10m",
"package": "./internal/cache"
}
}Detect race conditions in Go code.
Parameters:
package(string, optional): Package to testworking_dir(string, optional): Working directory
Example:
{
"name": "go_race_detect",
"arguments": {
"package": "./..."
}
}Generate memory profile for analysis.
Parameters:
output(string, required): Output profile file pathpackage(string, optional): Package to profileworking_dir(string, optional): Working directory
Example:
{
"name": "go_memory_profile",
"arguments": {
"output": "mem.prof",
"package": "./internal/processor"
}
}Analyze code and provide optimization suggestions based on profiling and benchmarking.
Parameters:
package(string, optional): Package to analyzeworking_dir(string, optional): Working directory
Examples:
Analyze current package:
{
"name": "go_optimize_suggest",
"arguments": {}
}Analyze specific package:
{
"name": "go_optimize_suggest",
"arguments": {
"package": "./internal/processor"
}
}This tool runs benchmarks and static analysis to provide optimization suggestions including:
- Benchmark results for performance baseline
- Static analysis issues from
go vet - General optimization recommendations
- Suggestions for race detection, profiling, and concurrency improvements
🚀 5 tools for managing long-running Go servers in the background.
Start a long-running Go server in the background.
Parameters:
id(string, required): Unique server IDname(string, required): Server namecommand(string, required): Command to run (usually 'go' or binary path)args([]string, required): Command argumentsworking_dir(string, optional): Working directoryenv_vars(map[string]string, optional): Environment variableslog_size(int, optional): Maximum log lines to keep (default: 1000)
Stop a running server.
Parameters:
id(string, required): Server IDforce(bool, optional): Force kill the server (SIGKILL)
List all running servers.
Get logs from a running server.
Parameters:
id(string, required): Server IDcount(int, optional): Number of recent log lines (0 for all)
Get detailed status of a server.
Parameters:
id(string, required): Server ID
📚 3 tools for discovering and exploring Go package documentation.
Fetch package documentation from go.dev (pkg.go.dev). Returns package overview, functions, types, and examples.
Parameters:
package(string, required): Package path (e.g., github.com/gin-gonic/gin, net/http)version(string, optional): Package version
Examples:
Fetch standard library documentation:
{
"name": "go_pkg_docs",
"arguments": {
"package": "net/http"
}
}Fetch third-party package documentation:
{
"name": "go_pkg_docs",
"arguments": {
"package": "github.com/gin-gonic/gin",
"version": "v1.9.1"
}
}The tool returns:
- Package overview and description
- List of functions with signatures and descriptions
- List of types with their kinds and descriptions
- Code examples (if available)
Search for packages on go.dev. Returns a list of matching package paths.
Parameters:
query(string, required): Search query
Examples:
Search for HTTP routers:
{
"name": "go_pkg_search",
"arguments": {
"query": "http router"
}
}Search for database drivers:
{
"name": "go_pkg_search",
"arguments": {
"query": "database driver postgres"
}
}The tool returns a list of package paths matching your query, which you can then use with go_pkg_docs to review documentation.
Extract examples from package documentation.
Parameters:
package(string, required): Package pathversion(string, optional): Package version
Examples:
Extract examples from standard library:
{
"name": "go_pkg_examples",
"arguments": {
"package": "net/http"
}
}Extract examples from third-party package:
{
"name": "go_pkg_examples",
"arguments": {
"package": "github.com/gin-gonic/gin",
"version": "v1.9.1"
}
}🔌 5 tools for Language Server Protocol integration (optional).
⚠️ Note: LSP tools are optional and requireENABLE_LSP=trueenvironment variable to be set. These tools provide Language Server Protocol integration for advanced IDE features.
Start an LSP session for a workspace root URI.
Parameters:
root_uri(string, required): Workspace root URI (file:// path)gopls_path(string, optional): Path to gopls binary (default: searches PATH)args([]string, optional): Additional arguments for goplsenv(map[string]string, optional): Environment variables for gopls
Examples:
Start session with default gopls:
{
"name": "lsp_start_session",
"arguments": {
"root_uri": "file:///path/to/workspace"
}
}Start session with custom gopls path:
{
"name": "lsp_start_session",
"arguments": {
"root_uri": "file:///path/to/workspace",
"gopls_path": "/usr/local/bin/gopls",
"args": ["-rpc.trace"],
"env": {
"GOPATH": "/custom/gopath"
}
}
}Shutdown an LSP session for a workspace root URI.
Parameters:
root_uri(string, required): Workspace root URI
Example:
{
"name": "lsp_shutdown_session",
"arguments": {
"root_uri": "file:///path/to/workspace"
}
}Send a request to an LSP session and wait for a result.
Parameters:
root_uri(string, required): Workspace root URImethod(string, required): LSP method name (e.g., "textDocument/hover", "textDocument/completion")params(object, optional): Request parameters
Examples:
Get hover information:
{
"name": "lsp_request",
"arguments": {
"root_uri": "file:///path/to/workspace",
"method": "textDocument/hover",
"params": {
"textDocument": {
"uri": "file:///path/to/workspace/main.go"
},
"position": {
"line": 10,
"character": 5
}
}
}
}Get code completion:
{
"name": "lsp_request",
"arguments": {
"root_uri": "file:///path/to/workspace",
"method": "textDocument/completion",
"params": {
"textDocument": {
"uri": "file:///path/to/workspace/main.go"
},
"position": {
"line": 15,
"character": 20
}
}
}
}Send a notification to an LSP session (does not wait for response).
Parameters:
root_uri(string, required): Workspace root URImethod(string, required): LSP method name (e.g., "textDocument/didChange", "textDocument/didOpen")params(object, optional): Notification parameters
Example:
{
"name": "lsp_notify",
"arguments": {
"root_uri": "file:///path/to/workspace",
"method": "textDocument/didOpen",
"params": {
"textDocument": {
"uri": "file:///path/to/workspace/main.go",
"languageId": "go",
"version": 1,
"text": "package main\n\nfunc main() {\n}"
}
}
}
}Subscribe to diagnostics published by an LSP session.
Parameters:
root_uri(string, required): Workspace root URI
Example:
{
"name": "lsp_subscribe_diagnostics",
"arguments": {
"root_uri": "file:///path/to/workspace"
}
}This enables receiving diagnostic notifications (errors, warnings, etc.) from the LSP server for the specified workspace.
📦 8 discovery resources for exploring your Go workspace and accessing package documentation.
List of Go modules and dependencies in the current workspace.
Use for: Understanding project dependencies, checking versions, planning updates
Build tags and constraints found in the project.
Use for: Finding platform-specific code, feature flags, conditional builds
List of test files and benchmarks in the project.
Use for: Discovering test coverage, finding benchmarks, understanding test structure
Go workspace structure and configuration.
Use for: Understanding project layout, finding main packages, planning refactoring
Fetch package documentation from go.dev. Supports versioned paths (e.g., go://pkg-docs/encoding/json@v1.0.0).
Use for: Quick access to standard library docs, viewing third-party package documentation
List of all available tools with their names, descriptions, and parameter schemas. Use this resource to discover what tools are available in the MCP server.
Use for: Discovering available tools, understanding tool parameters, finding the right tool
List of all available prompts with their names, descriptions, and arguments. Use this resource to discover what prompts are available for guided workflows.
Use for: Finding prompts for specific tasks, understanding prompt arguments, discovering workflows
List of all available resources with their URIs, names, and descriptions. Use this resource to discover what resources are available in the MCP server.
Use for: Understanding available resources, finding resource URIs, planning resource-based workflows
💡 7 guided prompts for step-by-step workflows and best practices.
Prompts provide guided workflows and step-by-step instructions for common Go development tasks. Each prompt accepts arguments to customize the guidance.
Guide for setting up a new Go project with module initialization, directory structure, and best practices.
Arguments:
project_name(string, required): Name of the Go project to set upmodule_path(string, optional): Go module path (e.g., github.com/username/project)
Use Cases:
- Initializing a new Go project from scratch
- Setting up project structure following Go best practices
- Creating a proper module-based project
Example:
{
"name": "setup-go-project",
"arguments": {
"project_name": "my-api",
"module_path": "github.com/user/my-api"
}
}This prompt guides you through:
- Initializing Go module
- Creating standard directory structure (cmd/, internal/, pkg/, etc.)
- Setting up README and .gitignore
- Creating initial main.go
- Running go mod tidy
Template for writing comprehensive Go tests including unit tests, benchmarks, and table-driven tests.
Arguments:
package_path(string, required): Package path to write tests fortest_type(string, optional): Type of tests to write: unit, benchmark, integration, or all (default: all)
Use Cases:
- Writing tests for new packages
- Adding test coverage to existing code
- Creating benchmarks for performance-critical code
- Setting up integration tests
Examples:
Write all test types:
{
"name": "write-go-tests",
"arguments": {
"package_path": "./internal/processor",
"test_type": "all"
}
}Write only unit tests:
{
"name": "write-go-tests",
"arguments": {
"package_path": "./internal/utils",
"test_type": "unit"
}
}This prompt provides guidance on:
- Table-driven test patterns
- Test organization with subtests
- Error case testing
- Benchmark creation
- Integration test setup
Guide for profiling and optimizing Go code performance using pprof, benchmarks, and race detection.
Arguments:
package_path(string, required): Package to optimizeoptimization_goal(string, optional): Optimization goal: cpu, memory, concurrency, or general (default: general)
Use Cases:
- Identifying performance bottlenecks
- Optimizing CPU-intensive code
- Reducing memory allocations
- Improving concurrency performance
Examples:
General optimization:
{
"name": "optimize-go-performance",
"arguments": {
"package_path": "./internal/processor",
"optimization_goal": "general"
}
}CPU-focused optimization:
{
"name": "optimize-go-performance",
"arguments": {
"package_path": "./internal/processor",
"optimization_goal": "cpu"
}
}This prompt guides you through:
- Establishing baseline with benchmarks
- Profiling CPU and memory usage
- Analyzing profiles with pprof
- Identifying and fixing bottlenecks
- Measuring improvements
- Race condition detection
Systematic approach to debugging Go programs including race conditions, panics, and performance issues.
Arguments:
issue_type(string, optional): Type of issue: panic, race, performance, deadlock, or unknown (default: unknown)package_path(string, optional): Package where the issue occurs
Use Cases:
- Debugging panics and crashes
- Finding race conditions
- Investigating performance problems
- Resolving deadlocks
Examples:
Debug a panic:
{
"name": "debug-go-issue",
"arguments": {
"issue_type": "panic",
"package_path": "./internal/handlers"
}
}Debug race conditions:
{
"name": "debug-go-issue",
"arguments": {
"issue_type": "race",
"package_path": "./internal/worker"
}
}This prompt provides:
- Step-by-step debugging workflow
- Issue-specific debugging strategies
- Tool recommendations (go_test, go_race_detect, go_trace, etc.)
- Verification steps after fixes
Guide for adding and managing Go dependencies using go mod.
Arguments:
package_path(string, required): Package path to add (e.g., github.com/gin-gonic/gin)version(string, optional): Specific version or latest (default: latest)
Use Cases:
- Adding new dependencies to a project
- Updating existing dependencies
- Managing dependency versions
Examples:
Add latest version:
{
"name": "add-go-dependency",
"arguments": {
"package_path": "github.com/gin-gonic/gin"
}
}Add specific version:
{
"name": "add-go-dependency",
"arguments": {
"package_path": "github.com/gin-gonic/gin",
"version": "v1.9.1"
}
}This prompt guides you through:
- Reviewing package documentation first
- Adding the dependency with go mod get
- Reviewing go.mod and go.sum changes
- Running go mod tidy
- Verifying the build
- Best practices for dependency management
Checklist for reviewing Go code including style, performance, security, and best practices.
Arguments:
package_path(string, optional): Package to review
Use Cases:
- Code review preparation
- Quality assurance checks
- Pre-commit validation
- Release preparation
Example:
{
"name": "go-code-review",
"arguments": {
"package_path": "./internal/api"
}
}This prompt provides a comprehensive checklist covering:
- Code quality (formatting, linting, error handling)
- Testing (coverage, edge cases, benchmarks)
- Concurrency (race conditions, synchronization)
- Performance (allocations, data structures)
- Documentation (comments, examples, README)
- Dependencies (security, versions, cleanup)
- Build and deployment (compilation, cross-compilation)
Guide for building and deploying Go servers including cross-compilation, optimization, and production best practices.
Arguments:
target_os(string, optional): Target operating system: linux, darwin, windows (default: linux)target_arch(string, optional): Target architecture: amd64, arm64, 386 (default: amd64)
Use Cases:
- Preparing production builds
- Cross-compiling for different platforms
- Setting up deployment pipelines
- Production server configuration
Examples:
Deploy for Linux:
{
"name": "go-server-deployment",
"arguments": {
"target_os": "linux",
"target_arch": "amd64"
}
}Deploy for macOS ARM:
{
"name": "go-server-deployment",
"arguments": {
"target_os": "darwin",
"target_arch": "arm64"
}
}This prompt covers:
- Pre-deployment testing and validation
- Production build configuration
- Cross-compilation setup
- Security considerations
- Performance optimization
- Monitoring and logging setup
- Post-deployment verification
Usage Examples - Practical examples and workflows
This section provides practical, copy-pasteable examples demonstrating common workflows, tool combinations, and real-world scenarios.
Initialize a new project, format code, run tests, and build:
{
"name": "go_mod",
"arguments": {
"operation": "init",
"module_path": "github.com/user/myproject"
}
}{
"name": "go_fmt",
"arguments": {
"paths": ["./..."]
}
}{
"name": "go_test",
"arguments": {
"verbose": true
}
}{
"name": "go_build",
"arguments": {
"output": "myapp"
}
}Run comprehensive tests with coverage and race detection:
{
"name": "go_test",
"arguments": {
"cover": true,
"cover_pkg": "./...",
"race": true,
"verbose": true
}
}{
"name": "go_race_detect",
"arguments": {
"package": "./..."
}
}Benchmark, profile, and optimize code:
{
"name": "go_benchmark",
"arguments": {
"pattern": "Benchmark.*",
"count": 5
}
}{
"name": "go_profile",
"arguments": {
"type": "cpu",
"output": "cpu.prof",
"duration": "30s",
"package": "./internal/processor"
}
}{
"name": "go_memory_profile",
"arguments": {
"output": "mem.prof",
"package": "./internal/processor"
}
}Build for multiple platforms:
{
"name": "go_cross_compile",
"arguments": {
"output": "myapp-linux-amd64",
"goos": "linux",
"goarch": "amd64"
}
}{
"name": "go_cross_compile",
"arguments": {
"output": "myapp-darwin-arm64",
"goos": "darwin",
"goarch": "arm64"
}
}{
"name": "go_cross_compile",
"arguments": {
"output": "myapp-windows-amd64.exe",
"goos": "windows",
"goarch": "amd64"
}
}Format, lint, test, and build with production flags:
{
"name": "go_fmt",
"arguments": {
"paths": ["./..."]
}
}{
"name": "go_lint",
"arguments": {
"linter": "golangci-lint",
"package": "./..."
}
}{
"name": "go_test",
"arguments": {
"cover": true,
"cover_pkg": "./...",
"race": true
}
}{
"name": "go_build",
"arguments": {
"output": "myapp",
"trimpath": true,
"ldflags": "-X main.version=1.0.0 -X main.buildTime=$(date +%s)"
}
}Build, start, monitor, and stop a server:
{
"name": "go_build",
"arguments": {
"output": "server"
}
}{
"name": "go_server_start",
"arguments": {
"id": "api-server",
"name": "API Server",
"command": "./server",
"args": ["--port", "8080"],
"env_vars": {
"ENV": "development",
"LOG_LEVEL": "debug"
}
}
}{
"name": "go_server_logs",
"arguments": {
"id": "api-server",
"count": 50
}
}{
"name": "go_server_status",
"arguments": {
"id": "api-server"
}
}{
"name": "go_server_stop",
"arguments": {
"id": "api-server"
}
}Search for packages, fetch documentation, and extract examples:
{
"name": "go_pkg_search",
"arguments": {
"query": "http router"
}
}{
"name": "go_pkg_docs",
"arguments": {
"package": "github.com/gin-gonic/gin"
}
}{
"name": "go_pkg_examples",
"arguments": {
"package": "github.com/gin-gonic/gin"
}
}macOS Configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true",
"GOPROXY": "https://proxy.golang.org"
}
}
}
}Windows Configuration:
{
"mcpServers": {
"mcp-go": {
"command": "C:\\Program Files\\mcp-go\\mcp-go.exe",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}
}Linux Configuration:
{
"mcpServers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true",
"GOROOT": "/usr/local/go"
}
}
}
}Troubleshooting:
- Verify installation: Check that
mcp-go --versionworks in terminal - Check permissions: Ensure the binary is executable (
chmod +x /path/to/mcp-go) - Test connection: Restart Claude Desktop after configuration changes
- View logs: Check Claude Desktop logs for connection errors
Workspace Settings (.vscode/settings.json):
{
"mcp.servers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": [],
"env": {
"DISABLE_NOTIFICATIONS": "true"
}
}
}
}User Settings (Global):
{
"mcp.servers": {
"mcp-go": {
"command": "/usr/local/bin/mcp-go",
"args": []
}
}
}Debugging Tips:
- Enable MCP logging in VS Code settings
- Check Output panel for MCP server messages
- Verify Go environment: Ensure
go versionworks in integrated terminal - Test tools: Try calling
go_fmtorgo_testto verify connection
Testing the Server Directly:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | mcp-goJSON-RPC Request Example:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "go_run",
"arguments": {
"file": "main.go"
}
}
}JSON-RPC Response Example:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "Hello, World!"
}
]
}
}Complete workflow for developing and testing a REST API:
{
"name": "go_pkg_search",
"arguments": {
"query": "gin echo fiber"
}
}{
"name": "go_pkg_docs",
"arguments": {
"package": "github.com/gin-gonic/gin"
}
}{
"name": "go_mod",
"arguments": {
"operation": "get",
"packages": ["github.com/gin-gonic/gin@latest"]
}
}{
"name": "go_server_start",
"arguments": {
"id": "rest-api",
"name": "REST API Server",
"command": "go",
"args": ["run", "main.go"],
"env_vars": {
"PORT": "8080",
"ENV": "development"
}
}
}{
"name": "go_server_logs",
"arguments": {
"id": "rest-api",
"count": 100
}
}{
"name": "go_profile",
"arguments": {
"type": "cpu",
"output": "api-cpu.prof",
"duration": "60s"
}
}{
"name": "go_server_stop",
"arguments": {
"id": "rest-api"
}
}Workflow for developing and publishing a Go library:
{
"name": "go_fmt",
"arguments": {
"paths": ["./..."]
}
}{
"name": "go_lint",
"arguments": {
"linter": "golangci-lint",
"package": "./..."
}
}{
"name": "go_test",
"arguments": {
"cover": true,
"cover_pkg": "./...",
"bench": true
}
}{
"name": "go_benchmark",
"arguments": {
"pattern": "Benchmark.*",
"count": 10
}
}{
"name": "go_doc",
"arguments": {
"package": "./...",
"all": false
}
}{
"name": "go_cross_compile",
"arguments": {
"output": "lib-test-linux",
"goos": "linux",
"goarch": "amd64"
}
}Identify and fix performance bottlenecks:
{
"name": "go_benchmark",
"arguments": {
"pattern": "BenchmarkSlowFunction",
"count": 20
}
}{
"name": "go_profile",
"arguments": {
"type": "cpu",
"output": "slow-cpu.prof",
"duration": "30s",
"package": "./internal/slow"
}
}{
"name": "go_trace",
"arguments": {
"output": "slow-trace.out",
"package": "./internal/slow"
}
}{
"name": "go_memory_profile",
"arguments": {
"output": "slow-mem.prof",
"package": "./internal/slow"
}
}{
"name": "go_race_detect",
"arguments": {
"package": "./internal/slow"
}
}After profiling, analyze results:
go tool pprof cpu.prof
go tool trace trace.out
go tool pprof mem.profResources provide structured information about your Go workspace. Access them through the MCP resource protocol.
Discover project dependencies and module information:
Access Pattern:
Resource URI: go://modules
Use Cases:
- Understanding project dependencies before adding new packages
- Checking module versions
- Identifying unused dependencies
- Planning dependency updates
Example Workflow:
- Access
go://modulesto see current dependencies - Use
go_pkg_searchto find alternatives - Use
go_modwithoperation: "get"to add new packages - Use
go_modwithoperation: "tidy"to clean up
Discover build tags and conditional compilation:
Access Pattern:
Resource URI: go://build-tags
Use Cases:
- Understanding platform-specific code
- Finding feature flags
- Planning cross-compilation
- Identifying conditional builds
Example Workflow:
- Access
go://build-tagsto see available tags - Use
go_buildwithtags: ["production", "linux"]for specific builds - Use
go_cross_compilewith appropriate tags for platform builds
Discover test files and benchmarks:
Access Pattern:
Resource URI: go://tests
Use Cases:
- Finding all test files in the project
- Discovering benchmark functions
- Planning test coverage improvements
- Understanding test structure
Example Workflow:
- Access
go://teststo see all test files - Use
go_testwithcover: trueto run with coverage - Use
go_benchmarkto run specific benchmarks - Use
go_race_detectto check for race conditions
Understand project structure and configuration:
Access Pattern:
Resource URI: go://workspace
Use Cases:
- Understanding project layout
- Finding main packages
- Discovering module structure
- Planning refactoring
Example Workflow:
- Access
go://workspaceto understand structure - Use
go_buildwith appropriate package paths - Use
go_testwith specific package paths - Use
go_fmtwith targeted paths
Access package documentation directly:
Access Pattern:
Resource URI: go://pkg-docs/net/http
Resource URI: go://pkg-docs/github.com/gin-gonic/gin
Use Cases:
- Quick access to standard library docs
- Viewing third-party package documentation
- Learning package APIs
- Finding usage examples
Example Workflow:
- Access
go://pkg-docs/net/httpfor HTTP package docs - Use
go_pkg_examplesto get code examples - Use
go_docfor local package documentation - Integrate examples into your code
Example with version:
Resource URI: go://pkg-docs/github.com/gin-gonic/gin@v1.9.1
Discover all available tools and their capabilities:
Access Pattern:
Resource URI: go://tools
Use Cases:
- Discovering available tools when starting with the server
- Understanding tool parameters and schemas
- Finding the right tool for a specific task
- Exploring tool capabilities
Example Workflow:
- Access
go://toolsto see all 22 available tools - Review tool descriptions and parameter schemas
- Select appropriate tools for your workflow
- Use tools in combination for complex tasks
Example Response Structure: The resource returns a JSON object with:
tools: Array of tool metadata including name, description, and input schemacount: Total number of tools available
Discover all available prompts for guided workflows:
Access Pattern:
Resource URI: go://prompts
Use Cases:
- Finding prompts for specific development tasks
- Understanding prompt arguments and requirements
- Discovering guided workflows
- Planning development processes
Example Workflow:
- Access
go://promptsto see all 7 available prompts - Review prompt descriptions and arguments
- Use appropriate prompts for your development phase
- Combine prompts with tools for complete workflows
Example Response Structure: The resource returns a JSON object with:
prompts: Array of prompt metadata including name, description, and argumentscount: Total number of prompts available
Discover all available resources:
Access Pattern:
Resource URI: go://resources
Use Cases:
- Understanding what resources are available
- Finding resource URIs and descriptions
- Planning resource-based workflows
- Discovering workspace discovery capabilities
Example Workflow:
- Access
go://resourcesto see all 8 available resources - Review resource URIs and descriptions
- Use resources to gather workspace information
- Combine resources with tools for informed decision-making
Example Response Structure: The resource returns a JSON object with:
resources: Array of resource metadata including URI, name, description, and MIME typecount: Total number of resources available
-
Understand project structure:
- Access
go://workspaceto see project layout - Access
go://modulesto understand dependencies
- Access
-
Analyze code quality:
- Access
go://teststo see test coverage - Access
go://build-tagsto understand conditional compilation
- Access
-
Plan improvements:
- Access
go://toolsto find appropriate tools - Access
go://promptsfor guided workflows
- Access
-
Execute improvements:
- Use tools based on resource insights
- Follow prompts for structured workflows
- Access
go://modulesto see current dependencies - Use
go_pkg_searchto find alternatives - Access
go://pkg-docs/{package}to review documentation - Use
go_modto add dependencies - Access
go://modulesagain to verify changes
- Access
go://teststo see all test files - Use
go_testwithcover: trueto get coverage report - Identify gaps in test coverage
- Use
write-go-testsprompt for guidance - Access
go://testsagain to verify new tests
Advanced Patterns - Complex workflows and best practices
Automated checks before committing code:
{
"name": "go_fmt",
"arguments": {
"paths": ["./..."]
}
}{
"name": "go_lint",
"arguments": {
"linter": "golangci-lint",
"package": "./..."
}
}{
"name": "go_test",
"arguments": {
"cover": true,
"race": true
}
}Prepare a release with multiple platform builds:
{
"name": "go_mod",
"arguments": {
"operation": "tidy"
}
}{
"name": "go_test",
"arguments": {
"cover": true,
"cover_pkg": "./..."
}
}{
"name": "go_build",
"arguments": {
"output": "myapp",
"trimpath": true,
"ldflags": "-X main.version=1.0.0"
}
}Then cross-compile for all target platforms.
Monitor performance over time:
{
"name": "go_server_start",
"arguments": {
"id": "monitored-server",
"name": "Monitored Server",
"command": "go",
"args": ["run", "main.go"]
}
}{
"name": "go_profile",
"arguments": {
"type": "cpu",
"output": "profile-$(date +%s).prof",
"duration": "5m"
}
}Periodically check logs and profiles to identify trends.
Use resources to inform tool usage:
- Access
go://modulesto see current dependencies - Use
go_pkg_searchto find alternatives - Compare with
go_pkg_docsfor each option - Use
go_modto add the chosen package - Access
go://modulesagain to verify
Use resources to guide testing:
- Access
go://teststo see existing test structure - Use
go_testwithcover: trueto see coverage gaps - Write new tests based on coverage report
- Use
go_benchmarkto ensure performance - Access
go://teststo verify new tests are included
When builds fail, use this diagnostic workflow:
{
"name": "go_fmt",
"arguments": {
"paths": ["./..."]
}
}{
"name": "go_lint",
"arguments": {
"package": "./..."
}
}{
"name": "go_mod",
"arguments": {
"operation": "tidy"
}
}{
"name": "go_build",
"arguments": {
"output": "myapp"
}
}When tests fail, investigate systematically:
{
"name": "go_test",
"arguments": {
"verbose": true,
"package": "./internal/failing"
}
}{
"name": "go_race_detect",
"arguments": {
"package": "./internal/failing"
}
}{
"name": "go_trace",
"arguments": {
"output": "test-trace.out",
"package": "./internal/failing"
}
}When servers behave unexpectedly:
{
"name": "go_server_status",
"arguments": {
"id": "problematic-server"
}
}{
"name": "go_server_logs",
"arguments": {
"id": "problematic-server",
"count": 0
}
}{
"name": "go_profile",
"arguments": {
"type": "mem",
"output": "server-mem.prof",
"duration": "60s"
}
}- Use
go_fmtbefore every commit - Run
go_testwithrace: truefor concurrent code - Use
go_lintregularly to catch issues early - Access
go://workspaceto understand project structure
- Always use
trimpath: truein builds - Include version info via
ldflags - Test with
go_race_detectbefore releases - Cross-compile and test on target platforms
- Benchmark before and after optimizations
- Profile with realistic workloads
- Use
go_tracefor concurrency issues - Monitor memory profiles for leaks
- Use
go://modulesto understand dependencies - Search packages before adding (
go_pkg_search) - Review docs (
go_pkg_docs) before integration - Use
go_mod tidyregularly to clean up
- All command executions require user permission (unless
DISABLE_NOTIFICATIONS=true) - Commands run with the same permissions as the MCP server process
- Command validation prevents injection attacks
- The permission system can use system notifications or console prompts
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
See CHANGELOG.md for version history.