A multi-agent system based on MCP (Model Context Protocol) architecture, supporting registration and invocation of multiple AI tools with high scalability and observability.
- Project Overview
- Core Features
- Technical Architecture
- Quick Start
- Feature Modules
- API Documentation
- Deployment Guide
- Development Guide
- Contributing
GoMcp is an intelligent LLM tool service platform built on the MCP protocol, designed to provide unified multi-agent tool management and invocation services. The project is developed in Go and supports integration of various AI tools including LLM Q&A, document parsing, code review, vector search, and more.
- π Plugin Architecture: Supports dynamic tool registration and extension
- π High Performance: Built with Go, response time β€ 1s
- π Observability: Integrated OpenTelemetry for distributed tracing
- π³ Containerized Deployment: Supports Docker and Kubernetes deployment
- π Vector Database: Integrated TiDB for document embedding and similarity search
- LLM Q&A: Support for Gemini, OpenAI, and other models
- Code Review: Automatic code quality analysis and suggestions
- Document Summarization: Intelligent document content summarization
- RAG Enhancement: Retrieval-Augmented Generation based on documents
- Factory Pattern: Unified tool registration and management mechanism
- Auto Discovery: Automatic tool registration and loading
- Configuration Management: Flexible configuration system based on Viper
- Vector Database: TiDB integration for document embedding
- Similarity Search: Efficient vector similarity computation
- Resource Management: Support for multiple document format parsing
- Distributed Tracing: OpenTelemetry integration
- Containerization: Docker support
- CI/CD: Jenkins + ArgoCD + Kubernetes
- Monitoring & Alerting: Complete observability solution
- MCP Server: Protocol communication layer, handling client requests
- Tool Factory: Tool registration factory, managing all available tools
- LLM Service: Large language model service, supporting multiple AI models
- File Service: File processing service, supporting document parsing
- Vector Service: Vector database service, supporting similarity search
- Config Service: Configuration management service, based on Viper
- Go 1.24.4+
- Docker & Docker Compose
- MySQL/TiDB (optional, for vector database)
-
Download Go 1.24.4+
- Visit Go Official Download Page
- Choose the version suitable for your system:
- Linux:
go1.24.4.linux-amd64.tar.gz - macOS:
go1.24.4.darwin-amd64.tar.gz - Windows:
go1.24.4.windows-amd64.msi
- Linux:
-
Linux/macOS Installation
# Download and extract
wget https://go.dev/dl/go1.24.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.24.4.linux-amd64.tar.gz
# Configure environment variables
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify installation
go version- Windows Installation
- Download the
.msiinstaller - Double-click to run the installer
- Follow the wizard to complete installation
- Open Command Prompt to verify:
go version
- Download the
Ubuntu/Debian:
sudo apt update
sudo apt install golang-goCentOS/RHEL:
sudo yum install golang
# Or use dnf (newer versions)
sudo dnf install golangmacOS (using Homebrew):
brew install go# Install g
curl -sSL https://git.io/g-install | sh -s
# Install specific Go version
g install 1.24.4
# Use specific version
g use 1.24.4# Check Go version
go version
# Check Go environment
go env
# Set GOPROXY (recommended for Chinese users)
go env -w GOPROXY=https://goproxy.cn,direct- Clone the Repository
git clone https://github.com/leebrouse/GoMcp.git
cd GoMcp- Install Dependencies
# install dependence
go mod download
# install mcphost
go install github.com/mark3labs/mcphost@latest
# add your Gemini api key
export GOOGLE_API_KEY='your-api-key'- Configure Environment
cp internal/common/config/mcp.json.example internal/common/config/mcp.json
# Edit configuration file, set API keys, etc.- Start Service
# Using Makefile
make mcphost
# Or run directly
mcphost --config ./internal/common/config/mcp.json -m google:gemini-2.5-flash# Build image
make docker-build
# Start service
docker-compose up -dProvides various AI tool services:
- ChatBox: General conversation service
- CodeReview: Code review service
- Summarize: Document summarization service
Supports multiple file format processing:
- PDF Parsing: Document content extraction
- Text Processing: Text cleaning and preprocessing
- Format Conversion: Support for multiple format conversions
- Configuration Management: Configuration system based on Viper
- Data Models: Unified data structure definitions
- Design Patterns: Implementation of common design patterns
- OpenTelemetry: Observability integration
Implements dynamic tool registration and management:
// Tool registration example
func init() {
factory.RegisterTool("chatbox", &ChatBoxTool{})
factory.RegisterTool("codeReview", &CodeReviewTool{})
}The project provides the following interfaces based on MCP protocol:
Get list of all available tools:
{
"tools": [
{
"name": "chatbox",
"description": "General conversation service",
"inputSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "User input question"
}
}
}
}
]
}Invoke specified tool:
{
"name": "chatbox",
"arguments": {
"prompt": "Hello, please introduce the GoMcp project"
}
}Manage document resources:
{
"resources": [
{
"uri": "file:///path/to/document.pdf",
"name": "Project Documentation",
"description": "GoMcp project documentation"
}
]
}mcpServer:
llm:
serverName: "llm-server"
serverVersion: "v1.0.0"
models:
- name: "gemini-2.5-flash"
provider: "google"
apiKey: "${GEMINI_API_KEY}"
- name: "gpt-4"
provider: "openai"
apiKey: "${OPENAI_API_KEY}"
vector:
database:
type: "tidb"
host: "localhost"
port: 4000
database: "vector_db"- Create Namespace
kubectl create namespace mcp-system- Deploy Application
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml- Configure ConfigMap
kubectl apply -f k8s/configmap.yamlThe project supports complete CI/CD pipeline:
- Code Commit β GitHub/GitLab
- Automated Testing β Jenkins
- Build Image β Docker
- Push Image β Docker Registry
- Auto Deploy β ArgoCD + Kubernetes
GoMcp/
βββ cmd/ # Main program entry
βββ internal/ # Internal packages
β βββ common/ # Common components
β β βββ config/ # Configuration management
β β βββ model/ # Data models
β β βββ opentelemetry/ # Observability
β βββ llm/ # LLM services
β β βββ domain/ # Domain models
β β βββ service/ # Business services
β β βββ handler/ # Request handlers
β β βββ factory/ # Tool factory
β βββ file/ # File services
βββ example/ # Example code
βββ test/ # Test cases
βββ Requirement/ # Requirement documents
βββ images/ # Documentation images
- Implement Tool Interface
type Tool interface {
Name() string
Description() string
Execute(ctx context.Context, args map[string]interface{}) (interface{}, error)
}- Register Tool
func init() {
factory.RegisterTool("myTool", &MyTool{})
}- Write Tests
func TestMyTool(t *testing.T) {
// Test code
}# Run all tests
make test
# Run MCP integration tests
make test-mcp
# Run specific tests
go test -v ./test/llm_function_test/We welcome all forms of contributions!
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Go language coding standards
- Add necessary test cases
- Update relevant documentation
- Ensure CI/CD pipeline passes
This project is licensed under the MIT License - see the LICENSE file for details.
- MCP Protocol - Model Context Protocol
- Mark3Labs - Go MCP implementation
- LangChain Go - Go AI framework
- Viper - Configuration management library
- GORM - Go ORM library
- Author: Leebrouse
- Project URL: https://github.com/leebrouse/GoMcp
- Issue Feedback: GitHub Issues
β If this project helps you, please give us a star!

