Observed since 20 Oct, 20:24 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AEnvironment Python SDK - Production-grade environment for AI agent tools
A production-grade Python SDK for managing AI agent tools in containerized environments with MCP protocol support.
aenv/ ├── pyproject.toml ├── src/ │ └── cli/ │ ├── init.py │ ├── cmds/ │ │ ├── init.py │ │ └── cli.py │ └── env/ │ ├── init.py │ └── another_file.py └── README.md
pip install aenvironment
Create a Python file with your tools:
# my_tools.py
from aenv import register_tool
@register_tool
def get_weather(location: str, unit: str = "celsius") -> dict:
"""Get weather for a location."""
return {"location": location, "temperature": 22.5, "unit": unit}
@register_tool
async def search_web(query: str, max_results: int = 10) -> list:
"""Search the web."""
return [{"title": f"Result for {query}", "url": "https://example.com"}]
Start an MCP server with your tools using FastMCP:
# Start MCP server on http://localhost:8081
python main.py ./my_tools.py
# Start with custom host and port
python main.py ./my_tools.py --host 0.0.0.0 --port 8080
# Start with tools from directory
python main.py ./tools/
# Start with custom server name
python main.py ./tools/ --name my-server
import asyncio
import Environment
async def main():
# Create environment
async with Environment("my-env") as environment:
# List available tools
tools = environment.list_tools()
print("Available tools:", tools)
# Call a tool
result = await environment.call_tool(
"my-env/get_weather",
{"location": "Beijing", "unit": "celsius"}
)
print("Weather:", result.content)
asyncio.run(main())
aenv/
├── core/ # Core SDK components
├── server/ # FastMCP server implementation
├── client/ # API client for backend
└── examples/ # Usage examples
Tools are defined using the @register_tool decorator:
from aenv import register_tool
from typing import Dict, Any
@register_tool
def my_tool(
param1: str,
param2: int = 42,
param3: bool = False
) -> Dict[str, Any]:
"""
Tool description for LLMs.
Args:
param1: Description of param1
param2: Description of param2 (default: 42)
param3: Description of param3
Returns:
Dictionary with results
"""
return {"result": f"Processed {param1} with {param2}"}
from aenv import Environment
# Create environment
env = Environment("my-env", scheduler_url="http://localhost:8080")
await env.initialize()
# Use as context manager
async with Environment("my-env") as env:
tools = env.list_tools()
result = await env.call_tool("tool_name", {"arg": "value"})
Environment variables:
AENV_SCHEDULER_URL: Default scheduler URLAENV_API_KEY: API key for authenticationAENV_TIMEOUT: Default timeout in secondsThe SDK provides comprehensive error handling:
from env.core import (
ToolError, ToolTimeoutError, EnvironmentError, NetworkError
)
try:
result = await env.call_tool("tool_name", {"arg": "value"})
except ToolTimeoutError as e:
print(f"Tool timed out: {e.timeout}s")
except ToolError as e:
print(f"Tool failed: {e.message}")
except EnvironmentError as e:
print(f"Environment error: {e.message}")
Run tests:
pip install -e ".[dev]"
pytest tests/
See the examples/ directory for complete examples:
weather_tools.py: Weather-related toolssearch_tools.py: Web search and analysis toolsgit clone https://github.com/inclusionAI/AEnvironment
cd AEnvironment
pip install -e ".[dev]"
pytest tests/ -v
black aenv/
isort aenv/
mypy aenv/
MIT License - see LICENSE file for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.7 | 21 May 2026 | 26 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 20:24 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:0329275e547e5457c25fa973df7270d4ae578ba80343a44d6dd24c911d72e4ca