Skip to main content

MCP relay

Copyright Sebastiaan Mathôt 2026. Contains AI-generated code.

Lets a cloud MCP client (e.g. SigmundAI/ LibreChat) use MCP servers that run on users' desktops, where no inbound connection is possible.

Quick start

Server

On the server, set RELAY_API_KEY and start the server. The relay API key should be specified as the bearer token in the client (e.g. LibreChat).

export RELAY_API_KEY=1234
python server.py

Desktop (agent)

First, desktop-relay tool in your MPC client and ask for a pairing code.

Next, on the desktop, start example_qt_app.py (or an application derived from it). This connects to the relay server and makes MCP servers available to the client.

Alternatively, pair the agent and run and MCP server through the command line.

python agent.py pair --relay http://localhost:8080 --code 1234-5678
python agent.py run --server your-mcp-server="launch-mcp-command"

Client (LibreChat)

One entry per server name. user_id in the pairing step must equal the LibreChat user id.

mcpServers:
  # The desktop-relay is a built-in MCP server that handles pairing and needs to be enabled.
  desktop-relay:
    type: streamable-http
    url: https://relay.example.com/mcp/relay
    headers:
      Authorization: "Bearer ${RELAY_API_KEY}"
      X-User-Id: "{{LIBRECHAT_USER_ID}}"
  # In addition, add MCP servers offered by the relay. This depends on your setup.
  desktop-hello:
    type: streamable-http
    url: https://relay.example.com/mcp/hello
    headers:
      Authorization: "Bearer ${RELAY_API_KEY}"
      X-User-Id: "{{LIBRECHAT_USER_ID}}"

The Authorization token should match the RELAY_API_KEY of the server. The X-User-Id is a placeholder following LibreChat's config system, and does not depend on the relay configuration.

License

mcp-relay is licensed under the GNU General Public License v3.

Metadata

Release files for sigmund-mcp-relay 0.1.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 sigmund-mcp-relay 0.1.2
File Size Uploaded Provenance Actions
sigmund_mcp_relay-0.1.2.tar.gz 87.0 kB Without provenance Details for sigmund_mcp_relay-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sigmund-mcp-relay 0.1.2
File Interpreter ABI Platform Actions
sigmund_mcp_relay-0.1.2-py3-none-any.whl Python 3 none any Details for sigmund_mcp_relay-0.1.2-py3-none-any.whl

Total release size: 181.4 kB

Release files / sigmund_mcp_relay-0.1.2.tar.gz

Download URL sigmund_mcp_relay-0.1.2.tar.gz
Size 87.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f328111657219129172b869ed06f7a08150dbbd0082969e212883088da143069
BLAKE2b-256 checksum
How to use checksums
f4232660c88369599ec3139b5f013b28d4037b1b71759bea45b1d661054408d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / sigmund_mcp_relay-0.1.2-py3-none-any.whl

Download URL sigmund_mcp_relay-0.1.2-py3-none-any.whl
Size 94.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
237226bd434dd76beaf40e5035d468e39c17144c5cb3c918148f4488baa288a9
BLAKE2b-256 checksum
How to use checksums
de787d84521c4cfb88e1ca6f83e1f461f7e62c2ca30fb106c05a33a1d6fadee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for sigmund-mcp-relay 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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