1. Conduid
  2. Developer Tools
  3. Go
MCP server · Developer Tools

Go

MCP Server GO

Unclaimed Apache-2.0 last commit 7 months ago devtools
56Fair

Scored 4 months ago · breakdown

About Go

Go is an MCP server published by isYaoNoistu in the Developer Tools category: mCP Server GO. It has been installed 0 times through Conduid.

The repository has 1 stars and 0 forks, with the last commit 7 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx mcp-server-go

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Go

Powered by Claude · Grounded in docs

I know everything about Go. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

MCP Server (Go Edition)

一个基于Go语言实现的MCP (Model Context Protocol) 服务器,提供高性能的JSON-RPC 2.0接口,兼容Cherry Studio和Dify平台。

特性

  • 🚀 高性能: Go语言实现,性能比Python版本提升3-5倍
  • 🔌 双平台兼容: 同时支持 Cherry Studio 和 Dify 平台
  • 🧩 插件化架构: 工具模块化设计,易于扩展
  • ⚙️ 灵活配置: 支持 .env 文件和环境变量配置
  • 📊 Web管理界面: 提供工具管理、调用记录、统计分析
  • 🔒 状态持久化: 工具启用/禁用状态自动保存

系统要求

  • Go 1.21 或更高版本
  • 可选: Docker, Prometheus, Jenkins, MySQL (用于对应工具)

快速开始

1. 克隆项目

git clone https://github.com/isYaoNoistu/mcp-server-go.git
cd mcp-server-go

2. 安装依赖

go mod download

3. 配置环境

复制示例配置文件:

cp .env.example .env

编辑 .env 文件配置各工具参数:

# Server Configuration
PORT=8000
HOST=0.0.0.0
GIN_MODE=release

# Read File Tool
READ_FILE_PATH=/path/to/your/file.md

# Prometheus Tool (optional)
PROMETHEUS_API_URL=http://localhost:9090

# MySQL Tool (optional)
MYSQL_DEFAULT_HOST=localhost
MYSQL_DEFAULT_PORT=3306
MYSQL_DEFAULT_USER=root
MYSQL_DEFAULT_PASSWORD=password
MYSQL_DEFAULT_DATABASE=mydb

# Jenkins Tool (optional)
JENKINS_URL=http://localhost:8080
JENKINS_USER=admin
JENKINS_TOKEN=your_token

# Tool Control
ALLOW_AUTO_ENABLE_NEW_TOOLS=true
# TOOL_READ_FILE=1  # Enable specific tool
# TOOL_PROMETHEUS=0 # Disable specific tool

4. 运行服务器

go run main.go

或编译后运行:

go build -o mcp-server-go
./mcp-server-go

服务器将在 http://localhost:8000 启动。

使用说明

Web管理界面

访问 http://localhost:8000 打开Web管理界面,可以:

  • 查看所有工具列表
  • 启用/禁用工具
  • 查看调用记录
  • 查看统计数据
  • 配置工具参数

Cherry Studio 配置

  1. 打开 Cherry Studio 设置
  2. 导入 MCP 配置文件 cherry/cherry_mcp.json
  3. 修改配置中的服务器地址为 http://localhost:8000/mcp
  4. 保存配置
  5. 在对话中调用MCP工具

Dify 平台配置

  1. 在 Dify 中添加 MCP 服务器
  2. 服务器地址: http://localhost:8000/mcp
  3. 协议: JSON-RPC 2.0
  4. Dify 会自动调用 initializetools/list 方法
  5. 在工作流中使用MCP工具

API 接口

MCP Endpoint

POST /mcp

JSON-RPC 2.0 接口,支持以下方法:

  • initialize - 初始化服务器
  • tools/list - 列出所有可用工具
  • tools/call - 执行工具

示例请求:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

REST API

  • GET / - Web管理界面
  • GET /api/status - 服务器状态
  • GET /api/tools - 工具列表
  • POST /api/tools/toggle - 切换工具状态
  • POST /api/config/save - 保存配置
  • GET /api/records - 调用记录 (分页)
  • GET /api/stats - 统计数据

可用工具

当前实现的工具:

  • read_file - 文件读取工具
  • 🚧 prometheus_tools - Prometheus查询工具 (待实现)
  • 🚧 docker_tools - Docker管理工具 (待实现)
  • 🚧 jenkins_tools - Jenkins集成工具 (待实现)
  • 🚧 mysql_query_tools - MySQL查询工具 (待实现)
  • 🚧 files_query_tools - 文件查询工具 (待实现)
  • 🚧 system_check_tools - 系统检查工具 (待实现)

开发工具

添加新工具

  1. tools/ 目录下创建新包
  2. 实现 core.Tool 接口:
package mytool

import "github.com/isYaoNoistu/mcp-server-go/core"

type MyTool struct{}

func NewMyTool() core.Tool {
    return &MyTool{}
}

func (t *MyTool) Name() string {
    return "my_tool"
}

func (t *MyTool) Description() string {
    return "My custom tool"
}

func (t *MyTool) InputSchema() map[string]interface{} {
    return map[string]interface{}{
        "type": "object",
        "properties": map[string]interface{}{
            "param1": map[string]interface{}{
                "type": "string",
                "description": "Parameter 1",
            },
        },
        "required": []string{"param1"},
    }
}

func (t *MyTool) Aliases() []string {
    return []string{"mytool", "mt"}
}

func (t *MyTool) Run(params map[string]interface{}) (string, error) {
    // Implementation
    return "Tool executed successfully", nil
}
  1. tools/tools.go 中注册:
import "github.com/isYaoNoistu/mcp-server-go/tools/mytool"

func GetAllTools() []core.Tool {
    return []core.Tool{
        // ...existing tools
        mytool.NewMyTool(),
    }
}

运行测试

go test ./...

编译

# 本地编译
go build -o mcp-server-go

# 交叉编译 (Linux)
GOOS=linux GOARCH=amd64 go build -o mcp-server-go-linux

# 交叉编译 (Windows)
GOOS=windows GOARCH=amd64 go build -o mcp-server-go.exe

部署

systemd 服务

  1. 复制二进制文件到 /opt/mcp-server-go/
  2. 复制 .env 文件到 /opt/mcp-server-go/
  3. 复制 systemd 服务文件:
sudo cp systemd/mcp-server-go.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable mcp-server-go
sudo systemctl start mcp-server-go

Docker (即将支持)

docker build -t mcp-server-go .
docker run -p 8000:8000 --env-file .env mcp-server-go

项目结构

mcp-server-go/
├── main.go              # 入口文件
├── core/                # 核心模块
│   ├── types.go        # 类型定义
│   ├── protocol.go     # JSON-RPC协议
│   ├── state.go        # 状态管理
│   ├── records.go      # 调用记录
│   ├── registry.go     # 工具注册
│   └── api.go          # API路由
├── config/             # 配置管理
│   └── config.go
├── tools/              # 工具实现
│   ├── tools.go        # 工具注册
│   ├── readfile/
│   ├── prometheus/
│   ├── docker/
│   ├── jenkins/
│   ├── mysql/
│   ├── filesquery/
│   └── systemcheck/
└── web/                # Web界面
    └── static/

性能对比

指标 Python版本 Go版本 提升
启动时间 ~2.5s ~0.3s 8.3x
内存占用 ~80MB ~15MB 5.3x
QPS ~500 ~8000 16x
并发处理 受限 优秀 -

贡献

欢迎提交 Issue 和 Pull Request!

许可证

MIT License

致谢

本项目基于 Python 版本的 MCP Server 重构而来,感谢原项目作者。

README mirrored from the source repository 4 months ago. The original is authoritative.

Questions

About Go

How do I install Go?

Run npx mcp-server-go, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Go safe to use with an AI agent?

Its trust score is 56 out of 100 (fair). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Go still maintained?

The last commit was 7 months ago, with 0 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.