Skip to main content

xyberos-mcp

Model Context Protocol client plugin — RFC-0019, M3. Xyberos → MCP → an enormous ecosystem. Speaks the MCP protocol (JSON-RPC 2.0) over stdio (local servers) and streamable HTTP (remote servers) using only the standard library. Each configured server's tools/list becomes one typed Tool (named {server}_{tool}), with arguments coerced through FunctionTool / coerce_arguments.

Install

pip install -e ./mcp

The client is stdlib-only; the [mcp] optional extra installs the official SDK (not required). xyberos[mcp] is also declared in the core extras.

Usage

from xyberos import create_app
from xyberos_mcp import McpPlugin

servers = {
    "demo": {"command": ["python", "examples/demo_mcp_server.py"]},
    "remote": {"url": "https://example.com/mcp", "headers": {"Authorization": "Bearer ..."}},
}

app = create_app()
app.load_plugin(McpPlugin(servers))

app.tools.execute("demo_echo", None, text="hello", repeat=2)

Or configure entirely through the environment (MCP_SERVERS = JSON path or inline JSON). An unconfigured instance registers nothing (logs a warning).

Direct client use

from xyberos_mcp import McpClient
from xyberos_mcp.registry import ServerConfig

with McpClient(ServerConfig(name="demo", command=["python", "demo_mcp_server.py"])) as client:
    client.list_tools()          # -> [{name, description, inputSchema}]
    client.call_tool("echo", {"text": "hi"})

Design

  • TransportsStdioTransport (newline-delimited JSON-RPC over a subprocess) and HttpTransport (streamable HTTP; handles application/json and text/event-stream responses).
  • Lifecycleconnect/disconnect/reconnect, initialize handshake + notifications/initialized, per-request timeouts, and utils.resilience.retry on connect.
  • Securityshell=False + literal argv (no shell interpolation), new session / hidden-window subprocess isolation, and a ServerAllowlist that refuses unlisted servers.
  • Typed tools — MCP inputSchemaFunctionTool signature (same __signature__ technique as the M2 HTTP connector).

Examples

  • examples/demo_mcp_server.py — a minimal local MCP server (echo, add).
  • examples/mcp_client.py — connects to it, lists tools, calls one.
  • examples/servers.json — stdio + remote HTTP config reference.

Tests

pip install pytest
pytest tests/

The tests launch the bundled fake MCP server (stdio) and a local HTTP endpoint (both application/json and SSE modes) — no external network, no SDK.

Ship location

Plugin (xyberos.plugins entry point) + optional [mcp] extra. Depends on M2's HTTP/typed-tool patterns.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xyberos_mcp-0.1.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xyberos_mcp-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file xyberos_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: xyberos_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xyberos_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c9ac676672921b6515870b9a0422a5614b33cf8b41db2236ff4433678308565e
MD5 99cf039de351ca06a40decaa5da0da90
BLAKE2b-256 cc95653ab7a1ac29528c73bf1ce3336600560eb57f3c8f56ed838d667e349bd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyberos_mcp-0.1.0.tar.gz:

Publisher: pypi-plugins.yml on xyberos/xyberos-plugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xyberos_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xyberos_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xyberos_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cdfe5590a8d3f91fa0c3601847e007e5193109cd39b27973e26b880d5162263
MD5 ac574fb59702bed69fd65a9eb9ac39f1
BLAKE2b-256 6f3c51cae7ae30c883d36f8f97e9381e846fd74985e5e49333ff6cbce3998cf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyberos_mcp-0.1.0-py3-none-any.whl:

Publisher: pypi-plugins.yml on xyberos/xyberos-plugins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page