mcp-go

(★ 9,018)

A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.

File Explorer

  • .gitignore
  • .golangci.yml
  • AGENTS.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • go.mod
  • go.sum
  • LICENSE
  • logo.png
  • README.md
  • SECURITY.md

# Installation Guide

go
Prerequisites

Setup Steps

go get github.com/mark3labs/mcp-go

Add the mcp-go library as a dependency to your project.

go run main.go

Run your MCP server or example file.

Video Guides

Tutorial

Key Commands

go get github.com/mark3labs/mcp-go

Install the mcp-go package into your project.

go run main.go

Build and run the Go program immediately.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

fmt

View Details ▼

Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).

fmt {{path/to/file}}

Reformat a file:

fmt {{[-w|--width]}} {{n}} {{path/to/file}}

Reformat a file producing output lines of (at most) `n` characters:

fmt {{[-s|--split-only]}} {{path/to/file}}

Reformat a file without joining lines shorter than the given width together:

🔍

go generate

View Details ▼

Generate Go files by running commands within source files.

go generate

Generate Go files by running commands within source files:

🔍

go get

View Details ▼

Add a dependency package, or download packages in legacy GOPATH mode.
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.

go get {{example.com/pkg}}

Add a specified package to `go.mod` in module-mode or install the package in GOPATH-mode:

go get {{example.com/pkg}}@{{v1.2.3}}

Modify the package with a given version in module-aware mode:

go get {{example.com/pkg}}@{{none}}

Remove a specified package:

🔍

goimports

View Details ▼

Update Go import lines, adding missing ones and removing unreferenced ones.

goimports {{path/to/file.go}}

Display the completed import source file:

goimports -w {{path/to/file.go}}

Write the result back to the source file instead of `stdout`:

goimports -w -d {{path/to/file.go}}

Display diffs and write the result back to the source file:

🔍

select

View Details ▼

Bash builtin construct for creating menus.

select {{word}} in {{apple orange pear banana}}; do echo ${{word}}; done

Create a menu out of individual words:

select {{line}} in $({{command}}); do echo ${{line}}; done

Create a menu from the output of another command:

PS3="{{Select a file: }}"; select {{file}} in *; do echo ${{file}}; done

Specify the prompt string for `select` and create a menu for picking a file or folder from the current directory:

🔍

Task

View Details ▼

To-do list manager.

task add {{description}} due:{{tomorrow}}

Add a new task which is due tomorrow:

task {{task_id}} modify priority:{{H|M|L}}

Update a task's priority:

task {{task_id}} done

Complete a task:

// repository documentation