Skip to main content
The LangGraph MCP helpers live in the aion-authoring-langgraph package and are imported from aion.langgraph.authoring.mcp or directly from aion.langgraph.authoring. They are thin framework bindings over the shared aion-mcp endpoint helpers. The package does not own Aion control-plane addressing models; those live in aion-api-client.

Install

pip install aion-authoring-langgraph
The helpers require langchain-mcp-adapters when actually loading MCP tools or constructing a MultiServerMCPClient.

Exports

from aion.langgraph.authoring.mcp import (
    AionLangGraphMcpResolver,
    aion_langgraph_mcp_client,
    aion_langgraph_mcp_server_config,
    aion_langgraph_mcp_server_config_sync,
    load_aion_mcp_tools,
)

AionLangGraphMcpResolver

Reusable resolver for building LangChain MCP server config, constructing a client, or loading tools.
from aion.api import (
    CapabilityReference,
    CapabilitySubjectSource,
    RuntimeCapabilityReference,
)
from aion.langgraph.authoring.mcp import AionLangGraphMcpResolver

resolver = AionLangGraphMcpResolver(
    capability_references=[
        CapabilityReference.global_mcp(),
    ],
    runtime_capability_references=[
        RuntimeCapabilityReference.primary_mcp(
            CapabilitySubjectSource.INCOMING_DISTRIBUTION
        ),
    ],
)
ParameterPurpose
capability_referencesExplicit subject-kind-key references, including the global control plane.
runtime_capability_referencesTemplates resolved from AionRuntimeContext at request time.
principal_selectorOptional explicit principal selector for all endpoints.
base_urlOptional Aion API base URL override.
jwt_managerOptional async token manager.
sync_jwt_managerOptional synchronous token manager.

Methods

MethodReturns
await resolver.server_config(context)MultiServerMCPClient server config.
resolver.server_config_sync(context)Synchronous server config.
await resolver.load_tools(context)LangChain-compatible tools from all resolved servers.
resolver.client(context)MultiServerMCPClient instance from synchronous endpoint config.
Runtime references require a context. If a runtime reference is configured and no context is supplied, the helper raises ValueError.

aion_langgraph_mcp_server_config

Builds the dictionary expected by langchain_mcp_adapters.client.MultiServerMCPClient.
from langchain_mcp_adapters.client import MultiServerMCPClient
from aion.langgraph.authoring.mcp import aion_langgraph_mcp_server_config

config = await aion_langgraph_mcp_server_config(
    runtime_context,
    capability_references=[
        CapabilityReference.global_mcp(),
    ],
)

client = MultiServerMCPClient(config)
tools = await client.get_tools()
The config uses Aion endpoint names as keys. Each value contains transport, url, and headers. For remote Aion MCP endpoints, transport is http.

load_aion_mcp_tools

Loads tools directly from the resolved endpoints.
from aion.langgraph.authoring.mcp import load_aion_mcp_tools

tools = await load_aion_mcp_tools(
    runtime_context,
    capability_references=[
        CapabilityReference.global_mcp(),
    ],
    runtime_capability_references=[
        RuntimeCapabilityReference.primary_mcp(
            CapabilitySubjectSource.INCOMING_DISTRIBUTION
        ),
    ],
)
This is useful when the graph or agent is constructed after the Aion runtime context exists.

aion_langgraph_mcp_client

Creates a MultiServerMCPClient using synchronous endpoint construction.
from aion.langgraph.authoring.mcp import aion_langgraph_mcp_client

client = aion_langgraph_mcp_client(
    runtime_context,
    capability_references=[CapabilityReference.global_mcp()],
)
Use the lower-level server-config helper when you need to control client lifecycle yourself.

Runtime context source

The LangGraph helpers do not read from global or thread-local state. Pass the current AionRuntimeContext explicitly, usually from LangGraph’s Runtime[AionRuntimeContext] object.
from langgraph.runtime import Runtime
from aion.core.runtime import AionRuntimeContext


async def node(state, runtime: Runtime[AionRuntimeContext]):
    tools = await resolver.load_tools(runtime.context)
    ...