### Demo Setup and Execution Source: https://devfolio.co/projects/tipmd-d033 Instructions to clone the tip.md x402 MCP server repository, install its dependencies, and start the application in demo mode for immediate evaluation. ```bash git clone https://github.com/xR0am/tip-md-x402-mcp-server.git cd tip-md-x402-mcp-server npm install NODE_ENV=demo npm start ``` -------------------------------- ### Local Testing Setup with Node.js Source: https://github.com/supercorp-ai/supergateway Instructions for setting up the local testing environment for Supergateway. This involves installing Node.js (version 24+), installing dependencies, building the project, and running the test suite. A helper script is available for running tests without network access. ```bash nvm install 24 nvm use 24 npm install npm run build npm test ``` -------------------------------- ### Project Setup and Test Commands Source: https://github.com/supercorp-ai/supergateway Standard commands for setting up the Node.js environment, installing dependencies, building the project, and running tests. Ensures the correct Node.js version is used and project assets are compiled. ```shell nvm use 24 npm install npm run build npm test ``` -------------------------------- ### Supergateway CLI Usage Source: https://github.com/supercorp-ai/supergateway Example of how to run the Supergateway command-line interface to start an MCP stdio server. ```bash npx -y supergateway --stdio "uvx mcp-server-git" ``` -------------------------------- ### Install and Run Supergateway Source: https://github.com/supercorp-ai/supergateway This snippet demonstrates how to install and run Supergateway using npx. It includes common command-line options for specifying the stdio command, SSE/Streamable HTTP URLs, output transport, port, and base URL. ```shell npx -y supergateway --stdio "uvx mcp-server-git" # Options: # --stdio "command": Command that runs an MCP server over stdio # --sse "URL": SSE URL to connect to (SSE→stdio mode) # --streamableHttp "URL": Streamable HTTP URL to connect to (StreamableHttp→stdio mode) # --outputTransport stdio | sse | ws | streamableHttp: Output MCP transport (default: sse with --stdio, stdio with --sse or --streamableHttp) # --port 8000: Port to listen on (stdio→SSE or stdio→WS mode, default: 8000) # --baseUrl "URL": Base URL for SSE or WS clients (stdio→SSE or stdio→WS mode) ``` -------------------------------- ### Supergateway Installation for Claude Desktop Source: https://context7_llms Command to install Supergateway globally via npm, which is required to bridge tip.md's HTTP-stream MCP transport to Claude Desktop's stdio transport. ```bash npm install -g supergateway ``` -------------------------------- ### Run Supergateway with Deno Dependency Source: https://github.com/supercorp-ai/supergateway Starts the Supergateway Docker image with Deno support, allowing execution of Deno-based MCP servers, demonstrated with a Drupal integration example. ```shell docker run -it --rm -p 8000:8000 supercorp/supergateway:deno \ --stdio "deno run -A jsr:@omedia/mcp-server-drupal --drupal-url https://your-drupal-server.com" ``` -------------------------------- ### stdio → SSE Example Source: https://github.com/supercorp-ai/supergateway Demonstrates how to expose an MCP stdio server as an SSE server using the supergateway CLI. This example configures the server to listen on port 8000, defines paths for SSE and messages, and sets up basic HTTP routing. ```shell npx -y supergateway \ --stdio "npx -y @modelcontextprotocol/server-filesystem ./my-folder" \ --port 8000 --baseUrl http://localhost:8000 \ --ssePath /sse --messagePath /message ``` -------------------------------- ### Example: Supergateway with MCP Inspector (stdio → SSE) Source: https://github.com/supercorp-ai/supergateway Demonstrates running Supergateway in stdio→SSE mode and then using the MCP Inspector CLI to interact with the exposed MCP server. ```bash # 1. Run Supergateway: npx -y supergateway --port 8000 \ --stdio "npx -y @modelcontextprotocol/server-filesystem /Users/MyName/Desktop" # 2. Use MCP Inspector in another terminal: npx @modelcontextprotocol/inspector # Now you can list tools, resources, or perform MCP actions via Supergateway. ``` -------------------------------- ### Farcaster Frame SDK Example Source: https://context7_llms Illustrates the use of the Farcaster Frame SDK for building interactive experiences within the Farcaster ecosystem. ```javascript // Example usage of @farcaster/frame-sdk // This is a placeholder as the full SDK usage is extensive. // Refer to the official SDK documentation for detailed examples. ``` -------------------------------- ### NPX-based MCP Server Configuration Source: https://github.com/supercorp-ai/supergateway Example JSON configuration for setting up MCP servers, likely used with a tool like Supergateway. ```json { "mcpServers": { "mcpServer": { "provider": "openai", "model": "gpt-4", "context": "You are a helpful assistant." } } } ``` -------------------------------- ### NPX-based MCP Server Configuration Example Source: https://github.com/supercorp-ai/supergateway Configuration snippet defining an MCP server using NPX, specifying the Supergateway command and arguments for SSE communication. ```json { "mcpServers": { "supermachineExampleNpx": { "command": "npx", "args": [ "-y", "supergateway", "--sse", "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app" ] } } } ``` -------------------------------- ### Run Supergateway with uvx Dependency Source: https://github.com/supercorp-ai/supergateway This command executes the Supergateway image tagged with `uvx`, which includes uv/uvx. It maps port 8000 and starts an MCP server configured to run `uvx mcp-server-fetch`. This setup allows direct interaction with uvx from within the container. ```shell docker run -it --rm -p 8000:8000 supercorp/supergateway:uvx \ --stdio "uvx mcp-server-fetch" ``` -------------------------------- ### NPX-based MCP Server for Cursor Configuration Source: https://github.com/supercorp-ai/supergateway Configuration example for setting up an MCP server via NPX for use with Cursor, utilizing Supergateway's SSE mode. ```json { "mcpServers": { "cursorExampleNpx": { "command": "npx", "args": [ "-y", "supergateway", "--sse", "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app" ] } } } ``` -------------------------------- ### Run Project Tests with Node.js Source: https://github.com/supercorp-ai/supergateway Instructions to set up the Node.js environment and execute the project's test suite. This process requires Node.js version 24 or higher, managed via nvm, followed by dependency installation, build, and test execution. ```shell nvm install 24 nvm use 24 npm install npm run build npm test ``` -------------------------------- ### Docker-based MCP Server Configuration Example Source: https://github.com/supercorp-ai/supergateway Configuration snippet defining an MCP server using Docker, specifying the Supergateway image and arguments for SSE communication. ```json { "mcpServers": { "supermachineExampleDocker": { "command": "docker", "args": [ "run", "-i", "--rm", "supercorp/supergateway", "--sse", "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app" ] } } } ``` -------------------------------- ### Run Supergateway with Filesystem Server Source: https://github.com/supercorp-ai/supergateway Starts the Supergateway on a specified port and connects it to a local filesystem server. This command is used to make local files accessible through the Supergateway. ```shell npx -y supergateway --port 8000 \ --stdio "npx -y @modelcontextprotocol/server-filesystem /Users/MyName/Desktop" ``` -------------------------------- ### Run Official Supergateway Docker Image Source: https://github.com/supercorp-ai/supergateway Executes the official Supergateway Docker image, mapping port 8000 and starting an MCP server using the filesystem module via stdio. ```shell docker run -it --rm -p 8000:8000 supercorp/supergateway \ --stdio "npx -y @modelcontextprotocol/server-filesystem /" \ --port 8000 ``` -------------------------------- ### Expose Supergateway with ngrok Source: https://github.com/supercorp-ai/supergateway Demonstrates how to use ngrok to expose a locally running Supergateway server to the public internet. This involves starting the Supergateway and then using ngrok to tunnel HTTP traffic to the gateway's port. ```shell npx -y supergateway --port 8000 --stdio "npx -y @modelcontextprotocol/server-filesystem ." # In another terminal: ngrok http 8000 ``` -------------------------------- ### Start Local HTTP Server Source: https://nodejs.org/ This snippet demonstrates how to start a simple HTTP server locally using Node.js. It listens on port 3000 and logs a confirmation message to the console. It requires Node.js to run. ```JavaScript // starts a simple http server locally on port 3000 server.listen(3000, '127.0.0.1', () => { console.log('Listening on 127.0.0.1:3000'); }); // run with `node server.mjs` ``` -------------------------------- ### Running Supergateway with Docker Source: https://github.com/supercorp-ai/supergateway Information on using Docker for a Supergateway workflow, avoiding local Node.js setup. Provides links to Docker images on Docker Hub and GHCR. ```bash # Docker image available at: # Docker Hub: https://hub.docker.com/r/supercorp/supergateway # GHCR: https://github.com/supercorp-ai/supergateway/pkgs/container/supergateway # Example Docker run command (conceptual): docker run -p 8000:8000 supercorp/supergateway --stdio "" ``` -------------------------------- ### Run Deno MCP Server Source: https://github.com/supercorp-ai/supergateway Executes the MCP server using Deno with a specified Drupal URL. This command requires Deno to be installed and configured. ```shell deno run -A jsr:@omedia/mcp-server-drupal --drupal-url https://your-drupal-server.com ``` -------------------------------- ### tip.md MCP Service Setup for Sage App Source: https://context7_llms Instructions for adding tip.md's MCP service to the Sage AI application. This involves configuring the server details within Sage's MCP settings. ```json { "serverName": "tip.md", "endpointURL": "https://mcp.tip.md/mcp" } ``` -------------------------------- ### Update Supergateway Source: https://context7_llms Updates the globally installed Supergateway package to its latest version to ensure compatibility and access to new features. ```shell npm update -g supergateway ``` -------------------------------- ### Hackathon Demo Flow Source: https://devfolio.co/projects/tipmd-d033 A step-by-step example of a user interaction with an AI agent that utilizes tip.md for tipping, demonstrating the payment collection and disbursement process. ```markdown User: "Check my balance" AI Agent: "47.50 USDC available for tipping" User: "Tip @username 5 USDC" AI Agent: Uses x402 to collect payment → CDP auto-splits → "✅ Sent 5 USDC to @username" ``` -------------------------------- ### Node.js File Hashing Example Source: https://nodejs.org/ Demonstrates how to hash a file using Node.js's built-in 'crypto' module. It reads the 'package.json' file and computes its hash. ```javascript // ensure you have a `package.json` file for this test! hasher.write(await readFile("package.json")); hasher.end(); ``` -------------------------------- ### Run Base Supergateway Docker Image Source: https://github.com/supercorp-ai/supergateway This command runs the default Supergateway Docker image, mapping host port 8000 to the container's port 8000. It starts an MCP server using `npx` to serve the filesystem from the container's root directory. The `--rm` flag ensures the container is removed upon exit, and `-it` provides an interactive terminal. ```shell docker run -it --rm -p 8000:8000 supercorp/supergateway \ --stdio "npx -y @modelcontextprotocol/server-filesystem /" \ --port 8000 ``` -------------------------------- ### LLM Tool Command-Line Arguments Source: https://github.com/supercorp-ai/supergateway This section details the available command-line arguments for configuring the LLM processing tool. These options control various aspects of server setup, communication paths, logging, and security, enabling flexible integration with different protocols and modes. ```APIDOC --ssePath - Description: Path for SSE subscriptions. - Mode: stdio→SSE mode. - Default: /sse --messagePath - Description: Path for messages. - Mode: stdio→SSE or stdio→WS mode. - Default: /message --streamableHttpPath - Description: Path for Streamable HTTP. - Mode: stdio→Streamable HTTP mode. - Default: /mcp --stateful - Description: Run stdio→Streamable HTTP in stateful mode. --sessionTimeout - Description: Session timeout in milliseconds. - Constraint: Stateful stdio→Streamable HTTP mode only. --header
- Description: Add one or more headers. - Usage: Can be used multiple times. - Modes: stdio→SSE, SSE→stdio, or Streamable HTTP→stdio mode. - Example: --header "x-user-id: 123" --oauth2Bearer - Description: Adds an Authorization header with the provided Bearer token. --logLevel - Description: Controls logging level. - Options: debug, info, none. - Default: info. - Note: 'debug' for verbose logs, 'none' to suppress logs. --cors [...] - Description: Enable Cross-Origin Resource Sharing. - Usage: Use without values to allow all origins, or supply one or more allowed origins. - Example: --cors "http://example.com" or --cors "/example\\.com$/" (for regex matching). - Modes: stdio→SSE or stdio→WS mode. --healthEndpoint - Description: Register one or more endpoints that respond with "ok". - Usage: Can be used multiple times. - Modes: stdio→SSE or stdio→WS mode. ``` -------------------------------- ### Node.js Stream Processing Example Source: https://nodejs.org/ Shows how to use Node.js streams to create read and write streams. This example imports `createReadStream` and `createWriteStream` from the 'node:fs' module. ```javascript import { createReadStream, createWriteStream } from "node:fs"; ``` -------------------------------- ### Run Supergateway for HTTP-Stream to Stdio Source: https://context7_llms Executes the Supergateway command-line tool to bridge HTTP-stream transport to stdio, enabling communication with applications like Claude Desktop. ```bash npx -y supergateway --httpStream "https://mcp.tip.md/mcp" --outputTransport stdio ``` -------------------------------- ### Configure Claude Desktop MCP Server Source: https://context7_llms Modifies the Claude Desktop configuration file to register a new MCP server, specifying the command and arguments for Supergateway. ```json { "mcpServers": { "tip-md-mcp": { "command": "npx", "args": [ "-y", "supergateway", "--httpStream", "https://mcp.tip.md/mcp", "--outputTransport", "stdio" ] } } } ``` -------------------------------- ### Transaction Data Example Source: https://devfolio.co/projects/tipmd-d033 An example JSON output representing a successful tip transaction processed by tip.md. It details the operation, sender, recipient, amounts (including platform fees), network, protocol, transaction hashes, and timestamp. ```json { "success": true, "operation": "x402_tip", "data": { "senderUserId": "tip.md_user_4894447f9ba1ea89", "recipientUsername": "xR0am", "amounts": { "total": 1, "recipient": 0.96, "platformFee": 0.04, "platformFeePercentage": 4 }, "network": "base", "protocol": "x402", "transactions": { "recipient": "0x6aed6422c0bf6ac8825fdc4b258d85d183034caf3ef7379d692b4832432e9278", "platform": "0x1a2e31be01473c51a20ac03a385610675b6e92f758adfcbc36204ec8bf6130a3" }, "timestamp": "2025-06-23T18:57:57.690Z" }, "message": "Tip sent successfully - paid via x402 protocol and distributed using CDP Wallet API" } ``` -------------------------------- ### Build and Run Supergateway Docker Image Source: https://github.com/supercorp-ai/supergateway Builds the Supergateway Docker image using a provided Dockerfile and then runs it, exposing port 8000 and piping stdio for server-filesystem. ```shell docker build -f docker/base.Dockerfile -t supergateway . docker run -it --rm -p 8000:8000 supergateway --stdio "npx -y @modelcontextprotocol/server-filesystem ." ``` -------------------------------- ### Compare Funding Models: Traditional vs. tip.md Source: https://devfolio.co/projects/tipmd-d033 This snippet illustrates the fundamental difference between traditional, batch-based open-source funding and the real-time, social-driven model offered by tip.md. It highlights the shift from lengthy approval processes to instant, continuous support based on social discovery. ```text Traditional: Code → Wait Months → Committee Review → Large Payment tip.md: Code → Social Discovery → Instant Tips → Continuous Support ``` -------------------------------- ### Integration with ngrok for Public Access Source: https://github.com/supercorp-ai/supergateway Shows how to use ngrok to expose a locally running Supergateway server to the public internet, facilitating remote access. ```bash # Run Supergateway locally: npx -y supergateway --port 8000 --stdio "npx -y @modelcontextprotocol/server-filesystem ." # In another terminal, start ngrok: ngrok http 8000 # ngrok will provide a public URL (e.g., https://.ngrok-free.app/sse) for remote access. ``` -------------------------------- ### Run Supergateway with UVX Dependency Source: https://github.com/supercorp-ai/supergateway Launches the Supergateway Docker image with UVX pre-installed, enabling direct calls to the 'uvx' command for MCP server fetching. ```shell docker run -it --rm -p 8000:8000 supercorp/supergateway:uvx \ --stdio "uvx mcp-server-fetch" ``` -------------------------------- ### Run Supergateway with Deno Dependency Source: https://github.com/supercorp-ai/supergateway This command launches the Supergateway Docker image tagged `deno`, pre-configured with Deno. It maps port 8000 and initiates an MCP server using Deno to run a Drupal server. The `--drupal-url` parameter specifies the target Drupal server address. ```shell docker run -it --rm -p 8000:8000 supercorp/supergateway:deno \ --stdio "deno run -A jsr:@omedia/mcp-server-drupal --drupal-url https://your-drupal-server.com" ``` -------------------------------- ### Node.js Stream Pipeline with Gzip Source: https://nodejs.org/ Demonstrates using the pipeline function from node:stream/promises to pipe data through createReadStream, createGzip, and createWriteStream. This example requires a 'package.json' file in the same directory to be compressed. ```javascript import { pipeline } from "node:stream/promises"; import { createGzip } from "node:zlib"; // ensure you have a `package.json` file for this test! await pipeline( createReadStream('package.json'), createGzip(), createWriteStream('package.json.gz') ); ``` -------------------------------- ### Supergateway CLI Options Documentation Source: https://github.com/supercorp-ai/supergateway Details common command-line flags for configuring Supergateway's behavior, including session management, headers, logging, CORS, and health endpoints. ```APIDOC Supergateway CLI Options: --sessionTimeout Description: Sets the session timeout duration in milliseconds. Applicable only in stateful stdio to Streamable HTTP mode. Example: --sessionTimeout 60000 --header ": " Description: Adds a custom HTTP header to requests. Can be used multiple times. Supported in stdio→SSE, SSE→stdio, and Streamable HTTP→stdio modes. Example: --header "x-user-id: 123" --oauth2Bearer "" Description: Adds an 'Authorization: Bearer ' header to requests. Useful for authentication. Example: --oauth2Bearer "some-access-token" --logLevel Description: Controls the verbosity of logging. Levels include 'debug' (most verbose), 'info' (default), and 'none' (suppress logs). Example: --logLevel debug --cors ["" "" ...] Description: Enables Cross-Origin Resource Sharing (CORS). If no origins are provided, all origins are allowed. Accepts specific origins or regex patterns. Example: --cors "http://example.com" --cors "/example\.com$/" --healthEndpoint Description: Registers one or more endpoints that respond with 'ok' to health checks. Can be used multiple times. Example: --healthEndpoint /healthz ``` -------------------------------- ### Supergateway Command-Line Options Source: https://github.com/supercorp-ai/supergateway Documentation for the Supergateway command-line interface, detailing available options for configuring server behavior, transport protocols, and network paths. ```APIDOC Supergateway CLI Options: --stdio "command" - Description: Command that runs an MCP server over stdio. - Example: "uvx mcp-server-git" --sse "URL" - Description: SSE URL to connect to (SSE→stdio mode). - Example: "https://mcp-server-ab71a6b2-cd55-49d0-adba-562bc85956e3.supermachine.app" --streamableHttp "URL" - Description: Streamable HTTP URL to connect to (StreamableHttp→stdio mode). - Example: "https://mcp-server.example.com/mcp" --outputTransport "transport" - Description: Output MCP transport. Options: stdio, sse, ws, streamableHttp. - Default: 'sse' with --stdio, 'stdio' with --sse or --streamableHttp. --port "port" - Description: Port to listen on (stdio→SSE or stdio→WS mode). - Default: 8000. --baseUrl "URL" - Description: Base URL for SSE or WS clients (stdio→SSE mode). - Optional. - Example: "http://localhost:8000" --ssePath "path" - Description: Path for SSE subscriptions (stdio→SSE mode). - Default: "/sse". --messagePath "path" - Description: Path for messages (stdio→SSE or stdio→WS mode). - Default: "/message". --streamableHttpPath "path" - Description: Path for Streamable HTTP (stdio→Streamable HTTP mode). - Default: "/mcp". --stateful - Description: Run stdio→Streamable HTTP in stateful mode. ``` -------------------------------- ### Initialize Rudderstack Analytics with JavaScript Source: https://devfolio.co/projects/tipmd-d033 This snippet loads the Rudderstack JavaScript SDK and initializes it with your project's write key and data plane URL. It ensures the analytics object is available globally for tracking user events. ```javascript var e=window.rudderanalytics=window.rudderanalytics||[]; e.methods=["load","page","track","identify","alias","group","ready","reset","getAnonymousId","setAnonymousId"]; e.factory=function(t){return function(){var r=Array.prototype.slice.call(arguments);r.unshift(t),e.push(r),e}}; for(var t=0;t Tip with Crypto ``` ```markdown [![Tip with Crypto](https://tip.md/button.svg)](https://tip.md/your-username) ``` -------------------------------- ### JavaScript: Docusaurus Theme and Data Attribute Handling Source: https://mcp-framework.com/ These JavaScript snippets handle Docusaurus theme management and dynamic data attribute setting. The first part reads a 'docusaurus-theme' parameter from the URL or local storage to set the document's theme. The second part iterates through URL parameters starting with 'docusaurus-data-' and applies them as data attributes to the document element. ```JavaScript !function(){ function t(t){ document.documentElement.setAttribute("data-theme",t) } var e=function(){ try{ return new URLSearchParams(window.location.search).get("docusaurus-theme") }catch(t){} }() || function(){ try{ return window.localStorage.getItem("theme") }catch(t){} }(); t(null!==e?e:"light") }() ,function(){ try{ const n=new URLSearchParams(window.location.search).entries(); for(var [t,e]of n) if(t.startsWith("docusaurus-data-")){ var a=t.replace("docusaurus-data-","data-"); document.documentElement.setAttribute(a,e) } }catch(t){} }() ``` -------------------------------- ### Run MCP Remote Client Source: https://context7_llms Connects to an MCP service endpoint using the `@modelcontextprotocol/remote` package via the `mcp-remote` command. ```shell npx -y --package=@modelcontextprotocol/remote mcp-remote https://mcp.tip.md/mcp ``` -------------------------------- ### Create Node.js HTTP Server Source: https://nodejs.org/ This snippet demonstrates how to create a basic HTTP server using Node.js. It includes setting the response status code and headers, and sending a 'Hello World!' message. The server listens on a default port. ```javascript const server = createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello World!\n'); }); // Assuming createServer is available in the scope, e.g., from 'http' module // server.listen(3000, () => { // console.log('Server running on port 3000'); // }); ```