Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Kubectl MCP Tool
  • MCP Server for Intercom
  • Code Analysis MCP Server
  • Steel Puppeteer
  • Python Codebase Analysis RAG System
Back to MCP Servers
mcp-gopls

mcp-gopls

Public
hloiseaufcms/mcp-gopls

Enables AI assistants to interact with Go's Language Server Protocol via Model Context Protocol for advanced code analysis, navigation, diagnostics, hover info, completion suggestions, and test coverage insights.

javascript
0 tools
May 30, 2025
Updated Jun 4, 2025

Supercharge Your AI with mcp-gopls

MCP Server

Unlock the full potential of mcp-gopls through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

MCP LSP Go

A Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with Go's Language Server Protocol (LSP) and benefit from advanced Go code analysis features.

Overview

This MCP server helps AI assistants to:

  • Use LSP to analyze Go code
  • Navigate to definitions and find references
  • Check code diagnostics
  • Get hover information for symbols
  • Get completion suggestions

Architecture

This project uses the mark3labs/mcp-go library to implement the Model Context Protocol. The MCP integration enables seamless communication between AI assistants and Go tools.

The server communicates with gopls, the official language server for Go, via the Language Server Protocol (LSP).

Features

  • LSP Integration: Connection to Go's Language Server Protocol for code analysis
  • Code Navigation: Finding definitions and references in the code
  • Code Quality: Getting diagnostics and errors
  • Advanced Information: Hover information and completion suggestions

Project Structure

. ├── cmd │ └── mcp-gopls # Application entry point ├── pkg │ ├── lsp # LSP client to communicate with gopls │ │ ├── client # LSP client implementation │ │ └── protocol # LSP protocol types and features │ ├── server # MCP server │ └── tools # MCP tools exposing LSP features

Installation

go install github.com/hloiseaufcms/mcp-gopls/cmd/mcp-gopls@latest

Add to Cursor

{ "mcpServers": { "mcp-gopls": { "command": "mcp-gopls" } } }

MCP Tools

The MCP server provides the following tools:

ToolDescription
go_to_definitionNavigate to the definition of a symbol
find_referencesFind all references to a symbol
check_diagnosticsGet diagnostics for a file
get_hover_infoGet detailed information about a symbol
get_completionGet completion suggestions at a position
analyze_coverageAnalyze test coverage for Go code

Usage Example

Using the server with AI assistants that support MCP:

# Ask the AI to get information about the code Can you find the definition of the `ServeStdio` function in this project? # Ask for diagnostics Are there any errors in my main.go file? # Ask for information about a symbol What does the Context.WithTimeout function do in Go?

Development

git clone https://github.com/hloiseaufcms/mcp-gopls.git cd mcp-gopls go mod tidy go build -o mcp-gopls cmd/mcp-gopls/main.go ./mcp-gopls

Prerequisites

  • Go 1.21 or higher
  • gopls installed (go install golang.org/x/tools/gopls@latest)

Integration with Ollama

This MCP server can be used with any tool that supports the MCP protocol. For Ollama integration:

  1. Make sure Ollama is running
  2. The MCP server runs independently and communicates through stdin/stdout
  3. Configure your client to use the MCP server as a tool provider

License

Apache License 2.0

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Kubectl MCP Tool
    Kubectl MCP Tool

    Enables AI assistants to interact with Kubernetes clusters via natural language using the Model Cont...

    Added May 30, 2025
  • MCP Server for Intercom
    MCP Server for Intercom

    Enables AI assistants to access, search, and filter Intercom customer support conversations and tick...

    4 tools
    Added May 30, 2025
  • Code Analysis MCP Server
    Code Analysis MCP Server

    Enables AI-driven natural language exploration and analysis of codebases via Model Context Protocol,...

    4 tools
    Added May 30, 2025
  • Steel Puppeteer
    Steel Puppeteer

    Model Context Protocol server enabling advanced browser automation with Puppeteer, offering web navi...

    Added May 30, 2025
  • Python Codebase Analysis RAG System
    Python Codebase Analysis RAG System

    Analyzes Python codebases using AST to extract and vectorize code elements, enabling advanced queryi...

    Added May 30, 2025