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

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

Built distribution (wheel)

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

Total release size: 36.6 kB

Release files / xyberos_mcp-0.2.2.tar.gz

Download URL xyberos_mcp-0.2.2.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bdad945ade1c8b7290882d02c22ee9688cf4797dd6e55533990aa5d0e385e922
BLAKE2b-256 checksum
How to use checksums
4937067c10cd8216e2cfb23876399f1543ebbafb7144219440073c941f79bb7e
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 Oct 11, 2026.

Transparency log

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

Download URL xyberos_mcp-0.2.2-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc30196d4e3b57981ddd91aacb607b3693f6aa0e4641527e95e5963df2b0f96b
BLAKE2b-256 checksum
How to use checksums
34137c6f0c768994e306a0989776902b9d158d572153e53f2b05606ed3a2c155
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 Oct 11, 2026.

Transparency log

Security for xyberos-mcp 0.2.2

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.2.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 Oct 11, 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