Metadata-Version: 2.4
Name: agent-runtime-sdk
Version: 0.1.0
Summary: Single-agent runtime SDK for A2A agents backed by MCP tools.
Project-URL: Homepage, https://pypi.org/project/agent-runtime-sdk/
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: a2a-sdk==0.3.22
Requires-Dist: smolagents[mcp]
Requires-Dist: openai
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: httpx
Requires-Dist: jinja2
Requires-Dist: pyyaml
Requires-Dist: loguru
Requires-Dist: pydantic
Requires-Dist: rich
Provides-Extra: observability
Requires-Dist: langfuse; extra == "observability"
Requires-Dist: openinference-instrumentation-smolagents; extra == "observability"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: twine; extra == "dev"

# agent-runtime-sdk

Single-agent runtime SDK for exposing MCP tools as an A2A-compatible agent service.

## Install

```bash
pip install agent-runtime-sdk
```

Install optional Langfuse/smolagents observability support:

```bash
pip install "agent-runtime-sdk[observability]"
```

## Basic Usage

Create an agent project:

```text
my-agent/
├── agent_app/
│   ├── agent.yaml
│   └── plugin.py
└── main.py
```

Example `main.py`:

```python
from pathlib import Path

from agent_runtime.standalone import build_single_agent_app, run_single_agent_app


app = build_single_agent_app(
    Path(__file__).resolve().parent / "agent_app" / "agent.yaml"
)


if __name__ == "__main__":
    run_single_agent_app(app)
```

Example SDK import:

```python
from agent_runtime import AgentBuilder
```

## Minimal Configuration

Example `agent_app/agent.yaml`:

```yaml
agent:
  agent_id: example-agent
  name: Example Agent
  description: Example A2A agent backed by MCP tools.

runtime:
  public_base_url: ${AGENT_PUBLIC_BASE_URL:-http://127.0.0.1:10020}
  model:
    provider: openai_compatible
    api_base: ${MODEL_SOURCE_API_BASE}
    model_id: ${MODEL_SOURCE_MODEL_ID}
    api_key_env: MODEL_SOURCE_API_KEY

mcps:
  - name: example
    url: ${MCP_EXAMPLE_URL}
    transport: streamable-http
```

Run:

```bash
export MODEL_SOURCE_API_BASE="https://your-model-api.example.com"
export MODEL_SOURCE_MODEL_ID="your-model-id"
export MODEL_SOURCE_API_KEY="your-api-key"
export MCP_EXAMPLE_URL="http://127.0.0.1:8000/mcp"
export AGENT_PUBLIC_BASE_URL="http://127.0.0.1:10020"

python main.py
```

## Langfuse

After installing `agent-runtime-sdk[observability]`, configure:

```bash
export MCP_AGENT_LANGFUSE_ENABLED=true
export LANGFUSE_BASE_URL="http://your-langfuse-host:3000"
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
```

Set `MCP_AGENT_LANGFUSE_ENABLED=false` to disable instrumentation.
