Back to Home
hloiseau icon

mcp-gopls

Verified Safe

by hloiseau

Overview

Provides a Model Context Protocol (MCP) server for AI assistants to interact with Go code via gopls, offering navigation, diagnostics, testing, coverage, and refactoring capabilities.

Installation

Run Command
mcp-gopls --workspace /absolute/path/to/your/go/project

Environment Variables

  • MCP_GOPLS_WORKSPACE
  • MCP_GOPLS_GOPLS_PATH
  • MCP_GOPLS_LOG_FILE
  • MCP_GOPLS_LOG_LEVEL
  • MCP_GOPLS_LOG_JSON
  • MCP_GOPLS_RPC_TIMEOUT
  • MCP_GOPLS_SHUTDOWN_TIMEOUT

Security Notes

The server's core function is to execute external Go tools (gopls, go test, go mod tidy, govulncheck) based on inputs from an AI client. This inherently involves running subprocesses with arguments derived from potentially untrusted AI input. The project mitigates direct shell injection by using `exec.Command` directly (not through a shell) and includes some path sanitization. It explicitly sets `GOTOOLCHAIN=local` for its child processes, which is good practice. The security largely depends on the trustworthiness of the AI client and the environment's `PATH` configuration. No obvious hardcoded secrets, 'eval' usage, or blatant malicious patterns were found, justifying its primary purpose as a developer tool.

Similar Servers

Stats

Interest Score43
Security Score8
Cost ClassMedium
Avg Tokens1000
Stars59
Forks7
Last Update2026-01-07

Tags

GoLSPAI AssistantDeveloper ToolMCP