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.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 sigmund-mcp-relay 0.1.1
File Size Uploaded Provenance Actions
sigmund_mcp_relay-0.1.1.tar.gz 86.9 kB Without provenance Details for sigmund_mcp_relay-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 181.2 kB

Release files / sigmund_mcp_relay-0.1.1.tar.gz

Download URL sigmund_mcp_relay-0.1.1.tar.gz
Size 86.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9c5f0df5ef7ee1ffd74fbe5cc24bce6ed18c8b61ad9387d0fee0cd7d41aa4174
BLAKE2b-256 checksum
How to use checksums
d1f7457f60fbd5414cdc82bfbfd83c884b71b4e29e018df11e9d82bb148d2642
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.1-py3-none-any.whl

Download URL sigmund_mcp_relay-0.1.1-py3-none-any.whl
Size 94.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbcaf6129a310ef84d45de40e65c0acd714dbb706425edbfac3f7c255657dba8
BLAKE2b-256 checksum
How to use checksums
a4f92a0ac79715d0f28474f5aa23ce883d8d8276e190d941fb1ba4da4a6ffe5c
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.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.

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