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

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.2.0
File Size Uploaded Provenance Actions
sigmund_mcp_relay-0.2.0.tar.gz 92.2 kB Without provenance Details for sigmund_mcp_relay-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 191.8 kB

Release files / sigmund_mcp_relay-0.2.0.tar.gz

Download URL sigmund_mcp_relay-0.2.0.tar.gz
Size 92.2 kB
Tags Source
SHA-256 checksum
How to use checksums
20f05dcc94691beae1b709108cf61a654527d42db02c9d97b79e3e2af8d19d27
BLAKE2b-256 checksum
How to use checksums
9dd395d228801e32b3ced4c32d260e4acac08a29e8813d9d57c635001a59e5bc
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.2.0-py3-none-any.whl

Download URL sigmund_mcp_relay-0.2.0-py3-none-any.whl
Size 99.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85cfb58b95255964d587820fde6840b291b7dba7b65c91c7eef1b0843ac6dd3f
BLAKE2b-256 checksum
How to use checksums
ca5fb99ec5f09c71e06a166fb309e0ff8641731bdcc69d4c75d9191c67b83b52
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.2.0

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