Skip to content

chtanch/simple-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Agent

A generic chatbot agent with MCP (Model Context Protocol) server integration for extensible tool use.

Features

  • Modular Architecture: Clean separation between LLM clients, MCP integration, and agent logic
  • Multiple LLM Support: Azure OpenAI and Ollama clients using OpenAI SDK
  • MCP Integration: Connect to multiple MCP servers for tool access
  • Streaming Responses: Real-time response streaming with tool calling
  • Extensible: Easy to create specialized agents (WebAgent example included)
  • Secure: Environment-based configuration with no hardcoded secrets

Installation

Prerequisites

  • Python 3.10+
  • uv package manager

Install the package

# Clone the repository
git clone <repository-url>
cd simple-agent

# Install with uv
uv sync

Environment Setup

  1. Copy the example environment file:
cp .env.example .env
  1. Edit .env with your configuration:
# Azure OpenAI Configuration
AZURE_OPENAI_KEY=your_azure_openai_key_here
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_VERSION=2023-12-01-preview
AZURE_OPENAI_MODEL=your-deployment-name

# Ollama Configuration (alternative)
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama2

Examples

Run the included examples:

# Basic agent example with multiple MCP servers and a function tool
python examples/general_agent.py

# Web automation agent demonstration  
python examples/web_agent.py

MCP Server Configuration

Add additional MCP servers in mcp_config.json. Select MCP servers to use when instantiating Agent.

Architecture

simple-agent/
├── src/simple_agent/
│   ├── agents/           # Agent implementations
│   │   └── agent.py      # Core Agent class
│   ├── llm/              # LLM client implementations
│   │   ├── azure_client.py
│   │   └── ollama_client.py
│   └── mcp/              # MCP utilities
│       ├── mcp_manager.py
│       └── research_server.py
├── examples/             # Usage examples
├── mcp_config.json      # MCP server configuration
└── pyproject.toml       # Project configuration

Development

Code formatting and linting

# Format code
ruff format .

# Lint code
ruff check .

# Type checking
mypy src/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages