Microsoft Agent Framework · Azure AI Foundry

Shared memory for Microsoft Agent Framework & Azure AI Foundry

An agent built on Microsoft Agent Framework or hosted on Azure AI Foundry is just as amnesiac across sessions as any other agent — it has no way to know what a teammate's Claude Code or Cursor agent already learned on the same repo. threadctx is a standard MCP server, and Microsoft's own MCPStdioTool connects an agent to any MCP server over stdio — no bespoke integration to build.

$ pip install agent-framework

Why Foundry teams add threadctx

  • MCP is a first-class tool type in Agent Framework. MCPStdioTool is Microsoft's own class for wrapping a local MCP server as an agent tool — the exact mechanism threadctx needs, already built and documented by Microsoft.
  • Foundry's own knowledge layer is moving the same direction. Foundry IQ unifies knowledge sources — including MCP sources — behind one retrieval endpoint, which is Microsoft treating MCP as a standard input to agent context, not a one-off.
  • It bridges outside the Microsoft stack too. threadctx is one server behind every client. A Foundry agent writes a memory with memory_write, and a teammate running Claude Code, Cursor, or a LangGraph agent can recall it with memory_query — one shared memory across every framework your team happens to run.

Add it to an Agent Framework agent

Same idea whether the agent runs locally or is hosted on Azure AI Foundry. For local mode, drop the env block — no key needed.

agent.py
from agent_framework import ChatAgent, MCPStdioTool
from agent_framework.openai import OpenAIChatClient

async with MCPStdioTool(
    name="threadctx",
    command="npx",
    args=["-y", "threadctx-mcp"],
    env={
        "THREADCTX_MODE": "cloud",
        "THREADCTX_API_KEY": "tctx_...",
    },
) as threadctx_tool:
    agent = ChatAgent(
        chat_client=OpenAIChatClient(),
        tools=threadctx_tool,  # memory_write + memory_query, ready to call
    )
    result = await agent.run("...")

Give your Foundry agents team memory.

Free and local for solo use. Team plans start at $11/seat/month when the memory needs to be shared.