Token导航 LogoToken导航TokenDH.com
MCP Go Gemini logo
开发工具未说明官方级别未说明来源级核验

MCP Go Gemini

MCP Server

一个基于Go语言构建的MCP服务器,集成了Google Gemini API,提供文本生成、代码分析、翻译等多种AI功能。

工具数

7

提示词数

0

GitHub Stars

1

资源数

0
AI服务代码分析GoClaudeClaude DesktopClaudeClineVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Tai-DT

提供方

Tai-DT

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

MCP Go Gemini Server

🚀 Một MCP (Model Context Protocol) server được xây dựng bằng Go, tích hợp với Google Gemini API để cung cấp các tính năng AI tiên tiến.

](https://golang.org/) ![License](LICENSE) ![MCP Compatible](https://modelcontextprotocol.io/)

✨ Tính năng

  • 🤖 Text Generation: Tạo văn bản thông minh với Gemini
  • 🔍 Code Analysis: Phân tích, giải thích và review mã nguồn
  • ✍️ Text Improvement: Cải thiện văn bản và nâng cao chất lượng
  • 🌐 Translation: Dịch thuật đa ngôn ngữ chính xác
  • ❓ Question Answering: Trả lời câu hỏi với độ chính xác cao
  • ⚡ Code Generation: Tạo mã nguồn từ mô tả tự nhiên
  • 📄 Document Summarization: Tóm tắt tài liệu thông minh

🚀 Cài đặt nhanh

Yêu cầu hệ thống

Cài đặt

# Clone repository
git clone 
cd mcp-go-gemini

# Cài đặt dependencies
go mod tidy

# Thiết lập API key
export GEMINI_API_KEY="your-api-key-here"

# Build và chạy
go build -o mcp-go-gemini .
./mcp-go-gemini

Hoặc sử dụng script nhanh:

./start.sh

🛠 Sử dụng với MCP Clients

Claude Desktop

Thêm cấu hình vào claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-go-gemini": {
      "command": "/path/to/mcp-go-gemini",
      "env": {
        "GEMINI_API_KEY": "your-api-key"
      }
    }
  }
}

VS Code + Cline Extension

  1. Cài đặt Cline extension
  2. Cấu hình MCP server trong settings
  3. Sử dụng trực tiếp trong VS Code

📚 API Documentation

Các công cụ có sẵn

Công cụMô tảTham số
generate_textTạo văn bảnprompt, temperature, max_tokens
analyze_codePhân tích mã nguồncode, language, task
improve_textCải thiện văn bảntext, task
translate_textDịch thuậttext, source_language, target_language
answer_questionTrả lời câu hỏiquestion, context
generate_codeTạo mã nguồndescription, language, framework
summarize_documentTóm tắt tài liệucontent, length

Ví dụ sử dụng

Tạo văn bản

{
  "name": "generate_text",
  "arguments": {
    "prompt": "Viết một bài thơ về ngôn ngữ lập trình Go",
    "temperature": 0.8
  }
}

Phân tích mã nguồn

{
  "name": "analyze_code", 
  "arguments": {
    "code": "func main() { fmt.Println(\"Hello, World!\") }",
    "language": "go",
    "task": "explain"
  }
}

Dịch thuật

{
  "name": "translate_text",
  "arguments": {
    "text": "Hello, world!",
    "source_language": "English", 
    "target_language": "Vietnamese"
  }
}

Xem thêm tại API Reference

📁 Cấu trúc dự án

mcp-go-gemini/
├── main.go                 # Entry point
├── internal/
│   ├── gemini/            # Gemini API integration
│   │   └── client.go
│   ├── handlers/          # Tool handlers
│   │   └── handlers.go
│   └── config/            # Configuration
│       └── config.go
├── examples/              # Usage examples
├── docs/                  # Documentation
├── Dockerfile            # Docker configuration
├── docker-compose.yml    # Docker Compose
├── Makefile              # Build automation
└── README.md

🧪 Testing

Chạy test để kiểm tra functionality:

# Unit tests
go test ./...

# Integration test với API thật
go run test_client.go

# Build test
make test

🐳 Docker Support

# Build image
docker build -t mcp-go-gemini .

# Run với docker-compose
docker-compose up -d

🔧 Development

Build commands

make build      # Build binary
make run        # Build và chạy
make clean      # Clean artifacts
make test       # Run tests
make lint       # Code linting

Code structure

  • internal/gemini/: Gemini API client và wrapper
  • internal/handlers/: MCP tool handlers
  • internal/config/: Configuration management
  • main.go: Server initialization và tool registration

🚦 Performance

  • Response time: ~1-3 giây cho most operations
  • Concurrency: Thread-safe, hỗ trợ multiple clients
  • Memory: ~10-50MB runtime usage
  • Rate limiting: Tuân thủ Gemini API limits

🔐 Security

  • ✅ API key qua environment variables
  • ✅ Input validation và sanitization
  • ✅ Error handling secure
  • ✅ No sensitive data logging
  • ✅ HTTPS cho tất cả API calls

📋 Troubleshooting

Lỗi thường gặp

  1. "GEMINI_API_KEY not set"

- Đảm bảo đã set environment variable - Kiểm tra API key hợp lệ

  1. "Failed to create client"

- Kiểm tra internet connection - Verify API key tại Google AI Studio

  1. Build errors

- Đảm bảo Go 1.21+ - Chạy go mod tidy

Xem thêm tại Installation Guide

🤝 Contributing

  1. Fork the project
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.

🙏 Acknowledgments

📞 Support

  • 📧 Email: [your-email]
  • 🐛 Issues: [GitHub Issues]
  • 💬 Discussions: [GitHub Discussions]
  • 📖 Docs: [Full Documentation]

Made with ❤️ and GoPowered by Gemini AIMCP Compatible

目录标签

目录标签

AI服务代码分析GoClaude本地部署文本生成多语言翻译文档摘要

支持客户端

Claude DesktopClaudeClineVS Code

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP