Hello World Tangle Blueprint 🌐
LocalAbout Hello World Tangle Blueprint 🌐
This Tangle Network blueprint deploys configured remote MCP services across Python, JavaScript, and Docker runtimes. It allocates ports automatically, converts stdio transport to SSE, and serves HTTP endpoints protected by token authentication.
Key features
- 01Supports Python, JavaScript, and Docker
- 02Allocates ports and injects PORT automatically
- 03Converts stdio transport to SSE
- 04Provides HTTP endpoints and bidirectional message forwarding
- 05Generates access tokens through a challenge-response flow
Use cases
- 01Deploy remote MCP services on Tangle Network
- 02Connect a stdio service to HTTP clients
- 03Configure and launch MCP services across runtimes
MCP support
The blueprint deploys configured MCP service instances and exposes them over SSE for MCP clients, with token-based access authentication.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Blueprint for Tangle Network 🌐
� Project Overview & Purpose
This project is a blueprint for Tangle Network, designed to run remote MCPs (Model Context Protocol) services. When requesting a new instance of this blueprint, users get a new service instance with a specified configuration file that enables seamless MCP server deployment and management.
Blueprints are specifications for AVSs on the Tangle Network. An AVS is an off-chain service that runs arbitrary computations for a user-specified period of time. This MCP Blueprint provides a powerful abstraction for deploying and managing MCP servers across different runtime environments, allowing developers to create reusable MCP service infrastructures.
For more details about Tangle Network Blueprints, please refer to the project documentation.
⚙️ Configuration Details
The blueprint supports configurations for various runtimes with automatic port management. All runtimes are internally converted to SSE (Server-Sent Events) for HTTP-based communication:
Supported Runtimes
- STDIO transport in JavaScript (bun runtime): Executes MCP servers using
bunxwith automatic bun installation if needed - STDIO transport in Python (python3): Executes MCP servers using
uvxwith automatic uv installation if needed - Docker containers: Runs MCP servers in Docker containers with intelligent port discovery, automatic port allocation, and environment variable injection
Port Management & Transport Conversion
The blueprint automatically manages port allocation and converts all runtime configurations to SSE transport:
Automatic Port Management:
- Ports are automatically allocated using the system's available port detection
- The
PORTenvironment variable is automatically injected into all MCP servers - MCP servers must bind to the port specified in the
PORTenvironment variable - No manual port configuration required in blueprint requests
Transport Conversion:
- HTTP-based communication for web clients
- Bidirectional message forwarding between STDIO and SSE transports
- Real-time streaming via Server-Sent Events
- POST endpoint for client message submission
🔐 Authentication Workflow
The authentication workflow uses the script generate-auth-token.ts to generate an access token through a challenge-response mechanism:
- Challenge Request: Client sends public key and key type to
/v1/auth/challenge - Challenge Response: Server returns a cryptographic challenge with expiration
- Signature Generation: Client signs the challenge using their private key
- Token Verification: Client submits signature to
/v1/auth/verifyendpoint - Access Token: Server returns a time-limited access token
Authentication is performed via an Authorization header when accessing the MCP server URL. The token format is {token_id}|{token_string}.
📋 Changelog & Breaking Changes
⚠️ Breaking Changes: Recent updates introduce automatic port management. See CHANGELOG.md for detailed migration instructions and examples.
Key Changes:
- Removed
portBindingsfield from configuration - Added automatic
PORTenvironment variable injection - MCP servers must now read port from
PORTenvironment variable
🚀 Usage Examples & Demos
Sample Configurations
The fixtures directory contains sample configurations for different runtime types:
fixtures/00_mcp_python3.json: Python MCP server configurationfixtures/01_mcp_js.json: JavaScript MCP server with Context7 packagefixtures/02_mcp_local_docker.json: Local Docker MCP server with Redis environmentfixtures/03_tangle_mcp_docker.json: Tangle-specific Docker MCP configuration
Note: All sample configurations use the new format without
portBindings. Port allocation is handled automatically by the blueprint.
Local Setup
To run the setup locally, follow the detailed instructions in DEMO.md. The demo covers:
- Starting Tangle network locally
- Spawning the blueprint service
- Requesting a new blueprint instance
- Accepting the service request
- Starting the MCP server
- Generating authentication tokens
- Testing with MCP Inspector
Internal Workflow
For a detailed understanding of the internal workflow, see mcp-blueprint-flowchart.md, which provides a comprehensive flowchart showing:
- User request flow and configuration processing
- Runtime detection and package management
- Transport conversion from STDIO to SSE
- Server initialization and endpoint provision
- Authentication and client connection handling
🔄 Workflow Description
The blueprint process follows this high-level workflow:
- Request Reception: Receives a remote MCP request with configuration parameters
- Configuration Processing: Analyzes runtime type, package/image, and environment variables
- Port Allocation: Automatically allocates an available port and injects it as
PORTenvironment variable - Runtime Initialization:
- Python: Installs/uses
uvfor package management and execution - JavaScript: Installs/uses
bunfor package management and execution - Docker: Pulls images, inspects for exposed ports, and creates containers with intelligent port binding
- Python: Installs/uses
- Transport Setup: Converts STDIO communication to SSE for HTTP compatibility
- Endpoint Exposure: Provides HTTP URL with
/sseand/messageendpoints - Authentication: Secures access through token-based authentication system
- Client Interaction: Enables MCP clients to connect and communicate via HTTP/SSE
📋 Prerequisites
Before you can run this project, you will need to have the following software installed on your machine:
You will also need to install cargo-tangle, our CLI tool for creating and deploying Tangle Blueprints:
To install the Tangle CLI, run the following command:
Supported on Linux, MacOS, and Windows (WSL2)
cargo install cargo-tangle --git https://github.com/tangle-network/blueprint
✨ Key Features
Automatic Port Management
- Zero Configuration: No need to specify port bindings in configuration files
- Conflict Prevention: Automatic port allocation prevents port conflicts
- Environment Injection:
PORTenvironment variable automatically provided to MCP servers - Universal Compatibility: Works across all runtime types (Python, JavaScript, Docker)
- Intelligent Docker Handling: Automatically discovers exposed ports from Docker images and configures port mapping only when needed
Enhanced Security & Reliability
- Simplified Configuration: Reduced attack surface through automatic port management
- Process Lifecycle: Proper cleanup and container management
- Error Handling: Comprehensive error handling for port allocation failures
🛠️ Development
Once you have the prerequisites installed, you can build and deploy the project:
cargo build
to build the project, and
cargo tangle blueprint deploy
to deploy the blueprint to the Tangle network.
Quick Reference for MCP Server Developers
When developing MCP servers for this blueprint:
- Read Port from Environment: Always use
process.env.PORT(JS) oros.environ['PORT'](Python) - Bind to All Interfaces: Use
0.0.0.0or127.0.0.1as the host - No Port Configuration: Remove any hardcoded ports from your server
- Test Locally: Set
PORT=3000environment variable for local testing
# Testing your MCP server locally
export PORT=3000
your-mcp-server-command
📜 License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
📬 Feedback and Contributions
We welcome feedback and contributions to improve this blueprint. Please open an issue or submit a pull request on our GitHub repository. Please let us know if you fork this blueprint and extend it too!
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.