Cover image
Try Now
2025-03-29

Golang MCP server example

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

Getting Started

This project tests the initial LiteLLM MCP implementation with a few other MCP servers and clients. In particular the go-based mcp server and client from mark3labs

Requirements

You need to have the following installed

  • go 1.24.1
  • uv

Setup deps

uv venv --python 3.13
source .venv/bin/activate # windows -- source .venv/Scripts/active
uv pip install -r requirements.txt

# cd into each and install dependencies
cd client;go mod download; cd ..
cd server; go mod download; cd ..

Setup litellm proxy

Or via docker

docker compose up

Running MCP Go server

cd server
go mod download
go run main.go -t sse -p 8080 # transport over http network with port 8080

Running MCP Go client

# run go mcp server first on sse transport
cd client
go run main.go -mcpUri 'http://localhost:8080/sse' # connect to mcp server on uri

Testing Litellm sdk MCP client

# run go mcp server first on sse transport

# run client
cd bridge
python litellm_client.py

Testing python sdk on LiteLLM Proxy MCP

# run go litellm proxy
docker compose up

# run client
cd bridge
python mcp_client.py
# Initializing session...
# Session initialized
# Loading tools...
# Loaded 1 tools
# meta=None content=[TextContent(type='text', text='13:04', annotations=None)] isError=Fals

Testing Go client on LiteLLM proxy MCP

# run go litellm proxy
docker compose up

cd bridge
go run main.go -mcpUri http://localhost:4000/mcp
# 2025/03/29 06:02:11 Connected to server with name litellm-mcp-server
# 2025/03/29 06:02:11 Ping successful
# 2025/03/29 06:02:11 Found 1 tools
# 2025/03/29 06:02:11 Tool: get_current_time
# 2025/03/29 06:02:11 Calling get_current_time tool
# 2025/03/29 06:02:11 Result: 13:02

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • momi
  • Provides initial medical assessments and advice.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • zhaoyunxing92
  • 本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。

  • justmywyw
  • Short and sweet example MCP server / client implementation for Tools, Resources and Prompts.

  • sligter
  • Lite-MCP-Client是一个基于命令行的轻量级MCP客户端工具

    Reviews

    3 (1)
    Avatar
    user_Wk8yOIJq
    2025-04-17

    I've been using the go-mcp application and I'm really impressed with its functionalities. This tool built by wagnerjt is a great asset for managing networks efficiently. Plus, the integration is seamless and the documentation is clear. Whether you're a beginner or an expert, you'll find it user-friendly. Highly recommend checking it out at https://github.com/wagnerjt/go-mcp.