|
| 1 | +# UAgI: Universal Agent Interface powered by MCP |
| 2 | + |
| 3 | +> [!IMPORTANT] |
| 4 | +> This is a work in progress (see [open issues](#-open-issues) below), please contribute and help improve. |
| 5 | +
|
| 6 | +UAgI (Universal Agent Interface) is a powerful agent application that leverages the Model Context Protocol (MCP) to provide a unified interface for interacting with various MCP servers. This application allows you to connect to different data sources and tools through MCP servers, providing a seamless experience for working with external services. |
| 7 | + |
| 8 | +## 🌟 Features |
| 9 | + |
| 10 | +- **Multiple Model Support**: Works with various LLM providers including: |
| 11 | + - OpenAI (o3-mini, gpt-4o, gpt-4.5) |
| 12 | + - Anthropic (claude-3-7-sonnet, claude-3-7-sonnet-thinking) |
| 13 | + - Google (gemini-2.0-flash, gemini-2.0-pro) |
| 14 | + - Groq (llama-3.3-70b-versatile) |
| 15 | + |
| 16 | +- **MCP Server Integration**: Connect to the following MCP servers: |
| 17 | + - GitHub: Access repositories, issues, and more |
| 18 | + - Filesystem: Browse and manipulate files on your local system |
| 19 | + |
| 20 | +- **Knowledge Base**: Built-in knowledge of MCP documentation to help answer questions about the protocol |
| 21 | + |
| 22 | +- **Session Management**: Save and restore chat sessions using SQLite storage |
| 23 | + |
| 24 | +- **Chat History Export**: Export your conversations as markdown files |
| 25 | + |
| 26 | +- **Streamlit UI**: User-friendly interface with customizable settings |
| 27 | + |
| 28 | +## 🐞 Open Issues |
| 29 | + |
| 30 | +- Only works with 1 MCP server at a time |
| 31 | +- Changing MCP servers resets the agent |
| 32 | +- Only supports 2 MCP servers at the moment |
| 33 | +- Chat history is broken |
| 34 | +- MCP Cleanup is not working, so memory leaks are possible |
| 35 | + |
| 36 | +## 🚀 Quick Start |
| 37 | + |
| 38 | +### 1. Environment Setup |
| 39 | + |
| 40 | +Create and activate a virtual environment: |
| 41 | +```bash |
| 42 | +python3 -m venv .venv |
| 43 | +source .venv/bin/activate # On Windows: .venv\Scripts\activate |
| 44 | +``` |
| 45 | + |
| 46 | +### 2. Install Dependencies |
| 47 | + |
| 48 | +```bash |
| 49 | +pip install -r cookbook/examples/apps/mcp_agent/requirements.txt |
| 50 | +``` |
| 51 | + |
| 52 | +### 3. Configure API Keys |
| 53 | + |
| 54 | +Required: |
| 55 | +```bash |
| 56 | +export OPENAI_API_KEY=your_openai_key_here |
| 57 | +``` |
| 58 | + |
| 59 | +Optional (for additional models): |
| 60 | +```bash |
| 61 | +export ANTHROPIC_API_KEY=your_anthropic_key_here |
| 62 | +export GOOGLE_API_KEY=your_google_key_here |
| 63 | +export GROQ_API_KEY=your_groq_key_here |
| 64 | +``` |
| 65 | + |
| 66 | +For GitHub MCP server: |
| 67 | +```bash |
| 68 | +export GITHUB_TOKEN=your_github_token_here |
| 69 | +``` |
| 70 | + |
| 71 | +### 4. Launch the Application |
| 72 | + |
| 73 | +```bash |
| 74 | +streamlit run cookbook/examples/apps/mcp_agent/app.py |
| 75 | +``` |
| 76 | + |
| 77 | +Visit [localhost:8501](http://localhost:8501) to access the UAgI application. |
| 78 | + |
| 79 | +## 🔧 How It Works |
| 80 | + |
| 81 | +UAgI connects to MCP servers using the Model Context Protocol, which standardizes how applications provide context to LLMs. When you ask a question: |
| 82 | + |
| 83 | +1. The agent analyzes your request and determines which MCP tools might be helpful |
| 84 | +2. It connects to the appropriate MCP server (GitHub, Filesystem, etc.) |
| 85 | +3. The agent executes the necessary tools through the MCP server |
| 86 | +4. Results are processed and returned in a natural language response |
| 87 | +5. All interactions are saved in your session history |
| 88 | + |
| 89 | +## 📚 Understanding MCP |
| 90 | + |
| 91 | +The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications - it provides a standardized way to connect AI models to different data sources and tools. |
| 92 | + |
| 93 | +MCP helps you build agents and complex workflows on top of LLMs by providing: |
| 94 | +- A growing list of pre-built integrations that your LLM can directly plug into |
| 95 | +- The flexibility to switch between LLM providers and vendors |
| 96 | +- Best practices for securing your data within your infrastructure |
| 97 | + |
| 98 | +## 🛠️ Customization |
| 99 | + |
| 100 | +### Adding New MCP Servers |
| 101 | + |
| 102 | +The application is designed to be extensible. To add new MCP servers: |
| 103 | + |
| 104 | +1. Update the `get_mcp_server_config()` function in `utils.py` |
| 105 | +2. Add server-specific example inputs in the `example_inputs()` function |
| 106 | + |
| 107 | +### Modifying Agent Behavior |
| 108 | + |
| 109 | +The agent configuration is in `agents.py`: |
| 110 | +- Adjust the agent description and instructions to change its behavior |
| 111 | +- Modify the knowledge base to include additional documentation |
| 112 | +- Add new tools or capabilities as needed |
| 113 | + |
| 114 | +## 📚 Documentation |
| 115 | + |
| 116 | +For more detailed information: |
| 117 | +- [Agno Documentation](https://docs.agno.com) |
| 118 | +- [Streamlit Documentation](https://docs.streamlit.io) |
| 119 | + |
| 120 | +## 🤝 Support |
| 121 | + |
| 122 | +Need help? Join our [Discord community](https://agno.link/discord) |
0 commit comments