Skip to main content

xyberos-mcp

Model Context Protocol 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.

  • Client — each configured server's tools/list becomes one typed Tool (named {server}_{tool}), with arguments coerced through FunctionTool / coerce_arguments.
  • Server — expose(app) serves a Xyberos app's registered tools to external MCP clients (requires the [mcp] extra).

Install

pip install xyberos-mcp               # client, stdlib-only
pip install "xyberos-mcp[mcp]"        # + official MCP SDK (for expose())

# development (editable, from this repo):
pip install -e ./mcp

The client is stdlib-only; the [mcp] optional extra installs the official SDK (required only for the server half). 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"})

Server: expose your app's tools to external MCP clients

from xyberos import create_app
from xyberos_mcp import expose

app = create_app()
# ... register/load tools (e.g. app.load_plugin(WebSearchPlugin())) ...

expose(app)                              # all tools, stdio (blocks)
expose(app, tools=["web_search"])         # a subset
expose(app, transport="streamable-http")  # or "sse" / "streamable-http"

build_server(app, ...) returns the SDK server without running it, so you can mount it into a web app instead of blocking.

Design

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

Examples

  • examples/demo_mcp_server.py — a minimal local MCP server (echo, add).
  • examples/expose_server.py — serve a Xyberos app's tools via expose().
  • 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.

Metadata

Release files for xyberos-mcp 0.2.0

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

Source distribution (sdist)

Source distribution for xyberos-mcp 0.2.0
File Size Uploaded Provenance Actions
xyberos_mcp-0.2.0.tar.gz 18.6 kB With provenance Details for xyberos_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xyberos-mcp 0.2.0
File Interpreter ABI Platform Actions
xyberos_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for xyberos_mcp-0.2.0-py3-none-any.whl

Total release size: 35.6 kB

Release files / xyberos_mcp-0.2.0.tar.gz

Download URL xyberos_mcp-0.2.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
29fac710ac9da926c220a9caa00d602e631cd8eeaab3e9e7bcea9b9fcc4a72f9
BLAKE2b-256 checksum
How to use checksums
dd7b57d165a48a0bc7b7c8de667b6fc6c40448590147bff5da2718008fa9a9e5
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 Aug 28, 2026.

Transparency log

Release files / xyberos_mcp-0.2.0-py3-none-any.whl

Download URL xyberos_mcp-0.2.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df8a0445c672604ccc4736a324e2af3efa2c20816cf6270381308a9f4ff5a158
BLAKE2b-256 checksum
How to use checksums
26a9a3604e20b5f61f2f0355e1f034fd4f7ab0b6b6247ee59c6ce5ad39380c0e
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 Aug 28, 2026.

Transparency log

Security for xyberos-mcp 0.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xyberos_mcp-0.2.0.tar.gz

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 Aug 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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