Golang MCP
π€ An MCP server that provides AI assistants with tools to build, test, profile, and manage Go (Golang) projects.
Installation
npx golang-mcpAsk AI about Golang MCP
Powered by Claude Β· Grounded in docs
I know everything about Golang MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MCP Go Server
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.
Table of Contents
- 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
Quick Start
Choose your platform to get started quickly:
Popular Platforms
- 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
Installation Methods
- Go Install - Install via Go toolchain (recommended)
- From Source - Build from GitHub repository
- Pre-built Binaries - Download ready-made binaries
- Docker - Use containerized version
What You Need First
- Go 1.24 or higher - Check with
go version - Git - For cloning the repository (if building from source)
Quick Reference Tables
Platform Compatibility
| Platform | macOS | Windows | Linux | Difficulty |
|---|---|---|---|---|
| Claude Desktop | β | β | β | β Easy |
| Cursor | β | β | β | β Easy |
| VS Code | β | β | β | β Easy |
| Docker | β | β | β | ββ Medium |
| JetBrains IDEs | β | β | β | ββ Medium |
| Windsurf | β | β | β | β Easy |
| Zed | β | β | β | β Easy |
Installation Method Comparison
| 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 |
Config File Locations by OS
| 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 |
Common Issues Quick Fix
| 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 |
Quick Reference
Tools (22 total)
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
Resources (8 total)
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
Prompts (7 total)
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
Features
- 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
Prerequisites
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 version
Installation Methods
Choose 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 |
Using Go Install
β 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.
β οΈ Troubleshooting:
- 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
From Source
π§ 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
Using Pre-built Binaries
β 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)
Using Docker
π§ Best for containerized environments
Pull from GitHub Container Registry
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
Build from Source
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
Run with Docker
Basic usage:
docker run -it --rm \
-v $(pwd):/workspace \
-w /workspace \
mcp-go:latest
Using docker-compose:
docker-compose up
Docker Compose Configuration
The 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
Configuration
π§ 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
Configuration Options
| 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
Common Configuration Examples
π‘ 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/go
β οΈ Note: Environment variables set in your shell need to be passed to your MCP client's config file env section for them to take effect.
Platform-Specific Guides
Configure MCP Go Server for your platform. Each guide includes step-by-step instructions, config file locations, and verification steps.
Quick Platform Reference
| 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
β οΈ Troubleshooting:
- 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
β οΈ Troubleshooting:
- 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
Standalone Usage
Run MCP Go Server directly:
mcp-go
The 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.
Installation Issues
β "Command not found: mcp-go"
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
β "Permission denied"
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
β "Go version too old"
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
Configuration Issues
β "Config file not found"
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)
β "Invalid JSON in config"
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
β "Binary path incorrect"
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"
Platform-Specific Issues
β Claude Desktop: Tools don't appear
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
β VS Code: MCP extension not working
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
β Docker: Container won't start
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>
Runtime Issues
β "Go command not found"
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
β "LSP tools not available"
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
β "Permission prompts keep appearing"
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
Performance Issues
β "Server is slow"
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
Getting More Help
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
FAQ
Common questions and quick answers.
Installation
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.
Configuration
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.
Platform Support
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.
Features
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.
Troubleshooting
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.
Development
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.
Available Tools
22 comprehensive tools for Go development, testing, optimization, and management.
View detailed tool documentation
Code Execution Tools
β go_run
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"
}
}
}
Go Tools
π§ 7 tools for building, testing, formatting, and managing Go code.
β go_build
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
}
}
go_test
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"
}
}
go_fmt
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"]
}
}
go_mod
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"
}
}
go_doc
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
}
}
go_lint
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"
}
}
go_cross_compile
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"
}
}
Optimization Tools
β‘ 6 tools for profiling, benchmarking, and optimizing Go code performance.
β go_profile
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"
}
}
go_trace
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": "./..."
}
}
go_benchmark
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"
}
}
go_race_detect
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": "./..."
}
}
go_memory_profile
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"
}
}
go_optimize_suggest
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
Server Management Tools
π 5 tools for managing long-running Go servers in the background.
β go_server_start
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)
go_server_stop
Stop a running server.
Parameters:
id(string, required): Server IDforce(bool, optional): Force kill the server (SIGKILL)
go_server_list
List all running servers.
go_server_logs
Get logs from a running server.
Parameters:
id(string, required): Server IDcount(int, optional): Number of recent log lines (0 for all)
go_server_status
Get detailed status of a server.
Parameters:
id(string, required): Server ID
Package Documentation Tools
π 3 tools for discovering and exploring Go package documentation.
β go_pkg_docs
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)
go_pkg_search
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.
go_pkg_examples
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"
}
}
LSP Tools
π 5 tools for Language Server Protocol integration (optional).
β οΈ Note: LSP tools are optional and require
ENABLE_LSP=trueenvironment variable to be set. These tools provide Language Server Protocol integration for advanced IDE features.
β lsp_start_session
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"
}
}
}
lsp_shutdown_session
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"
}
}
lsp_request
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
}
}
}
}
lsp_notify
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}"
}
}
}
}
lsp_subscribe_diagnostics
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.
Available Resources
π¦ 8 discovery resources for exploring your Go workspace and accessing package documentation.
β go://modules
List of Go modules and dependencies in the current workspace.
Use for: Understanding project dependencies, checking versions, planning updates
β go://build-tags
Build tags and constraints found in the project.
Use for: Finding platform-specific code, feature flags, conditional builds
β go://tests
List of test files and benchmarks in the project.
Use for: Discovering test coverage, finding benchmarks, understanding test structure
β go://workspace
Go workspace structure and configuration.
Use for: Understanding project layout, finding main packages, planning refactoring
β go://pkg-docs/{path}
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
β go://tools
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
β go://prompts
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
β go://resources
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
Available Prompts
π‘ 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.
β setup-go-project
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
β write-go-tests
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
β optimize-go-performance
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
β debug-go-issue
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
β add-go-dependency
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
β go-code-review
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)
β go-server-deployment
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.
Common Development Workflows
Quick Start Workflow
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"
}
}
Testing Workflow
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": "./..."
}
}
Performance Analysis Workflow
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"
}
}
Cross-Compilation Workflow
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"
}
}
Multi-Tool Examples
Complete CI/CD-like Workflow
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)"
}
}
Server Development Workflow
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"
}
}
Package Research Workflow
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"
}
}
Integration Examples
Claude Desktop Setup
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
VS Code Setup
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
Standalone Usage
Testing the Server Directly:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {}}' | mcp-go
JSON-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!"
}
]
}
}
Real-World Scenarios
Building a REST API
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"
}
}
Library Development
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"
}
}
Debugging Performance Issues
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.prof
Resources Usage
Resources provide structured information about your Go workspace. Access them through the MCP resource protocol.
Using go://modules
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
Using go://build-tags
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
Using go://tests
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
Using go://workspace
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
Using go://pkg-docs/{path}
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
Using go://tools
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
Using go://prompts
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
Using go://resources
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
Resource Integration Examples
Complete Project Analysis Workflow
-
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
Dependency Management Workflow
- 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
Test Coverage Analysis Workflow
- 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
Combining Tools in Complex Workflows
Pre-commit Workflow
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
}
}
Release Preparation Workflow
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.
Continuous Profiling Workflow
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.
Using Resources with Tools
Dependency Management Workflow
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
Test-Driven Development Workflow
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
Error Handling and Troubleshooting
Build Failures
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"
}
}
Test Failures
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"
}
}
Server Issues
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"
}
}
Best Practices
For Development
- Use
go_fmtbefore every commit - Run
go_testwithrace: truefor concurrent code - Use
go_lintregularly to catch issues early - Access
go://workspaceto understand project structure
For Production
- Always use
trimpath: truein builds - Include version info via
ldflags - Test with
go_race_detectbefore releases - Cross-compile and test on target platforms
For Performance
- Benchmark before and after optimizations
- Profile with realistic workloads
- Use
go_tracefor concurrency issues - Monitor memory profiles for leaks
For Package Management
- 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
Security Considerations
- 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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Changelog
See CHANGELOG.md for version history.
