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.1

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.1
File Size Uploaded Provenance Actions
xyberos_mcp-0.2.1.tar.gz 19.1 kB With provenance Details for xyberos_mcp-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 36.6 kB

Release files / xyberos_mcp-0.2.1.tar.gz

Download URL xyberos_mcp-0.2.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9fe19b0ac8620ca8a4cc44b75649e662d45e704e0211352c62688d2c73e12f48
BLAKE2b-256 checksum
How to use checksums
3528818083b481ec75e00dc04def1c9f7e0db72842dfc04cadc3b5ff2309715d
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 16, 2026.

Transparency log

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

Download URL xyberos_mcp-0.2.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0c5b352b118555cba0552779a9385efc21eb85b0787f083403857dd034f6477
BLAKE2b-256 checksum
How to use checksums
2761bc627225af7a9097bdfb97ede5f4d0f568d513c5c3c1f05e9ae658485bb7
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 16, 2026.

Transparency log

Security for xyberos-mcp 0.2.1

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.1.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 Sep 16, 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