Skip to main content

Zero-env-config credential relay for MCP servers

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

mcp-relay-core

Zero-config credential relay client for Python MCP servers -- ECDH P-256 + AES-256-GCM E2E encryption.

Installation

pip install mcp-relay-core

Usage

Resolve config (env vars -> config file -> defaults -> relay)

from mcp_relay_core import resolve_config

result = resolve_config("my-server", ["api_key", "endpoint"])

if result.config:
    print(f"Config loaded from {result.source}: {result.config}")
else:
    # No config found -- trigger relay setup
    pass

Relay session (interactive credential setup)

import asyncio
from mcp_relay_core import create_session, poll_for_result, write_config

async def setup():
    session = await create_session(
        "https://relay.example.com",
        "my-server",
        {
            "fields": [
                {"name": "api_key", "label": "API Key", "type": "password"},
                {"name": "endpoint", "label": "Endpoint", "type": "text"},
            ]
        },
    )

    print(f"Open this URL to enter credentials: {session.relay_url}")

    credentials = await poll_for_result("https://relay.example.com", session)
    write_config("my-server", credentials)

asyncio.run(setup())

Crypto primitives

from mcp_relay_core import (
    generate_key_pair,
    export_public_key,
    derive_shared_secret,
    derive_aes_key,
    encrypt,
    decrypt,
)

Documentation

See the main repository for full documentation, architecture, and security properties.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_relay_core-1.2.0b1.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_relay_core-1.2.0b1-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_relay_core-1.2.0b1.tar.gz.

File metadata

  • Download URL: mcp_relay_core-1.2.0b1.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_relay_core-1.2.0b1.tar.gz
Algorithm Hash digest
SHA256 ec7cd7624889ecec7f379f83d33b3ae6c21c3be0da5d69b0f7085c685c804e77
MD5 e23da2a45b2bfa4b718f7e2032a855ee
BLAKE2b-256 cde567a8dbae49546b8d34cd9ff0ba6b9fe51000fdbbcde5c72c8c857c2fc0a3

See more details on using hashes here.

File details

Details for the file mcp_relay_core-1.2.0b1-py3-none-any.whl.

File metadata

  • Download URL: mcp_relay_core-1.2.0b1-py3-none-any.whl
  • Upload date:
  • Size: 41.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_relay_core-1.2.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee602c9b2c2c2e11443a6342bd5931c6c4b7c7fee0ad78d6c63a35f1b0a08d8
MD5 54cc5dddaef213ae53e955ceed149d59
BLAKE2b-256 312a87127e69c2bc7452fc6804cba60a445f888be7740a83e10e2b7a918700c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page