Sponsored by Deepsite.site

McpServer

Created By
Jdchjq7 months ago
Content

MCP SERVER

这是基于 mcp-go 实现的一些 mcp server

server

细节

目前实现的功能有

  • weather 天气相关的功能,用于查询天气数据。底层使用的是和风天气 API

一些补充

目前 mcp-go 没有实现对返回结果进行注释,本项目通过重写自定义类型的 UnmarshalJSON 方法,将注释的 tag 赋值到每个 description 字段中,方便 AI 在获取结果后能充分、正确的解读(一定程度增加了 token 量)

client

使用方式

执行输入参数:
1、configDir
表示配置文件所在目录,路径下的配置文件需要 config/config.yaml 、config/private_key.pem
因为配置比较多,没有改成环境变量的输入方式
2、transport
mcp server 的运行方式,sse 表示采用 http 推流方式运行,stdio 表示采用进程间通信方式运行

客户端配置
1、通过 stdio(进程间通信)方式调用 server
先使用 go build -0 ./bin/weather ./cmd/weather 将程序编译成可执行文件
最后在 command 填入可执行文件的路径,env 配置 go 的相关环境变量

"my-weather-server": {
  "command": "/Users/jundongchen/Documents/go/src/smart-customer/bin/weather",
  "args": [
    "--configDir=/Users/jundongchen/Documents/go/src/smart-customer",
    "--transport=stdio"
  ],
  "env": {
    "GOPATH": "/Users/jundongchen/Documents/go",
    "GOMODCACHE": "/Users/jundongchen/Documents/go/pkg/mod"
  }
}

2、通过 sse 方式调用 server
此方式适用于需要远程调用 mcp server, 在使用前,需要使用go run ./cmd/weather/main.go --configDir=/Users/jundongchen/Documents/go/src/smart-customer -t=sse 运行 mcp server
客户端 mcp json 配置如下:

"my-weather-server-sse": {
  "url": "http://localhost:8080/sse",
  "args": [
    "--configDir=/Users/jundongchen/Documents/go/src/smart-customer",
    "--transport=stdio"
  ],
  "env": {
    "GOPATH": "/Users/jundongchen/Documents/go",
    "GOMODCACHE": "/Users/jundongchen/Documents/go/pkg/mod"
  },
  "transportType": "sse",
},

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
CursorThe AI Code Editor
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.