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

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.3
File Size Uploaded Provenance Actions
sigmund_mcp_relay-0.1.3.tar.gz 92.1 kB Without provenance Details for sigmund_mcp_relay-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 191.5 kB

Release files / sigmund_mcp_relay-0.1.3.tar.gz

Download URL sigmund_mcp_relay-0.1.3.tar.gz
Size 92.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4e87382cc7a76260bac201aaf94360c37e81b9765f61273df5fd435954dba94b
BLAKE2b-256 checksum
How to use checksums
a4ced9a80f2a1cba58928c11bb92f85331a635312b6e61a66ef5fd9cd867e108
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.3-py3-none-any.whl

Download URL sigmund_mcp_relay-0.1.3-py3-none-any.whl
Size 99.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52b889aa76fb0c7ff1de7217c456bc0f3d487f6cae0d2e1f8e6dbfef3a03adac
BLAKE2b-256 checksum
How to use checksums
70480e49648b0331ed06eb9b2c9045453faca62c5aaebf80cac8f61587cb91f3
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.3

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