Thin, stdlib-only client + CLI for the NatureLM-Idun-5-MoE agent on Azure AI Foundry.
No httpx, no azure-identity, no Flask — it runs headless on Termux/Android with
nothing but the Python standard library. Idun is a tool agent (it reasons and
calls tools like web_search); this SDK surfaces the full agent trajectory
(reasoning steps + tool calls) instead of a black-box answer.
pip install idun-sdkInstalls the idun CLI, the idun Python package, and the stdlib MCP server
idun_mcp.py.
idun login # device-code flow, token saved to ~/foundry_token.txtNo admin role required — idun login returns a plain Entra bearer token for
the Foundry endpoint. Any tenant user with agent access (RBAC) can run it; admin
rights are only needed to configure the agent, not to use it. The token
auto-rotates before expiry.
# final answer only
idun chat "Summarize Contoso's sustainability communications in one sentence."
# full agent trajectory (reasoning + tool steps)
idun trace "Use web_search to find the current CEO of Contoso."from idun import IdunClient
res = IdunClient().complete("Your prompt here")
print(res.text) # final answer
for s in res.steps: # agent trajectory
print(s.kind, s.tool, s.query, s.status)| Command | Purpose |
|---|---|
idun chat |
final answer only |
idun trace |
full trajectory (steps + text) |
idun export |
trajectory as JSON / Markdown |
idun packs / idun run |
curated prompt packs (e.g. Contoso) |
idun diff |
side-by-side trace diff of two prompts |
idun token |
inspect / refresh the Foundry token |
idun logo |
print the Foundry logo |
idun_mcp.py is a zero-dependency stdio MCP server (no FastMCP / httpx):
python3 idun_mcp.pyExposes idun_chat(prompt) and idun_trace(prompt). Add to any MCP client:
{ "mcpServers": { "idun": { "command": "python3", "args": ["/abs/path/idun-sdk/idun_mcp.py"] } } }Docs mirror (GitMCP): https://gitmcp.io/qapdex-maker/idun-sdk/sse
Idun pairs well with Sentry's MCP server so an agent can both call Idun and inspect Sentry errors/traces. Sentry MCP is a separate, optional provider — the Idun SDK stays stdlib-only.
Remote (zero-setup, OAuth — note the /mcp suffix):
{ "mcpServers": { "sentry": { "url": "https://mcp.sentry.dev/mcp" } } }Stdio (OAuth via mcp-remote, no static token needed):
{ "mcpServers": { "sentry": { "command": "npx", "args": ["-y", "mcp-remote@latest", "https://mcp.sentry.dev/mcp"] } } }Authenticate once (opens a browser for the OAuth flow):
/mcp auth sentry
Recommended combo for a foreign agent: idun (calls the agent) + idun-docs
(reads the SDK docs) + sentry (queries error tracking). The agent can invoke
Idun and, when a call fails, pull the correlated Sentry issue on its own.
POST {base}/api/projects/{project}/agents/{agent}/endpoint/protocols/openai/responses?api-version=2025-05-15-preview
Authorization: Bearer ***
{"model": "model-router", "input": "<prompt>", "max_output_tokens": 4096}
modelMUST be"model-router"(agent id is in the URL).- Do not send a
toolskey — the agent owns its tools (else400 invalid_payload).