A sophisticated Go-based MCP (Model Context Protocol) Agent featuring a complete 3-agent orchestrator system that combines intelligent planning, tool execution, and fact-checking validation for enterprise-grade AI workflows. Includes a modern React frontend and comprehensive security scanning.
MCP Agent is a production-ready AI orchestrator that connects to 12+ MCP servers across multiple protocols (HTTP, SSE, stdio) to provide intelligent automation across AWS, GitHub, Kubernetes, databases, monitoring tools, and more. It features both Simple and ReAct agent modes with comprehensive observability and security scanning.
The system implements a complete sequential workflow with three specialized agents:
- Role: Strategic planner that creates comprehensive execution plans
- Purpose: Breaks down complex objectives into executable steps
- Capabilities:
- Multi-step plan generation with dependencies
- MCP server assignment for each step
- Structured output with clear execution instructions
- Adaptive planning based on previous executions
- Role: Operational executor that runs planned steps using MCP tools
- Purpose: Executes plans using real-world tools and APIs
- Capabilities:
- Multi-MCP server integration (AWS, GitHub, Database, Kubernetes, etc.)
- Tool execution with proper error handling
- Result aggregation and formatting
- Large output handling with file generation
- Role: Quality assurance agent that validates execution results
- Purpose: Prevents hallucinations and ensures factual accuracy
- Capabilities:
- Fact-checking against external sources
- Assumption detection and verification
- Confidence scoring and evidence validation
- False positive identification
π― User Request β ποΈ Planning Agent β β‘ Execution Agent β π Validation Agent β π Final Report
β β β β β
Complex Objective β Structured Plan β Tool Execution β Fact-Checking β Validated Results
- 12+ MCP Servers: AWS, GitHub, Kubernetes, Grafana, Slack, Sentry, Database, etc.
- Protocol Detection: Auto-detect HTTP, SSE, stdio protocols
- Connection Caching: 30-minute TTL file-based cache
- Performance: 60-85% faster subsequent connections
- Simple Agent: Direct tool usage without explicit reasoning
- ReAct Agent: Step-by-step reasoning with tool integration
- Conversation End Detection: Smart completion detection
- Multi-turn Conversations: Full conversation history support
- AWS Bedrock: Claude 3 Sonnet, Claude 3 Haiku, Claude 3 Opus
- OpenAI: GPT-4o, GPT-4, GPT-3.5-turbo
- Anthropic: Claude models via API
- OpenRouter: Access to 100+ models
- Smart Fallback: Automatic provider failover
- Langfuse Integration: Complete tracing and monitoring
- Event Architecture: Structured event emission system
- Performance Metrics: Real-time performance monitoring
- Debug Logging: Comprehensive logging infrastructure
- Gitleaks Integration: Automated secret scanning
- Pre-commit Hooks: Prevent secret leaks before commits
- GitHub Actions: Continuous security monitoring
- Dependency Scanning: Automated vulnerability detection
- React 19: Latest React with modern hooks
- TypeScript: Full type safety
- Tailwind CSS: Modern, responsive design
- Real-time Updates: Live agent interaction
- Event Streaming: Real-time event monitoring
- AWS Services: Complete AWS ecosystem (EC2, S3, IAM, CloudWatch, etc.)
- GitHub Integration: Repository analysis, security alerts, code review
- Database Security: Multi-database security assessment and monitoring
- Kubernetes: Cluster security, pod analysis, RBAC review
- Grafana: Monitoring and alerting integration
- Sentry: Error tracking and performance monitoring
- Slack: Team communication and notifications
- Profiler: Performance analysis and optimization
- Scripts: Custom script execution and automation
- Filesystem: Local file operations and management
- Memory: Vector database and knowledge management
- Planner: Intelligent task planning and execution
- Go 1.24.4+
- Node.js 20+
- Docker & Docker Compose (optional)
git clone https://github.com/manishiitg/mcp-agent-builder-go.git
cd mcp-agent-builder-go
# Copy environment template
cp agent_go/env.example agent_go/.env
# Edit with your API keys
nano agent_go/.env
Required Environment Variables:
# OpenAI
OPENAI_API_KEY=your_openai_key
# AWS Bedrock (optional)
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
# Langfuse (optional)
LANGFUSE_PUBLIC_KEY=your_public_key
LANGFUSE_SECRET_KEY=your_secret_key
TRACING_PROVIDER=langfuse
# Start all services
docker-compose up -d
# Access the application
open http://localhost:5173 # Frontend
open http://localhost:8000 # API
# Build Go agent
cd agent_go
go build -o ../bin/orchestrator .
# Install frontend dependencies
cd ../frontend
npm install
# Start services
npm run dev & # Frontend on :5173
../bin/orchestrator server & # API on :8000
# Test with AWS cost analysis
cd agent_go
../bin/orchestrator test agent --comprehensive-aws --provider bedrock
# Test all MCP servers
../bin/orchestrator test aws-test --config configs/mcp_server_actual.json
# Direct tool usage without explicit reasoning
../bin/orchestrator agent --simple --provider bedrock --query "What's the status of my AWS EC2 instances?"
# Step-by-step reasoning with tool integration
../bin/orchestrator agent --react --provider openai --query "Analyze my GitHub repository for security vulnerabilities and provide recommendations"
# Complete planning β execution β validation workflow
../bin/orchestrator orchestrator --query "Create a comprehensive security assessment of my AWS infrastructure"
The external package provides a clean Go API for integrating the MCP agent into your applications. See the External Package Documentation for detailed usage examples.
Edit agent_go/configs/mcp_server_actual.json
to configure your MCP servers. See the Configuration Guide for detailed examples.
The agent supports flexible configuration through the external package. See the External Package Documentation for detailed configuration options and examples.
# Test all MCP servers
../bin/orchestrator test aws-test --config configs/mcp_server_actual.json
# Test agent modes
../bin/orchestrator test agent --simple --provider bedrock
../bin/orchestrator test agent --react --provider openai
# Test external SSE servers
./test_external_sse.sh
# Test complex AWS cost analysis
./test_single_observer.sh
./test_polling_api.sh
# Run gitleaks scan
./scripts/scan-secrets.sh
# Test pre-commit hook
git add .
git commit -m "Test commit"
- Gitleaks Integration: Pre-commit hooks prevent secret leaks
- GitHub Actions: Continuous security monitoring
- Custom Rules: Project-specific secret detection patterns
- False Positive Handling: Optimized for Go and Node.js projects
- NPM Audit: Frontend dependency vulnerability scanning
- Go Vulnerability Check: Backend dependency scanning
- Dependabot: Automated security updates
- SARIF Reporting: GitHub Security tab integration
- Responsible Disclosure: Clear security reporting process
- Issue Templates: Structured security vulnerability reporting
- Pull Request Templates: Security checklist integration
- Complete Tracing: All agent activities traced
- Token Usage: Accurate cost monitoring
- Performance Metrics: Real-time performance monitoring
- Dashboard Access: https://us.cloud.langfuse.com
- System Events:
system_prompt
,user_message
- LLM Events:
llm_generation_start
,llm_generation_end
,token_usage
- Tool Events:
tool_call_start
,tool_call_end
,tool_call_error
- Completion Events:
conversation_end
,agent_end
# Start all services
docker-compose up -d
# Services included:
# - Frontend (React): http://localhost:5173
# - API (Go): http://localhost:8000
# - Planner API: http://localhost:8081
# - Qdrant Vector DB: http://localhost:6333
# Build Go agent
docker build -t mcp-agent ./agent_go
# Build frontend
docker build -t mcp-frontend ./frontend
# Build planner
docker build -t mcp-planner ./planner
mcp-agent-builder-go/
βββ agent_go/ # Go-based MCP Agent
β βββ pkg/
β β βββ mcpagent/ # Core agent implementation
β β βββ mcpclient/ # MCP client layer
β β βββ external/ # External package API
β βββ cmd/ # CLI commands
β βββ configs/ # MCP server configurations
β βββ internal/ # Internal packages
βββ frontend/ # React frontend
β βββ src/ # React components
β βββ public/ # Static assets
βββ planner/ # Planning agent
βββ memory/ # Memory/vector database
βββ scripts/ # Utility scripts
βββ .github/workflows/ # GitHub Actions
βββ docker-compose.yml # Docker services
We welcome contributions! Please see our Contributing Guidelines for details.
# Install pre-commit hooks
./scripts/install-git-hooks.sh
# Run tests
cd agent_go && go test ./...
cd frontend && npm test
# Run security scan
./scripts/scan-secrets.sh
If you discover a security vulnerability, please report it responsibly:
- Public Issues: Use the Security Vulnerability Template
- Private Reporting: See SECURITY.md for private reporting methods
This project is licensed under the MIT License - see the LICENSE file for details.
- MCP Protocol: Built on the Model Context Protocol
- LangChain Go: Powered by LangChain Go
- React: Modern frontend with React 19
- Gitleaks: Security scanning with Gitleaks
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: SECURITY.md
Made with β€οΈ for the AI community