ax-mcp

Integrates native Model Context Protocol clients with Ax agents, flows, and event runtimes.

2.9k|191|Updated Feb 23, 2023
One-click install
npx skills add https://github.com/ax-llm/ax --skill ax-mcp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ax-mcp
Source: https://github.com/ax-llm/ax/tree/main/website/static/typescript/.well-known/agent-skills/ax-mcp
Command: npx skills add https://github.com/ax-llm/ax --skill ax-mcp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @ax-llm/ax, @ax-llm/ax-tools.

What problem does it solve?

Building correct Model Context Protocol integrations requires handling transports, protocol eras, authentication, tasks, subscriptions, and raw result preservation, and mistakes like converting MCP tools into plain functions lose protocol state and capabilities.

Core Features & Use Cases

  • Native MCP Client Integration: Attach AxMCPClient instances to AxGen, AxAgent, AxFlow, or chat via the mcp option, preserving sessions, catalogs, tasks, and raw multimodal results.
  • Transport and Era Selection: Choose between Streamable HTTP, legacy HTTP/SSE, WebSocket, and stdio transports, with automatic classification of legacy versus modern protocol eras.
  • Event-Driven Agents: Combine AxMCPEventSource with AxEventRuntime to route resource updates, task states, and notifications into authenticated agent wake/resume routes.
  • Use Case: Connect an Ax agent to a remote MCP documentation server over Streamable HTTP with bearer authentication, subscribe to markdown resource updates, and wake a reviewer agent whenever the engineering guide changes.

Quick Start

Ask the AI to create an AxMCPClient with a Streamable HTTP transport and attach it to an Ax agent so the agent can call the server's MCP tools.

Frequently Asked Questions about ax-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect an MCP server to an Ax agent?

Create an AxMCPClient with a transport such as AxMCPStreamableHTTPTransport, then pass it through the agent's `mcp` option. The agent exposes native modules under `mcp.<namespace>.tools.<tool>` without converting them into plain functions.

Which MCP transport should I use in Ax?

Use AxMCPStreamableHTTPTransport for current remote servers, AxMCPHTTPSSETransport only for legacy HTTP/SSE servers, AxMCPWebSocketTransport for custom WebSocket bindings, and AxMCPStdioTransport from @ax-llm/ax-tools for local Node processes.

Does the Ax MCP client support OAuth authentication?

Yes, the HTTP transport supports bearer, basic, API key, and HMAC strategies plus an `oauth` option covering protected-resource discovery, PKCE, refresh, and client credentials. Generated Python, Java, C++, Go, and Rust clients implement a portable OAuth middle tier.

Why should I avoid toFunction() for MCP integration?

toFunction() is a lossy compatibility adapter that discards protocol state, raw content, tasks, and notifications. Native integration passes clients through the `mcp` option so catalogs, identity, and cancellation context stay intact.

How do MCP resource subscriptions work with Ax agents?

Use AxMCPEventSource with AxEventRuntime so subscription callbacks publish events into an inbox, and explicit routes decide whether to observe, invalidate, wake, or resume agents. Resource updates never wake agents implicitly; routes and identity policy control activation.