from upsonic import Task, Agent
# MCP server with authentication
class AuthenticatedMCP:
command = "npx"
args = ["-y", "@company/private-mcp-server"]
env = {
"API_KEY": "your_api_key_here",
"API_SECRET": "your_api_secret_here",
"AUTH_TOKEN": "bearer_token_here"
}
# Multiple servers with different auth
class GitHubMCP:
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxx"
}
class SlackMCP:
command = "uvx"
args = ["mcp-server-slack"]
env = {
"SLACK_BOT_TOKEN": "xoxb-xxxxx",
"SLACK_TEAM_ID": "T1234567"
}
# Create task with authenticated tools
task = Task(
description="Check GitHub issues and notify the team on Slack",
tools=[GitHubMCP, SlackMCP]
)
# Create agent
agent = Agent(
name="Integration Agent",
model="openai/gpt-4o"
)
# Execute
agent.print_do(task)