Upsonic is a comprehensive AI agent framework designed to provide reliable and efficient integration with the Model Context Protocol (MCP). It offers a robust set of tools for building, deploying, and managing AI agents with seamless communication between models and external tools. The framework features advanced configuration management, error tracking through Sentry integration, and flexible server deployment options. Upsonic's architecture supports both client and server components, making it ideal for developers looking to create sophisticated AI applications with enhanced capabilities beyond standard LLM interactions.
Upsonic is a powerful AI agent framework that fully supports the Model Context Protocol (MCP), allowing you to build sophisticated AI applications with enhanced capabilities.
You can install Upsonic using pip:
pip install upsonic
For server functionality, you'll need to install the optional dependencies:
pip install "upsonic[server]"
Upsonic provides two main server components:
To run the main server:
from upsonic.server import run_main_server
run_main_server()
To run the tools server:
from upsonic.server import run_tools_server
run_tools_server()
By default, the servers run on localhost with predefined ports, but you can configure these settings as needed.
The client component allows you to interact with AI models through the MCP protocol:
from upsonic import UpsonicClient
client = UpsonicClient()
response = client.call("Your prompt here")
print(response)
Upsonic includes a robust configuration system that allows you to store and retrieve settings:
from upsonic.storage import Storage
# Initialize storage
storage = Storage()
# Set configuration values
storage.set_config("api_key", "your-api-key")
# Retrieve configuration values
api_key = storage.get_config("api_key")
Upsonic integrates with Sentry for error tracking and monitoring:
# Sentry is automatically configured if you provide a DSN
storage.set_config("sentry_dsn", "your-sentry-dsn")
For more advanced scenarios, Upsonic supports custom tool development and integration with various AI models. You can extend the framework by creating your own tools and registering them with the tools server.
If you encounter issues with the server connection, you can check the server status:
import httpx
async def check_status():
async with httpx.AsyncClient() as client:
response = await client.get("http://localhost:8000/status")
return response.json()
For more detailed information and advanced usage scenarios, refer to the official documentation at docs.upsonic.ai.