Skip to main content

axio-tools-mcp

PyPI Python License: MIT

Model Context Protocol (MCP) bridge for axio.

Connect any MCP server to your axio agent. Tools exposed by MCP servers are discovered at runtime and become first-class axio Tool instances - no manual wiring required.

Features

  • Dynamic tool discovery - connects to MCP servers and converts their tools into axio Tool instances automatically
  • Five protocol revisions - the revision is negotiated with the server, or pinned per server
  • Multiple servers - configure and run several MCP servers simultaneously
  • Lifecycle management - handles server startup, shutdown, and reconnection
  • TUI integration - ships a settings screen for managing MCP server configuration from within axio-tui

Installation

pip install axio-tools-mcp

Usage

pip install "axio-tui[mcp]"
uv run axio   # MCP Servers section appears in settings

Standalone

import asyncio
from axio_tools_mcp.registry import MCPRegistry
from axio.agent import Agent
from axio.context import MemoryContextStore


async def main() -> None:
    registry = MCPRegistry()
    await registry.init(config=None)

    tools = registry.all_tools  # list[axio.Tool]
    print(f"Loaded {len(tools)} tools from MCP servers")

    # Pass any CompletionTransport - e.g. OpenAITransport, AnthropicTransport
    agent = Agent(
        system="You are a helpful assistant.",
        tools=tools,
        transport=transport,
    )
    result = await agent.run("Use the available tools to help me", MemoryContextStore())
    print(result)

    await registry.close()


asyncio.run(main())

Transport types

Two transport types are supported, selected by which field is set in the server config:

Transport Config field Protocol
stdio command Spawns a subprocess; communicates over stdin/stdout (MCP stdio transport)
HTTP url Connects to a running HTTP server using the MCP Streamable HTTP transport (aiohttp)

Exactly one of command or url must be set per server - providing both or neither raises a ValueError.

For stdio servers, stderr output from the subprocess is forwarded to the Python logger as warnings under the mcp:<server-name> prefix.

HTTP servers accept optional headers (e.g., for bearer tokens) and a configurable timeout (default: 30 seconds).

Protocol revisions

The client is aiohttp-tiny-mcp, which speaks 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25 and 2026-07-28.

The handshake starts on 2025-06-18, because every current server answers it. A server that answers with another revision selects it, and a server that refuses and names what it supports gets a second handshake on the newest revision both sides speak. Set protocol_version on the server config to pin one revision; a pinned revision is never replaced.

Tool naming

Tools from MCP servers are named using the pattern <server_name>__<tool_name>. For example, a server named filesystem that exposes a tool called read_file becomes filesystem__read_file in axio. The tool description is taken from the MCP tool's description field, falling back to the tool name if no description is provided.

Error handling

When an MCP server fails to connect or start, the error is logged at ERROR level and the server is skipped - no exception is raised to the caller. registry.all_tools will simply not include any tools from the failed server. The error message is accessible via registry.server_status(name) (returns "error") and the raw error string is stored internally.

Lifecycle: close()

Call await registry.close() when the agent session ends to disconnect all MCP server sessions and release resources (subprocess file descriptors, HTTP connections):

await registry.close()

MCP server configuration

MCP servers are configured via the axio-tui settings UI or programmatically:

stdio server (spawns a subprocess):

{
  "servers": [
    {
      "name": "filesystem",
      "command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
    },
    {
      "name": "github",
      "command": ["npx", "-y", "@modelcontextprotocol/server-github"],
      "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."}
    }
  ]
}

HTTP server (connects to a running MCP HTTP endpoint):

{
  "servers": [
    {
      "name": "remote",
      "url": "https://my-mcp-server.example.com/mcp",
      "headers": {"Authorization": "Bearer my-token"},
      "timeout": 60.0,
      "protocol_version": "2025-11-25"
    }
  ]
}

Plugin registration

[project.entry-points."axio.tools.settings"]
mcp = "axio_tools_mcp.plugin:MCPPlugin"

Part of the axio ecosystem

axio · axio-tools-local · axio-tools-docker · axio-tui

License

MIT

Metadata

Release files for axio-tools-mcp 0.11.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for axio-tools-mcp 0.11.3
File Size Uploaded
axio_tools_mcp-0.11.3.tar.gz 73.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for axio-tools-mcp 0.11.3
File Interpreter ABI Platform
axio_tools_mcp-0.11.3-py3-none-any.whl Python 3 none any Details

Total release size: 90.8 kB

Release files / axio_tools_mcp-0.11.3.tar.gz

Download URL axio_tools_mcp-0.11.3.tar.gz
Size 73.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40dcec8bba683f0a6f7149c57aa104992410c258fceff0da98da3c41d6da2fa3
BLAKE2b-256 checksum
How to use checksums
c052babec008b9c0999e4409a3077c3487accebf5ef8af62a29b07bd009268da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / axio_tools_mcp-0.11.3-py3-none-any.whl

Download URL axio_tools_mcp-0.11.3-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4cb76f4379b32aadab04d0b6875708010806a1818e77d525f20793a64b68b4c
BLAKE2b-256 checksum
How to use checksums
68833a6a9b9fe44c1997c55da47e13fdc1a6b622f950687daae6ff694b997c72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.11.3 This release

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page