The proxy-cli is a command-line interface tool designed as a wrapper around @contextvm/sdk's NostrMCPProxy. It allows you to connect to MCP servers using the ContextVM protocol through the nostr network, and use it as local mcp server in any mcp client.
curl -fsSL https://raw.githubusercontent.com/contextvm/proxy-cli/main/install.sh | bashThis CLI enables you to configure and run NostrMCPProxy, forming an integral part of the ContextVM ecosystem. It allows you to connect to MCP servers exposed through the nostr network and use them as if they were local MCP servers.
The tool supports configuration through multiple sources with clear precedence:
- CLI Flags (Highest Priority): Command-line arguments take precedence over other configuration methods.
- Environment Variables: Values set in the environment override configuration file settings.
- Configuration File (Lowest Priority): A YAML configuration file (
ctxproxy.config.yml) provides default settings that can be overridden by environment variables or CLI flags.
💡Tip: You can use the Quick Start method to install the CLI. If you prefer to install it manually, you can follow the instructions below.
💡Tip: Choose this installation method if you don't have Deno installed in your system, and you don't want to install it. You can download the latest release from the releases page.
Instructions:
- Pick the appropriate binary for your system (Linux, macOS, Windows).
- Download the binary and make it executable (e.g.,
chmod +x proxy-cli-linux). - Move the binary to a directory in your system's PATH (e.g.,
/usr/local/bin).
💡Tip: This installation method is recommended if you have Deno installed in your system.
Instructions:
- You can just run it with
deno run -A jsr:@contextvm/proxy-cli. - You can also install it with
deno install -A proxy-cli jsr:@contextvm/proxy-cli.
Note: The -A flag grants the cli all the permissions. If you want to run or install it with scoped permissions, you can use deno run --allow-net --allow-read --allow-env jsr:@contextvm/proxy-cli.
The proxy-cli loads configuration in the following order of precedence, where higher numbers override lower numbers:
- CLI Flags:
--private-key,--relays,--server-pubkey,--encryption-mode - Environment Variables:
CTXPROXY_PRIVATE_KEY,CTXPROXY_RELAYS,CTXPROXY_SERVER_PUBKEY,CTXPROXY_ENCRYPTION_MODE - Configuration File:
ctxproxy.config.yml
You can create a ctxproxy.config.yml file in your project root or working directory to store default configurations.
# ctxproxy.config.yml
privateKey: "your_64_character_hex_private_key_here"
relays:
- "wss://relay.damus.io"
- "wss://nostr-pub.wellorder.net"
- "wss://nostr.bitcoiner.social"
serverPubkey: "your_64_character_hex_server_public_key_here"
encryptionMode: "optional" # Options: optional(default), required, disabledYou can run the proxy-cli using the methods described above.
Using deno:
deno run -A jsr:@contextvm/proxy-cli [options]Replace [options] with CLI flags to override configuration settings.
Example with CLI flags:
deno run -A jsr:@contextvm/proxy-cli --private-key "your_private_key_here" --relays "wss://relay.com" --server-pubkey "server_public_key_here" --encryption-mode "required"This command will start the proxy, overriding the settings from the configuration file or environment variables if they exist with the provided CLI values.
Basic usage with configuration file:
proxy-cliOverride configuration with CLI flags:
proxy-cli --private-key "your_private_key_here" --server-pubkey "server_public_key_here"Using environment variables:
export CTXPROXY_PRIVATE_KEY="your_private_key_here"
export CTXPROXY_SERVER_PUBKEY="server_public_key_here"
proxy-cliproxy-cli start: Start the proxy (default command)proxy-cli --version: Show version informationproxy-cli --help: Show help messageproxy-cli init: Initialize a configuration file
privateKey: Your Nostr private key in HEX format (min 64 chars)relays: List of Nostr relay URLs to connect to (at least one required)serverPubkey: The public key of the server to connect to in HEX format
encryptionMode: Message encryption requirement (default: "optional")- "optional": Use encryption if available, but allow unencrypted
- "required": Only accept encrypted messages
- "disabled": Disable encryption completely
- Deno 2.x
deno task startdeno task test