MCP Connector
Connect to external MCP (Model Context Protocol) servers to give your agents access to additional tools like GitHub, Slack, databases, and more.
MCPServer
mcp.py
from veska import MCPServer
server = MCPServer(
name="github",
command="npx",
args=["-y", "@modelcontextprotocol/server-github"],
env=["GITHUB_TOKEN"], # Auto-reads from .env
)Connecting
connect.py
# Connect — starts the server process and discovers tools
connected = await server.connect()
if connected:
print(f"Connected to {server.name}")
print(f"Available tools: {[t.name for t in server.tools]}")
# Use a discovered tool
result = await server.call_tool("create_issue", {
"repo": "my-org/my-repo",
"title": "Bug fix needed",
"body": "Description of the issue",
})
# Disconnect when done
await server.disconnect()Environment variables
Two ways to pass environment variables:
env.py
# Option 1: List of names — auto-reads from .env file
server = MCPServer(
name="github",
command="npx",
args=["-y", "@modelcontextprotocol/server-github"],
env=["GITHUB_TOKEN", "GITHUB_ORG"],
)
# Option 2: Dict — pass values directly
server = MCPServer(
name="github",
command="npx",
args=["-y", "@modelcontextprotocol/server-github"],
env={"GITHUB_TOKEN": "ghp_xxx", "GITHUB_ORG": "my-org"},
)With Orchestrator
orch.py
orchestrator = Orchestrator(
model="claude-sonnet-4-6",
agents=[dev_agent],
mcp_servers=[
{
"name": "github",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": ["GITHUB_TOKEN"],
},
{
"name": "filesystem",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
},
],
)
# By default these MCP tools stay at orchestrator level.Agent-level MCP
agent.py
agent = Agent(
name="dev",
model="claude-sonnet-4-6",
mcp_servers=[github],
)Share orchestrator MCP with agents
share.py
orchestrator = Orchestrator(
model="claude-sonnet-4-6",
agents=[dev_agent],
mcp_servers=[github],
share_tools_with_agents=True,
)Properties
props.py
server.connected # True if server is running
server.tools # List of Tool instances (auto-discovered)