From 75d51e9a6b880a11cb8ec687f59c651c13088afb Mon Sep 17 00:00:00 2001 From: imranux-ui Date: Thu, 9 Apr 2026 11:14:15 +0800 Subject: [PATCH 1/2] Add self-host page route --- src/routes/self-host/+page.svelte | 433 ++++++++++++++++++++++++++++++ 1 file changed, 433 insertions(+) create mode 100644 src/routes/self-host/+page.svelte diff --git a/src/routes/self-host/+page.svelte b/src/routes/self-host/+page.svelte new file mode 100644 index 0000000..65dcdba --- /dev/null +++ b/src/routes/self-host/+page.svelte @@ -0,0 +1,433 @@ + + + + +
+ + +
+
+ Self-hosting guide +
+

Host your own ContextVM server

+

+ Expose any MCP server to the decentralised Nostr network in minutes. + Pick your path below. +

+
+ + +
+ +
Choose your approach
+ + +
+ + + +
+ + + {#if activePath === 'cvmi'} +
Step-by-step — CVMI path
+
+ +
+
+
1
+
+
+
+

Check prerequisites

+

You need Node.js 18 or higher installed. That's it — no global installs required.

+
+
+
+ + + +
+ Node.js 18 or higher +
+
+
+ + + +
+ npm, yarn, pnpm, or bun +
+
+
+ Check your Node version: node --version +
+
+
+ +
+
+
2
+
+
+
+

Verify CVMI works

+

No installation needed. Run this once to confirm everything is set up correctly.

+
+ npx cvmi --help + +
+
+ You should see a list of available commands. If you do, you're ready. +
+
+
+ +
+
+
3
+
+
+
+

Start your server

+

+ This exposes a local filesystem MCP server to the Nostr network. + A cryptographic key pair is auto-generated for you. +

+
+ npx cvmi serve -- npx -y @modelcontextprotocol/server-filesystem /tmp + +
+
+ Your server's public key (npub1...) will print in the terminal. Save it — you'll need it to connect clients. +
+
+
+ +
+
+
4
+
+
+
+

Connect a client

+

From another machine or MCP client, connect using your server's public key.

+
+ npx cvmi use npub1q... + +
+
+
+ +
+
+
5
+
+
+
+

Optional: configure your server

+

+ Create a .cvmi.json in your project folder to set relays, + encryption, and a persistent private key. +

+
{`{
+  "serve": {
+    "privateKey": "nsec1...",
+    "relays": ["wss://relay.damus.io"],
+    "encryption": "required",
+    "public": true
+  }
+}`}
+ +
+
+ +
+ {/if} + + + {#if activePath === 'ts'} +
Step-by-step — TypeScript SDK path
+
+ +
+
+
1
+
+
+
+

Install the SDK

+

Add the ContextVM TypeScript SDK to your project.

+
+ npm install @contextvm/sdk + +
+
+
+ +
+
+
2
+
+
+
+

Understand the core building blocks

+

+ Before writing code, get familiar with the three concepts that power every + ContextVM integration: transports, signers, + and relay handlers. +

+
+ Start with the + SDK Quick Overview + — it maps out what each module does and how they fit together. +
+
+
+ +
+
+
3
+
+
+
+

Choose the right component for hosting

+

Two components handle the server side:

+
+
+ NostrMCPGateway + Exposes an existing MCP server to the Nostr network +
+
+ NostrMCPProxy + Bridges a Nostr server to a local stdio MCP client +
+
+
+ See + Gateway docs + and + Proxy docs + for implementation details. +
+
+
+ +
+
+
4
+
+
+
+

Run the client-server tutorial

+

+ Work through the hands-on example to see a full server and client + interaction in TypeScript before writing your own. +

+
+ Found under Tutorials → + Client-Server Communication + in the docs sidebar. +
+
+
+ +
+
+
5
+
+
+
+

Go live

+

+ Once built, your server needs a Nostr private key and relay configuration + to go live on the network. Pass keys and relays directly into the SDK's + transport options. +

+
+ Want to charge clients for access? Set up + Lightning payments via CEP-8. +
+
+
+ +
+ {/if} + +
+ + +
What's next
+
+
+
Add skills
+

Install reference implementations and templates to accelerate development.

+ + Learn about skills → + +
+
+
Publish your server
+

Make your server publicly discoverable on the Nostr network.

+ + Server announcements → + +
+
+
Add payments
+

Charge clients for using your server via the Lightning Network.

+ + Set up payments → + +
+
+ +
+
+ + \ No newline at end of file From f0c48d5c0502c93de1daf85553203910f1351b82 Mon Sep 17 00:00:00 2001 From: imranux-ui Date: Thu, 9 Apr 2026 22:27:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20address=20PR=20feedback=20=E2=80=94?= =?UTF-8?q?=20use=20site=20Tabs=20component,=20Tailwind=20only,=20copyToCl?= =?UTF-8?q?ipboard=20from=20utils,=20correct=20SDK=20transport=20descripti?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/self-host/+page.svelte | 825 +++++++++++++++--------------- 1 file changed, 405 insertions(+), 420 deletions(-) diff --git a/src/routes/self-host/+page.svelte b/src/routes/self-host/+page.svelte index 65dcdba..acbec02 100644 --- a/src/routes/self-host/+page.svelte +++ b/src/routes/self-host/+page.svelte @@ -1,175 +1,180 @@ -
- - -
-
- Self-hosting guide -
-

Host your own ContextVM server

-

- Expose any MCP server to the decentralised Nostr network in minutes. - Pick your path below. -

-
- - -
- -
Choose your approach
- - -
- - - -
- - - {#if activePath === 'cvmi'} -
Step-by-step — CVMI path
-
- -
-
-
1
-
-
-
-

Check prerequisites

-

You need Node.js 18 or higher installed. That's it — no global installs required.

-
-
-
- - - -
- Node.js 18 or higher -
-
-
- - - -
- npm, yarn, pnpm, or bun -
-
-
- Check your Node version: node --version -
-
-
- -
-
-
2
-
-
-
-

Verify CVMI works

-

No installation needed. Run this once to confirm everything is set up correctly.

-
- npx cvmi --help - -
-
- You should see a list of available commands. If you do, you're ready. -
-
-
- -
-
-
3
-
-
-
-

Start your server

-

- This exposes a local filesystem MCP server to the Nostr network. - A cryptographic key pair is auto-generated for you. -

-
- npx cvmi serve -- npx -y @modelcontextprotocol/server-filesystem /tmp - -
-
- Your server's public key (npub1...) will print in the terminal. Save it — you'll need it to connect clients. -
-
-
- -
-
-
4
-
-
-
-

Connect a client

-

From another machine or MCP client, connect using your server's public key.

-
- npx cvmi use npub1q... - -
-
-
- -
-
-
5
-
-
-
-

Optional: configure your server

-

- Create a .cvmi.json in your project folder to set relays, - encryption, and a persistent private key. -

-
{`{
+
+
+ + +
+ + Self-hosting guide + +

+ Host your own ContextVM server +

+

+ Expose any MCP server to the decentralised Nostr network in minutes. + Pick your path below. +

+
+ + +
+ + + + ⚡ CVMI — Quick Setup + + + 🛠 TypeScript SDK + + + + + +

+ The quickest way to get a server running. No code required — CVMI handles + keys, relays, and encryption for you with a single terminal command. +

+ +
+ + +
+
+
+ 1 +
+
+
+
+

Check prerequisites

+

+ You need Node.js 18 or higher installed. That's it — no global installs required. +

+
+
+ + Node.js 18 or higher +
+
+ + npm, yarn, pnpm, or bun +
+
+
+ Check your Node version: node --version +
+
+
+ + +
+
+
+ 2 +
+
+
+
+

Verify CVMI works

+

+ No installation needed. Run this once to confirm everything is set up correctly. +

+
+ npx cvmi --help + +
+
+ You should see a list of available commands. If you do, you're ready. +
+
+
+ + +
+
+
+ 3 +
+
+
+
+

Start your server

+

+ This exposes a local filesystem MCP server to the Nostr network. + A cryptographic key pair is auto-generated for you. +

+
+ npx cvmi serve -- npx -y @modelcontextprotocol/server-filesystem /tmp + +
+
+ Your server's public key (npub1...) will print in the terminal. + Save it — you'll need it to connect clients. +
+
+
+ + +
+
+
+ 4 +
+
+
+
+

Connect a client

+

+ From any machine with CVMI installed, connect to your server using its public key. + This creates a local stdio proxy that bridges your Nostr-hosted server to any + standard MCP client. +

+
+ npx cvmi use npub1q... + +
+
+
+ + +
+
+
+ 5 +
+
+
+

Optional: configure your server

+

+ Create a .cvmi.json in your project folder to use a persistent + private key, specific relays, or required encryption. +

+
{`{
   "serve": {
     "privateKey": "nsec1...",
     "relays": ["wss://relay.damus.io"],
@@ -177,257 +182,237 @@
     "public": true
   }
 }`}
- -
-
- -
- {/if} - - - {#if activePath === 'ts'} -
Step-by-step — TypeScript SDK path
-
- -
-
-
1
-
-
-
-

Install the SDK

-

Add the ContextVM TypeScript SDK to your project.

-
- npm install @contextvm/sdk - -
-
-
- -
-
-
2
-
-
-
-

Understand the core building blocks

-

- Before writing code, get familiar with the three concepts that power every - ContextVM integration: transports, signers, - and relay handlers. -

-
- Start with the - SDK Quick Overview - — it maps out what each module does and how they fit together. -
-
-
- -
-
-
3
-
-
-
-

Choose the right component for hosting

-

Two components handle the server side:

-
-
- NostrMCPGateway - Exposes an existing MCP server to the Nostr network -
-
- NostrMCPProxy - Bridges a Nostr server to a local stdio MCP client -
-
-
- See - Gateway docs - and - Proxy docs - for implementation details. -
-
-
- -
-
-
4
-
-
-
-

Run the client-server tutorial

-

- Work through the hands-on example to see a full server and client - interaction in TypeScript before writing your own. -

-
- Found under Tutorials → - Client-Server Communication - in the docs sidebar. -
-
-
- -
-
-
5
-
-
-
-

Go live

-

- Once built, your server needs a Nostr private key and relay configuration - to go live on the network. Pass keys and relays directly into the SDK's - transport options. -

-
- Want to charge clients for access? Set up - Lightning payments via CEP-8. -
-
-
- -
- {/if} - -
- - -
What's next
-
-
-
Add skills
-

Install reference implementations and templates to accelerate development.

- - Learn about skills → - -
-
-
Publish your server
-

Make your server publicly discoverable on the Nostr network.

- - Server announcements → - -
-
-
Add payments
-

Charge clients for using your server via the Lightning Network.

- - Set up payments → - -
-
- -
-
- - \ No newline at end of file +
+ Full reference: + + docs.contextvm.org/cvmi/configuration + +
+
+
+ +
+ + + + +

+ For building custom servers or embedding ContextVM directly into your application. + The SDK gives you full control over transport, signing, and relay management. +

+ +
+ + +
+
+
+ 1 +
+
+
+
+

Install the SDK

+

+ Add the ContextVM TypeScript SDK to your project. +

+
+ npm install @contextvm/sdk + +
+
+
+ + +
+
+
+ 2 +
+
+
+
+

Understand the core building blocks

+

+ Before writing code, get familiar with the three concepts every ContextVM + integration is built on: transports, signers, + and relay handlers. +

+
+ Start with the + + SDK Quick Overview + + — it maps out what each module does and how they fit together. +
+
+
+ + +
+
+
+ 3 +
+
+
+
+

Choose the right transport for your use case

+

+ The SDK provides two Nostr transports for hosting: +

+
+
+

NostrServerTransport

+

+ Used by MCP servers to expose their capabilities through Nostr. + Use this when building a custom server from scratch. +

+ + Server transport docs → + +
+
+

NostrClientTransport

+

+ Used by MCP clients to connect to remote servers exposed via Nostr. + Use this when building a custom client. +

+ + Client transport docs → + +
+
+
+ If you want to expose an already-existing MCP server to Nostr + without rewriting it, use + NostrMCPGateway + instead. To consume a CVM server in a standard MCP host, use + NostrMCPProxy. +
+
+
+ + +
+
+
+ 4 +
+
+
+
+

Follow the client-server tutorial

+

+ Work through the hands-on example to see a full server and client interaction + in TypeScript before writing your own. +

+
+ Found under Tutorials → + + Client-Server Communication + + in the docs sidebar. +
+
+
+ + +
+
+
+ 5 +
+
+
+

Go live

+

+ Once built, configure your server with a Nostr private key and relay list + and pass them into your transport options to go live on the network. +

+
+ Want to charge clients for access? Set up + + Lightning payments via CEP-8 + . +
+
+
+ +
+
+ + + +
+

+ What's next +

+
+
+

Add skills

+

+ Install reference implementations and templates to accelerate development. +

+ + Learn about skills → + +
+
+

Publish your server

+

+ Make your server publicly discoverable on the Nostr network. +

+ + Server announcements → + +
+
+

Add payments

+

+ Charge clients for using your server via the Lightning Network. +

+ + Set up payments → + +
+
+
+ +
+ +
\ No newline at end of file