MCP Agent System
A comprehensive multi-agent system for enterprise automation and intelligence, featuring basic agents for simple tasks and sophisticated enterprise-level agents for complex business automation.
✅ What's New (Current Version)
- Stronger agentic prompts across the stack (directive tone, JSON-only outputs, explicit schemas)
- NO FALLBACK policy enforced for LLM calls and workflows (fail fast on misconfiguration)
- External MCP server integration via environment variables (OpenAPI, Oracle, Alpaca, Finnhub, Polygon, EDGAR, CoinStats, etc.)
- Financial LangGraph workflow with multi-node pipeline (collector → analyzer → strategist → portfolio → trader → auditor)
- Concurrent MCP calls for batch ticker processing
- Strict output validation for goal setting and investment plans
📁 Project Structure
srcs/
├── common/ # 🔧 Common modules and shared resources
│ ├── __init__.py # Unified module entry point
│ ├── imports.py # Standardized imports and dependencies
│ ├── config.py # Shared configurations and constants
│ ├── utils.py # Common utility functions
│ └── templates.py # Agent base templates and patterns
├── basic_agents/ # Simple, lightweight agents
│ ├── basic.py # Basic functionality and testing
│ ├── agent.py # Base Agent class
│ ├── swarm.py # Multi-agent coordination
│ ├── workflow_orchestration.py # Workflow management
│ ├── researcher.py # Research and information gathering
│ ├── researcher_v2.py # Enhanced research agent (using common modules)
│ ├── parallel.py # Parallel processing demonstration
│ ├── streamlit_agent.py # Web interface agent
│ ├── data_generator.py # Data generation and synthesis
│ ├── enhanced_data_generator.py # Advanced data generation
│ └── rag_agent.py # Retrieval-Augmented Generation
├── enterprise_agents/ # Sophisticated business automation
│ ├── mental.py # Mental model analysis
│ ├── hr_recruitment_agent.py # HR & Talent Acquisition
│ ├── legal_compliance_agent.py # Legal & Regulatory Compliance
│ ├── cybersecurity_infrastructure_agent.py # Security & Threat Detection
│ ├── supply_chain_orchestrator_agent.py # Supply Chain Optimization
│ ├── customer_lifetime_value_agent.py # Customer Experience & CLV
│ ├── esg_carbon_neutral_agent.py # ESG & Sustainability
│ ├── hybrid_workplace_optimizer_agent.py # Workplace Optimization
│ └── product_innovation_accelerator_agent.py # Innovation & Development
├── utils/ # Additional utilities
│ └── mental_visualization.py # Interactive visualization
├── run_agent.py # Unified execution script
└── COMMON_MODULES.md # Common modules usage guide
Additional Modules
lang_graph/
└── financial_agent/
├── agents/
│ ├── auditor.py
│ ├── chief_strategist.py
│ ├── data_collector.py
│ ├── news_analyzer.py
│ ├── news_collector.py
│ ├── portfolio_manager.py
│ ├── sync_node.py
│ └── trader.py
├── financial_mcp_server.py # MCP tools for technical indicators/news via yfinance
├── graph.py # LangGraph workflow (includes entrypoint)
├── llm_client.py # Gemini LLM client (NO FALLBACK)
├── mcp_client.py # Parallel MCP tool invocation utilities
├── external_mcp.py # Note: Automation service uses its own external MCP registrar
└── state.py # Type definitions and state schema
srcs/
└── multi_agent_automation_service/
├── orchestrator.py # Multi-agent orchestration (auto-register external MCP servers)
├── gemini_executor.py # Gemini CLI executor (agentic, MCP-based)
├── external_mcp.py # Env-var driven registrar for external MCP servers
└── agents/ ... # code review/documentation/performance/security/K8s agents
srcs/
└── goal_setter_agent/
└── goal_setter.py # Decomposes high-level goals into a JSON plan (strict schema + validation)
🚀 Installation
-
Clone the repository
-
Install dependencies:
pip install -r requirements.txt -
Configure API keys:
- Create
mcp_agent.secrets.yamlfile in thesrcsdirectory - Add your API keys for OpenAI and Google:
openai: api_key: your-openai-api-key google: api_key: your-google-api-key
- Create
-
Optional: Gemini (for financial_agent) and External MCP servers
-
Environment variables (examples):
# LLM export GEMINI_API_KEY="your-gemini-api-key" export GEMINI_MODEL="gemini-2.5-flash-lite-preview-0607" # External MCP servers (OpenAPI wrapper, Oracle, Brokers, Market Data, Filings, Crypto) export OPENAPI_MCP_CMD=node export OPENAPI_MCP_ARGS="/opt/mcp/openapi-server.js --spec /opt/specs/polygon.yaml --apiKey $POLYGON_API_KEY" export ORACLE_MCP_CMD=python export ORACLE_MCP_ARGS="/opt/mcp/oracle_mcp_server.py --tns $TNS --user $DB_USER --pass $DB_PASS" export ALPACA_MCP_CMD=node export ALPACA_MCP_ARGS="/opt/mcp/openapi-server.js --spec /opt/specs/alpaca.yaml --apiKey $ALPACA_KEY --secret $ALPACA_SECRET" export FINNHUB_MCP_CMD=node export FINNHUB_MCP_ARGS="/opt/mcp/openapi-server.js --spec /opt/specs/finnhub.yaml --apiKey $FINNHUB_KEY" export POLYGON_MCP_CMD=node export POLYGON_MCP_ARGS="/opt/mcp/openapi-server.js --spec /opt/specs/polygon.yaml --apiKey $POLYGON_API_KEY" export EDGAR_MCP_CMD=node export EDGAR_MCP_ARGS="/opt/mcp/openapi-server.js --spec /opt/specs/secapi.yaml --apiKey $SEC_API_KEY" export COINSTATS_MCP_CMD=node export COINSTATS_MCP_ARGS="/opt/mcp/openapi-server.js --spec /opt/specs/coinstats.yaml --apiKey $COINSTATS_API_KEY" -
Optional per-server settings:
<NAME>_MCP_TIMEOUT_MS(default: 30000)<NAME>_MCP_TRUST(true|false, default: true)<NAME>_MCP_ENV_JSON(JSON string for additional env)
-
🎯 Running Agents
Using the Unified Runner (Recommended)
Navigate to the srcs directory and use the unified runner:
cd srcs
# List all available agents
python run_agent.py --list
# Run basic agents
python run_agent.py --basic researcher
python run_agent.py --basic researcher_v2 # Enhanced with common modules
python run_agent.py --basic data_generator
python run_agent.py --basic rag
# Run enterprise agents
python run_agent.py --enterprise supply_chain
python run_agent.py --enterprise customer_clv
python run_agent.py --enterprise workplace
python run_agent.py --enterprise personal_finance
# Run utilities
python run_agent.py --utility mental
python run_agent.py --utility swarm
# Development examples
python run_agent.py --dev common_demo # Common modules demo
python run_agent.py --dev template_basic # Basic agent template
python run_agent.py --dev template_enterprise # Enterprise agent template
Financial Agent Workflow (LangGraph)
# Run the LangGraph workflow (prints summary to stdout)
python lang_graph/financial_agent/graph.py
# Start the financial MCP server (technical indicators & news via yfinance)
python lang_graph/financial_agent/financial_mcp_server.py
- Workflow nodes: market_data_collector → news_collector → sync → news_analyzer (LLM) → chief_strategist (LLM) → portfolio_manager (LLM) → trader → auditor
- Prompts are agentic, JSON-only where required; NO FALLBACK in LLM client (
llm_client.py). - External sources can be added via environment-driven MCP servers (registered automatically in the automation service; financial graph uses its own
mcp_client).
Direct Execution
You can also run agents directly:
cd srcs
# Basic agents
python basic_agents/researcher.py
python basic_agents/researcher_v2.py # New enhanced version
python basic_agents/data_generator.py
# Enterprise agents
python enterprise_agents/supply_chain_orchestrator_agent.py
python enterprise_agents/customer_lifetime_value_agent.py
# Utilities
python enterprise_agents/mental.py
Multi-Agent Automation Service
# Full automation
python -m srcs.multi_agent_automation_service.main --workflow full --target srcs
# Kubernetes workflow
python -m srcs.multi_agent_automation_service.main --workflow kubernetes --app-name myapp --config-path k8s/
# Single agent
python -m srcs.multi_agent_automation_service.main --agent code_review --target srcs
- On start, the service will auto-register external MCP servers present in env (
openapi,oracle,alpaca,finnhub,polygon,edgar,coinstats). gemini_executor.pyexecutes Gemini CLI tasks through MCP tools; instructions are strict and agentic.- All MCP calls use concurrency where applicable.
Goal Setter Agent
python -m srcs.goal_setter_agent.goal_setter --goal "Improve conversion rate of new SaaS feature by 20%"
- Output is a strict JSON plan (Korean text allowed) with SMART sub-goals, KPIs (name/metric/target/data_source), actions (agent, due_days, acceptance_criteria), risks, and overall_success_criteria.
- A validator enforces schema and domain constraints; invalid outputs raise errors (no fallback).
🔧 Common Modules System
The new common modules system provides shared functionality for efficient agent development:
Key Benefits
- 50-70% faster development with standardized templates
- Code reusability and consistency across all agents
- Standardized patterns for imports, configuration, and utilities
- Quality assurance with built-in best practices
Quick Start with Templates
Create a new basic agent:
from common import BasicAgentTemplate
class MyAgent(BasicAgentTemplate):
def __init__(self):
super().__init__(
agent_name="my_agent",
task_description="Your agent's task description"
)
Create a new enterprise agent:
from common import EnterpriseAgentTemplate
class MyEnterpriseAgent(EnterpriseAgentTemplate):
def __init__(self):
super().__init__(
agent_name="my_enterprise_agent",
business_scope="Global Operations"
)
See COMMON_MODULES.md for comprehensive usage guide and examples.
📝 Available Agents
Basic Agents
- researcher - Research and information gathering
- researcher_v2 - Enhanced research agent using common modules
- basic - Basic functionality and testing
- parallel - Parallel processing demonstration
- swarm - Multi-agent swarm coordination
- streamlit - Web interface agent
- workflow - Workflow orchestration and management
- data_generator - Data generation and synthesis
- enhanced_data_generator - Advanced data generation with ML
- rag - Retrieval-Augmented Generation
Enterprise Agents
- hr_recruitment - HR recruitment and talent acquisition automation
- mental - Mental model analysis and visualization
- legal_compliance - Legal compliance and contract analysis
- cybersecurity - Cybersecurity infrastructure and threat detection
- supply_chain - Supply chain orchestration and optimization
- customer_clv - Customer lifetime value and experience optimization
- esg_carbon - ESG and carbon neutrality management
- workplace - Hybrid workplace optimization and management
- innovation - Product innovation acceleration and development
- personal_finance - Personal finance health diagnosis & auto investment (Korean market)
Utilities
- mental_viz - Mental model interactive visualization
Advanced Agents
- decision_agent - 🤖 Mobile interaction-based automatic decision system
- architect - AI architecture design and optimization
Development Tools
- common_demo - Common modules demonstration
- template_basic - Basic agent template example
- template_enterprise - Enterprise agent template example
💼 Enterprise Features
The enterprise agents provide comprehensive business automation with:
- ROI-Focused Solutions: Each agent targets 200-600% ROI through measurable improvements
- Industry Standards: Compliance with frameworks like GDPR, SOX, HIPAA, SASB, GRI
- Scalable Architecture: Multi-agent orchestration with quality control systems
- Real-time Analytics: Performance monitoring and continuous optimization
- Integration Ready: API-first design for enterprise system integration
🔒 Security & Compliance Posture
- NO FALLBACK policy: Misconfigured API keys or LLM failures raise explicit errors instead of returning placeholder data.
- External MCP servers are configured via explicit env vars; trust/timeouts can be tuned per server.
- Audit trail: Financial workflow writes a daily report via
auditor.py. - Secrets via environment variables or dedicated secret files; do not hardcode keys.
⚙️ Configuration Quick Reference
- LLM
OPENAI_API_KEY(for OpenAI-based components)GEMINI_API_KEY,GEMINI_MODEL(for Gemini-based components)
- Financial MCP Server (built-in)
- Run with
python lang_graph/financial_agent/financial_mcp_server.py
- Run with
- External MCP (automation service auto-registers)
<NAME>_MCP_CMD,<NAME>_MCP_ARGSrequired- Optional:
<NAME>_MCP_TIMEOUT_MS,<NAME>_MCP_TRUST,<NAME>_MCP_ENV_JSON
🔧 Requirements
- Python 3.8+
- Docker (for Python interpreter functionality)
- OpenAI API key
- Google API key (optional, for enhanced search capabilities)
🤖 Decision Agent - Revolutionary Mobile Decision System
The Decision Agent represents a breakthrough in personal AI assistance, offering unprecedented intervention capabilities in daily mobile interactions:
🎯 Core Capabilities
- Real-time Mobile Monitoring: 24/7 detection of all mobile interactions (purchases, calls, messages, bookings)
- Context-Aware Analysis: Deep understanding of user situation, preferences, and constraints
- Intelligent Intervention: Smart threshold-based decision on when to intervene
- Personalized Recommendations: Tailored decisions based on individual user profiles and goals
- Automated Execution: High-confidence decisions can be executed automatically
- Continuous Learning: Improves decision quality through user feedback
🚀 Key Features
- Multi-App Integration: Works across shopping, food delivery, booking, communication apps
- Risk Assessment: Evaluates financial, health, and opportunity risks for each decision
- Alternative Analysis: Provides multiple options with pros/cons analysis
- Budget Management: Real-time budget tracking with spending optimization
- Mood-Aware: Adapts recommendations based on detected user emotional state
- Time-Sensitive: Prioritizes urgent decisions with appropriate response times
💡 Use Cases
- Smart Shopping: Prevents impulse purchases, finds better deals, suggests alternatives
- Health Optimization: Guides food choices based on health goals and dietary preferences
- Financial Management: Optimizes spending patterns and investment decisions
- Time Management: Helps prioritize calls, messages, and meetings
- Travel Planning: Optimizes booking decisions for cost and convenience
🔧 Technical Architecture
# Example Decision Agent Usage
from srcs.advanced_agents.decision_agent import DecisionAgent
agent = DecisionAgent(anthropic_api_key="your-key")
await agent.start_monitoring("user_id")
# Agent automatically intervenes when significant decisions are detected
# Provides real-time recommendations through push notifications
📊 Demo Results
- 89.5% Decision Accuracy: High-quality recommendations validated by user feedback
- 76.8% User Acceptance Rate: Users follow agent recommendations majority of time
- 1.2s Average Response Time: Near-instantaneous decision generation
- $500+ Monthly Savings: Average cost savings through optimized decisions
🎮 Try It Now
# Run interactive demo
python srcs/advanced_agents/decision_agent_demo.py
# Or use the web interface
streamlit run main.py
# Navigate to "🤖 Decision Agent" page
📊 Business Impact
Enterprise agents deliver measurable business value:
- Supply Chain: 15-30% cost reduction, 25-40% delivery improvement
- Customer CLV: 25-40% retention improvement, 10-25% CLV increase
- ESG Management: Carbon neutrality achievement, 40-60% ESG rating improvement
- Workplace Optimization: 30-50% productivity improvement, 25-40% cost reduction
- Innovation Acceleration: 40-60% time-to-market reduction, 50-75% success rate improvement
- 🤖 Decision Agent: $500+ monthly savings per user, 25% reduction in poor decisions
🚀 Development with Common Modules
The common modules system enables rapid agent development:
- Choose Template: Select
BasicAgentTemplateorEnterpriseAgentTemplate - Import Common: Use
from common import *for all dependencies - Implement Methods: Override required methods for your specific logic
- Run and Test: Use the unified runner for execution and testing
Example development workflow:
# Explore common modules
python run_agent.py --dev common_demo
# See template examples
python run_agent.py --dev template_basic
# Test existing enhanced agent
python run_agent.py --basic researcher_v2
# Create your own agent using the patterns
For detailed documentation on individual agents and their capabilities, refer to the agent-specific files and COMMON_MODULES.md for development guidelines.
MCP Agent Hub - Agent UI
Directory Structure
mcp_agent/
├── main.py # Streamlit main app
├── pages/ # Streamlit pages
│ ├── business_strategy.py
│ ├── seo_doctor.py
│ ├── finance_health.py
│ ├── cybersecurity.py
│ ├── data_generator.py
│ ├── hr_recruitment.py
│ ├── ai_architect.py
│ ├── decision_agent.py
│ ├── travel_scout.py
│ ├── workflow.py
│ ├── research.py
│ └── rag_agent.py
├── srcs/ # source code
│ ├── ... # agent code
│ └── ... # ...
└── configs/ # configuration
How to Run
Run the main app
streamlit run main.py
Run specific agent pages
# Business strategy agent
cd srcs/business_strategy_agents
streamlit run streamlit_app.py
# SEO Doctor
cd srcs/seo_doctor
streamlit run seo_doctor_app.py
Roadmap
- Mobile UI optimization (responsive design)
- Dark mode improvements
- Performance optimization (loading time)
- Full integration with production agents
- User authentication and personalization
Development Guidelines
- Prefer common modules for new features
- Maintain consistency with existing patterns and style guides
- Robust error handling; avoid fallbacks that mask failures
- Keep docs up-to-date with feature changes
- Test across environments
AI CLI Tools
1. Gemini CLI
Overview: Google’s AI development CLI to interact with Gemini models for code generation, debugging, and docs. Reference: Gemini CLI
Install:
npx https://github.com/google-gemini/gemini-cli
Key features:
- Code generation and debugging
- File I/O
- Web/search integration
- System command execution
Example:
gemini > Write Python code using turtle to draw a blue circle with radius 100.
2. Claude CLI
Overview: Anthropic’s AI CLI for code generation/refactoring/testing via natural language.
Install:
npm install -g @anthropic/claude-cli
Key features:
- Natural language code generation/modification
- Code quality and style checks
- Test generation
Example:
claude > Refactor the following JavaScript function to improve readability.
3. Cursor CLI
Overview: Cursor editor’s CLI for code changes, review, and generation. Reference: Cursor CLI
Install:
curl https://cursor.com/install -fsS | bash
Key features:
- Review/apply code changes
- Real-time agent directives
- Custom rule configuration
Example:
cursor > Review agent edits
