Get the FREE Ultimate OpenClaw Setup Guide →

mcp-local-context

An MCP server that helps AI assistants work with GoLang third-party packages using your local Go module cache.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio svetlyi-mcp-local-context /path-to-the-binary/bin/mcp-local-context

How to use

mcp-local-context is a Go-based MCP server that enables AI assistants to work with Go modules using your local module cache. It provides a built-in Go context prompt and supports additional custom prompts discovered from ~/.mcp-local-context/prompts/*.md, making it easy to tailor instructions for Go packages and third-party modules. You can either reference a specific prompt by name or ask the AI to use the MCP tools to automatically determine the appropriate context instructions for a given language. When using it, the server communicates via standard input/output, acting as an intermediary that supplies context about Go packages and their documentation drawn from your local cache.

How to install

Prerequisites:

  • Go environment installed (requires go command and GOPATH setup)
  • Access to the internet to fetch the binary via go install

Install the MCP server:

  1. Install the binary from the source: go install github.com/svetlyi/mcp-local-context@latest

  2. Locate the built binary path (default GOPATH-based location): echo $(go env GOPATH)/bin/mcp-local-context

  3. (Optional) Move or symlink the binary to a stable location and verify: mv $(go env GOPATH)/bin/mcp-local-context /usr/local/bin/mcp-local-context which mcp-local-context

Usage after installation:

  • The server runs and communicates via stdio. You can add it to your MCP client configuration using the binary path, for example: { "mcpServers": { "local-context": { "command": "/usr/local/bin/mcp-local-context" } } }

Notes:

  • You can customize prompts by placing markdown files in ~/.mcp-local-context/prompts/ and enabling a config file at ~/.mcp-local-context/config.json (optional).
  • The built-in Go context prompt will automatically discover custom prompts once they exist in the prompts directory.

Additional notes

Tips and common considerations:

  • After installation, you can reference a specific prompt by name in your prompts, or instruct the AI to use the MCP tools to automatically fetch context instructions for a language.
  • The optional configuration file (/.mcp-local-context/config.json) supports log_level, log_file, and custom_prompt_dirs. Example: { "log_level": "info", "log_file": "/mcp-local-context.log", "custom_prompt_dirs": ["~/custom-prompts", "/path/to/other/prompts"] }
  • The custom prompts mechanism discovers files in ~/.mcp-local-context/prompts/*.md. Each file can contain an optional header with title and lang to describe the prompt.
  • The server is language-agnostic beyond the provided prompts; its strength comes from the prompts describing how to interact with Go modules and the local cache.
  • If you encounter issues, check that the binary has execute permissions and that the prompts directory is readable by the user running the server.

Related MCP Servers

Sponsor this space

Reach thousands of developers