MCP tools loader for Axio
Project description
axio-tools-mcp
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
Toolinstances automatically - 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
With axio-tui (recommended)
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 (httpx) |
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).
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
}
]
}
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file axio_tools_mcp-0.9.1.tar.gz.
File metadata
- Download URL: axio_tools_mcp-0.9.1.tar.gz
- Upload date:
- Size: 70.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b7fd69fb3999046ff06c8f2f76b27dd8536d2a1e5a698d4ff071a890a5b10d8
|
|
| MD5 |
8095a8d8bc2a7899fbadc5d6bee5d5fe
|
|
| BLAKE2b-256 |
baadc96272784b1fe4e9b42847a227bd602d2e42578a08c0f68563a69957c0c9
|
Provenance
The following attestation bundles were made for axio_tools_mcp-0.9.1.tar.gz:
Publisher:
publish.yml on mosquito/axio-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axio_tools_mcp-0.9.1.tar.gz -
Subject digest:
8b7fd69fb3999046ff06c8f2f76b27dd8536d2a1e5a698d4ff071a890a5b10d8 - Sigstore transparency entry: 1506185662
- Sigstore integration time:
-
Permalink:
mosquito/axio-agent@f35fad3143dc1bfd9cc2eb4042b98ffeb696937c -
Branch / Tag:
refs/tags/0.9.1 - Owner: https://github.com/mosquito
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f35fad3143dc1bfd9cc2eb4042b98ffeb696937c -
Trigger Event:
release
-
Statement type:
File details
Details for the file axio_tools_mcp-0.9.1-py3-none-any.whl.
File metadata
- Download URL: axio_tools_mcp-0.9.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8a33ca939404d7aae2d73eae5fc56c540da81b0a40e1d55ad8ba58869227eca
|
|
| MD5 |
583f11828507545f32ca3a33ddef0e6e
|
|
| BLAKE2b-256 |
f1ca6bbdfd7a4b29d80621d03602606016bf8a3627ada2e1dc317ab04dc84a4a
|
Provenance
The following attestation bundles were made for axio_tools_mcp-0.9.1-py3-none-any.whl:
Publisher:
publish.yml on mosquito/axio-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axio_tools_mcp-0.9.1-py3-none-any.whl -
Subject digest:
b8a33ca939404d7aae2d73eae5fc56c540da81b0a40e1d55ad8ba58869227eca - Sigstore transparency entry: 1506185839
- Sigstore integration time:
-
Permalink:
mosquito/axio-agent@f35fad3143dc1bfd9cc2eb4042b98ffeb696937c -
Branch / Tag:
refs/tags/0.9.1 - Owner: https://github.com/mosquito
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f35fad3143dc1bfd9cc2eb4042b98ffeb696937c -
Trigger Event:
release
-
Statement type: