Skip to main content

Thin client + CLI for Azure AI Foundry agent NatureLM-Idun-5-MoE

Project description

Idun SDK

Thin, stdlib-only client + CLI for the NatureLM-Idun-5-MoE agent on Azure AI Foundry (codename Idun). No httpx, no azure-identity — it runs headless on Termux/Android with nothing but the Python standard library.

Idun is a tool agent: it reasons and calls tools (web_search, memory_search). This SDK surfaces the full agent trajectory — every reasoning step and tool call — instead of a black-box chatbot wheel, so you can see how it arrived at an answer.

Install

pip install idun-sdk

The idun CLI and the idun Python package (plus the stdlib MCP server idun_mcp.py) are installed.

Authenticate (device-code, Entra)

idun login
# opens https://microsoft.com/devicelogin — enter the printed code,
# sign in with your tenant account (no admin role required).
# Token is saved to ~/foundry_token.txt (FOUNDRY_TOKEN).

No admin role needed. idun login runs a standard Entra device-code flow and returns a plain bearer access token for the Foundry agent endpoint. You do not become a portal admin — you only get an API token that the SDK attaches to each request. Any tenant user granted access to the NatureLM-Idun-5-MoE agent (RBAC on the Foundry resource) can run idun login. Admin rights are only needed to configure or redeploy the agent, not to use it.

The token is a normal Entra FOUNDRY_TOKEN (scope https://ai.azure.com/.default); it auto-rotates before expiry (Phase 2.5).

Use

# final answer only
idun chat "Fasse in einem Satz zusammen, was Contoso im Bereich Nachhaltigkeit kommuniziert."

# full agent trajectory (reasoning + web_search tool steps)
idun trace "Use web_search to find the current CEO of Contoso and report the name."

Python

from idun import IdunClient

res = IdunClient().complete("Your prompt here")
print(res.text)            # final answer
for s in res.steps:        # agent trajectory
    if s.kind == "tool":
        print("TOOL", s.tool, s.status, s.query)
    else:
        print("REASON", s.text[:80])

IdunResult has:

  • text — the final answer
  • steps — list of Step (kind="reasoning"|"tool", plus tool/query/status for tool steps)
  • model — the backing model (e.g. gpt-5.4-2026-03-05)
  • raw — the verbatim Foundry responses payload

Request shape (verified working)

POST {base}/api/projects/{project}/agents/{agent}/endpoint/protocols/openai/responses?api-version=2025-05-15-preview
Authorization: Bearer ***
Content-Type: application/json

{"model": "model-router", "input": "<prompt string>", "max_output_tokens": 4096}

Notes:

  • model MUST be "model-router" (the agent id is already in the URL).
  • Do not send a tools key — the agent owns its capabilities; doing so returns 400 invalid_payload.
  • The answer is in output[].content[].text; tool calls appear as web_search_call items with action.queries and status.

MCP — agent + docs

Idun is available as an MCP server and has a GitMCP docs mirror, so other agents can both call Idun and read its documentation without hallucinating.

1. Idun MCP server (stdlib-only, local)

idun_mcp.py is a zero-dependency stdio MCP server — no FastMCP / httpx needed (runs on bare Python, ideal for Termux/Android).

python3 idun_mcp.py        # stdio MCP server

Tools exposed:

  • idun_chat(prompt) — final answer text
  • idun_trace(prompt) — full agent trajectory (steps + text)

Add to any MCP client (e.g. Cursor ~/.cursor/mcp.json):

{
  "mcpServers": {
    "idun": { "command": "python3", "args": ["/abs/path/idun-sdk/idun_mcp.py"] }
  }
}

2. GitMCP docs mirror (remote, zero-setup)

https://gitmcp.io/qapdex-maker/idun-sdk/sse

For stdio-only clients (Claude Desktop, Cline, Msty):

{ "mcpServers": { "idun-docs": { "command": "npx", "args": ["mcp-remote", "https://gitmcp.io/qapdex-maker/idun-sdk/sse"] } } }

Recommended combo for a foreign agent: both idun (calls the agent) and idun-docs (reads the SDK docs) — it can invoke Idun and look up the exact IdunClient signature on its own.

Why stdlib-only?

Many AI agents run on constrained hosts (Termux on Android, minimal containers). Pulling httpx/pydantic/azure-identity breaks those setups. This SDK uses urllib.request + json only, so pip install idun-sdk just works everywhere Python 3.8+ runs.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idun_sdk-0.1.11.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idun_sdk-0.1.11-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file idun_sdk-0.1.11.tar.gz.

File metadata

  • Download URL: idun_sdk-0.1.11.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for idun_sdk-0.1.11.tar.gz
Algorithm Hash digest
SHA256 ccf78289cd480a082a6297dedcd1b831da2aa2dcc105b3427044a8664cad4a68
MD5 3d11add036e286f07acb7cbba4ec518d
BLAKE2b-256 e80d19f84d34aae1c900fd4391b4f773e2d50645ce6e2aa75d8c2edfcd989f0d

See more details on using hashes here.

File details

Details for the file idun_sdk-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: idun_sdk-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for idun_sdk-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 17e55ff83d518661a2238bececf4ba4a075ffd9a6e99a16e41a7aab0698a3fc1
MD5 dc1b01bf79c6c15761c1c1b831cd0e6b
BLAKE2b-256 e66566e0a84773683117c6d669d832e27238857bb80eb4d9699f979a3bbd9341

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page