Repository navigation
MicrosoftAgentFramework
create_algenta_tools — an async context manager building a governed list of
agent_framework.FunctionTools from your engine's
MCP tool surface, with two-layer safety-field scrubbing and typed denials built on MAF's
MiddlewareFailure (its one fail-closed abort signal, never swallowed into a tool result).
pip install maf-algenta
pip install agent-framework-openai # or any other agent_framework chat client, for Agent belowDepends on agent-framework-core (deliberately not the agent-framework umbrella package, whose
[all] extra pulls in Foundry hosted-agent backends this package doesn't use), mcp, and httpx.
from agent_framework import Agent
from agent_framework.openai import OpenAIChatClient
from maf_algenta import create_algenta_tools
async with create_algenta_tools(base_url="http://localhost:8000/mcp", profile="observe") as tools:
agent = Agent(OpenAIChatClient(), tools=tools)
result = await agent.run("What's the expected value of scenario X?")
print(result.text)An async context manager because agent_framework.MCPStreamableHTTPTool itself is a live
connected session — create_algenta_tools owns the connection for the async with block.
All four, per the contract: observe (default) · govern · execute · full
(opt-in). Filtered twice — at MCP connection time via MCPStreamableHTTPTool(allowed_tools=...)
and again over .functions as defense-in-depth.
-
Both scrub layers are load-bearing here (verified against
agent-framework-core1.15.0): MAF's argument validation only rejects unexpected properties when the schema setsadditionalProperties: false, which real MCP-derived schemas don't — so a smuggledforce: truewould sail through validation if the call-time scrub weren't there. The tests assert on the real received arguments over the real wire. -
Denials: a real 409 arrives as an MCP tool-error → MAF's
ToolExecutionException→ parsed and re-raised asAlgentaToolDeniedwith.blocked.gate/.code/.message/.override_hint, propagating out ofAgent.rununmodified. Anomalies raiseAlgentaToolExecutionFailed. No fictionalapproval_stateis modeled. -
Scope: standalone MAF against a self-hosted MCP endpoint only. Microsoft Foundry (hosted
Azure platform) is a separate, documentation-only deliverable under
foundry/— not verified against a live Foundry project. .NET parity is likewise unverified. -
Tests: real stub MCP server + a scripted
FakeChatClientdriving the real function-invocation loop —uv run pytest maf-algenta -v.
Full reference: package README
(verified-live denial mapping, mcp_tool= escape hatch, dependency rationale).
thyn-ai/algenta-integrations · Apache-2.0 · The Algenta engine is separate, closed-source software — these packages are ordinary Python and TypeScript talking to its public HTTP/MCP APIs. · Support · Security · Discord
Start here
Framework guides
- LangChain
- LlamaIndex
- Pydantic AI
- MS Agent Framework
- Haystack
- LiteLLM
- Ray Serve
- vLLM
- Vercel AI SDK
- n8n
Project