mcpField
H
Hello MCP Go ๐Ÿ‘‹

Hello MCP Go ๐Ÿ‘‹

Local
github.com/softchrisDeveloper Tools5Updated 82w ago

About Hello MCP Go ๐Ÿ‘‹

A starter project demonstrating how to build an MCP server in Go, aimed at Go developers learning the protocol or creating custom servers. It provides hello and calculate tools and explains use with GitHub Copilot Agent Mode in Visual Studio Code.

Key features

  1. 01Go MCP server example
  2. 02Provides the hello tool
  3. 03Provides the calculate tool
  4. 04Build and run instructions
  5. 05GitHub Copilot Agent Mode setup

Use cases

  1. 01Learn to build an MCP server in Go
  2. 02Test simple tool calls in Agent Mode

MCP support

The project implements an MCP server with hello and calculate tools for clients, and documents configuring it in Visual Studio Code.

Configuration

Local server config is the same for every client. Copy it into your clientโ€™s MCP config file.

No install method listed yet

We havenโ€™t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Hello MCP Go ๐Ÿ‘‹

Welcome to the Hello MCP Go repository! ๐Ÿš€ This project demonstrates how to build an MCP (Model Context Protocol) server in Go. Whether you're a Go enthusiast or just curious about MCP, you're in the right place! ๐Ÿ› ๏ธ

Background of Gopher in a carrot field

What is this? ๐Ÿค”

This repository showcases:

  • How to build an MCP server using Go ๐Ÿน.
  • A simple and fun way to explore MCP Protocol ๐ŸŽฎ.
  • A starting point for your own custom MCP server adventures! ๐ŸŒŸ

Tools ๐ŸŒŸ

  • hello, takes the parameters Submitter and Content.
  • calculate, takes the parameters A and B. Example use is "calculate 2 and 4".

Quick Start ๐Ÿš€

  • Clone
  • Install
  • Build
  • Run
  1. Clone the repository:

    git clone https://github.com/your-username/hello-mcp-go.git
    cd hello-mcp
    
  2. Install dependencies:

    go mod tidy
    
  3. Build the project:

    go build -ldflags="-s -w" -o server.exe main.go
    

    or for Linux:

    go build -ldflags="-s -w" -o server main.go
    

    You will use this later when you want to consume it from Visual Studio Code.

  4. Run the server:

    ./server
    
Consuming the Server with GitHub Copilot Agent Mode ๐Ÿด
  1. Place yourself in mcp.json, make sure the server has been built (right now it's adjusted).

  2. Adjust the "command" to point to the absolute path of your executable.

    {
      "servers": {
         "my-mcp-server-d73c20f3": {
             "type": "stdio",
             "command": "/path/to/your/executable"
         }
      }
    }
    
  3. Open Copilot and select Agent in dropdown

  4. Select the play icon.

    You should see the tool icon showing two tools.

  5. Test it with a phrase like so "calculate 2 and 4". This should present a button that invokes the tool on the server.

MCP Go conuming it via Visual Studio Code

Have Fun! ๐ŸŽ‰

This project is all about learning and having fun. Feel free to experiment, break things, and create something amazing! ๐ŸŒˆ

Happy coding! ๐Ÿ’ป

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.