Vibespace Experience
STDIOMCP implementation for managing vibes and worlds with real-time NATS streaming.
MCP implementation for managing vibes and worlds with real-time NATS streaming.
An MCP (Model Context Protocol) experience implementation for managing vibes and worlds with real-time NATS streaming.
vibespace MCP Experience is a Go implementation of a Model Context Protocol experience that provides resources and tools for managing "vibes" (emotional atmospheres) and "worlds" (physical or virtual spaces). The server uses custom URI schemes (vibe://
and world://
) to access resources and supports JSON-RPC methods for communication.
You can add this package to your Go project using:
go get github.com/bmorphism/vibespace-mcp-go
To run the server:
just run
Or build and run manually:
just build ./bin/vibespace-mcp
The repository includes an example NATS subscriber to listen for world moments:
cd examples ./run_nats_subscriber.sh [nats-url] [stream-id] [user-id]
Parameters:
nats-url
: NATS server URL (defaults to nats://nonlocal.info:4222
)stream-id
: Stream ID for subject namespacing (defaults to ies
)user-id
: Optional user ID for user-specific streamsThe server includes comprehensive tests for all functionality:
# Run all tests just test # Run a specific test suite just test-suite hybrid # Generate test coverage report just coverage
See TESTING.md for detailed information about the testing approach and available test suites.
The server implements the Model Context Protocol providing:
vibe://list
, vibe://{id}
, world://list
, world://{id}
, world://{id}/vibe
create_vibe
, update_vibe
, delete_vibe
create_world
, update_world
, delete_world
, set_world_vibe
streaming_startStreaming
, streaming_stopStreaming
, streaming_status
, streaming_streamWorld
, streaming_updateConfig
For more details on the streaming capabilities, see STREAMING.md.
The vibespace MCP experience provides clear documentation and helper utilities for JSON-RPC method names, preventing common issues with method name mismatches. See RPC_METHODS.md for complete method reference.
Use the standard method name constants from the rpcmethods
package in your code:
import "github.com/bmorphism/vibespace-mcp-go/rpcmethods" // Standard method names const ResourceReadMethod = rpcmethods.MethodResourceRead // "method.resource.read" const ToolCallMethod = rpcmethods.MethodToolCall // "method.tool.call"
The rpcmethods
package provides utilities to simplify JSON-RPC interactions:
// For formatting proper JSON-RPC requests resourceRequest := rpcmethods.FormatResourceRequest("world://list", "request-id") toolRequest := rpcmethods.FormatToolRequest("create_world", worldArgs, "request-id") // For discovering method names methods := rpcmethods.ListMethods() info := rpcmethods.GetMethodInfo("method.resource.read") suggestions := rpcmethods.GetMethodSuggestions("resource.read") // Gives helpful suggestions
If you use an incorrect method name, the server will suggest the correct method:
Error: Method 'resource.read' not found. Did you mean: method.resource.read?
Some tests are currently skipped due to JSON-RPC method compatibility issues with the current version of the MCP-Go library. This affects the journey and server integration tests, but our method name handling improvements should resolve most issues for clients.
Here's how the Topos team can leverage the vibespace MCP experience to create a cohesive team environment while working in different tools:
Members of Team Topos are distributed across tools: Alice (using Claude Desktop), Bob (using Goose MCP client), and Carol (using VS Code with Claude). They want to maintain a sense of "vibing together" while developing categorical network models across different interfaces.
Setup:
nats://nonlocal.info:4222
handles real-time streamingStep 1: Creating the Team Topos World
Alice initializes the Team Topos world through Claude Desktop:
// Alice creates the Team Topos world const response = await mcp.tools.create_world({ name: "Team Topos Workspace", description: "A shared categorical space for infinity-topos development", type: "hybrid", features: ["categorical-thinking", "research-sharing", "presence-indication", "distributed-computation"], sharingSettings: { isPublic: false, allowedUsers: ["alice@topos", "bob@topos", "carol@topos"], contextLevel: "full" } }); // Alice sets the initial team vibe await mcp.tools.set_world_vibe({ worldId: response.id, vibeId: "categorical-flow-state" }); console.log(`Join our Team Topos workspace with ID: ${response.id}`);
Step 2: Joining the Team Topos Workspace
Bob connects through the Goose MCP client:
# Bob connects to Team Topos with his user ID world_id = "topos_world_123" # ID shared by Alice client.streaming_startStreaming( url="nats://nonlocal.info:4222", stream_id="team-topos", world_id=world_id, user_id="bob@topos" ) # Bob indicates he's working on sheaf theory implementation client.update_world_feature( world_id=world_id, feature_name="research-focus", feature_value="Sheaf cohomology for network models" ) # Bob shares his computational resources client.update_world_feature( world_id=world_id, feature_name="shared-computation", feature_value={"available_cores": 16, "gpu_memory": "24GB"} )
Carol joins through VS Code with Claude:
// Carol connects to Team Topos from VS Code const connection = await mcpClient.connect({ worldId: "topos_world_123", userId: "carol@topos", streamId: "team-topos", statusCallback: (status) => { vscode.window.setStatusBarMessage(`⊤ Team Topos: ${status.connectedUsers.length} members active`); } }); // Carol shares her current research direction await mcpClient.tools.update_world_feature({ worldId: "topos_world_123", featureName: "active-models", featureValue: ["dynamic-markov-blankets", "hypergraph-topologies"] }); // Carol updates the shared mathematical context await mcpClient.tools.update_vibe({ worldId: "topos_world_123", attribute: "mathematical-coherence", value: 92 // Scale 0-100 indicating conceptual clarity });
Step 3: Experiencing Shared Topos Development
As the team works:
Alice sees real-time visualizations in Claude Desktop showing which categorical constructs Bob and Carol are exploring, with directed graphs of collaboration paths
Bob receives ambient notifications in Goose when Alice or Carol make mathematical breakthroughs, with the interface subtly reflecting the team's collective understanding through topological visualizations
Carol sees VS Code extensions automatically activating based on the team's current focus areas, with sidebar indicators showing which mathematical domains are being actively explored
All three experience synchronized development environments with:
The vibespace MCP experience enables:
Step 4: Leveraging Binary and Balanced Ternary Data
As the team works on advanced mathematical models, they use the binary and balanced ternary features:
// Carol shares balanced ternary data representing a categorical network structure const ternaryEncoding = "10T01T001T10T01"; // Balanced ternary representing network topology await mcpClient.tools.streaming_streamWorld({ worldId: "topos_world_123", userId: "carol@topos", customData: { action: "share_mathematical_model", modelName: "HypergraphCohomology" }, // Add balanced ternary data representing the mathematical structure balancedTernaryData: ternaryEncoding });
Bob processes the mathematical structure using Python:
# Bob subscribes to the moment and extracts balanced ternary data def on_world_moment(message): moment = json.loads(message.data.decode()) if moment.get("binaryData") and moment["binaryData"]["format"] == "application/balanced-ternary": # Extract balanced ternary representation binary_data = base64.b64decode(moment["binaryData"]["data"]) # Calculate how many trits were encoded (each 4 trits use 1 byte) num_trits = len(binary_data) * 4 # Convert back to ternary representation ternary_data = bytes_to_ternary(binary_data, num_trits) # Process mathematical structure if "HypergraphCohomology" in moment.get("customData", {}).get("modelName", ""): process_categorical_network(ternary_data) # Convert binary to balanced ternary (Python implementation) def bytes_to_ternary(bytes_data, num_trits): result = [] for i in range(min(num_trits, len(bytes_data) * 4)): byte_idx = i // 4 trit_pos = i % 4 # Extract 2 bits representing this trit bits = (bytes_data[byte_idx] >> (trit_pos * 2)) & 0b11 # Map bits to trits: 00->-1, 01->0, 10->1 if bits == 0: result.append(-1) # 'T' elif bits == 1: result.append(0) # '0' elif bits == 2: result.append(1) # '1' else: result.append(0) # Invalid pattern, default to 0 return result
Alice uses the data to visualize the categorical network:
// Alice subscribes to world moments and extracts mathematical models natsClient.subscribe(`${streamId}.world.moment.${worldId}`, (msg) => { const moment = JSON.parse(msg.data); // Check for balanced ternary data if (moment.binaryData && moment.binaryData.format === "application/balanced-ternary") { // Decode the binary data const binaryData = atob(moment.binaryData.data); // Base64 decode // Create a Uint8Array from the binary string const bytes = new Uint8Array(binaryData.length); for (let i = 0; i < binaryData.length; i++) { bytes[i] = binaryData.charCodeAt(i); } // Convert to balanced ternary const ternaryData = bytesToTernary(bytes, bytes.length * 4); // Visualize the mathematical structure visualizeCategoricalNetwork(ternaryData); } }); // Convert binary to balanced ternary (JavaScript implementation) function bytesToTernary(bytes, numTrits) { const result = []; for (let i = 0; i < Math.min(numTrits, bytes.length * 4); i++) { const byteIdx = Math.floor(i / 4); const tritPos = i % 4; // Extract the trit value (2 bits) const bits = (bytes[byteIdx] >> (tritPos * 2)) & 0b11; // Map bit patterns to trits if (bits === 0) { result.push(-1); // 'T' } else if (bits === 1) { result.push(0); // '0' } else if (bits === 2) { result.push(1); // '1' } else { result.push(0); // Invalid pattern, default to 0 } } return result; }
Benefits for Team Topos:
This example demonstrates how vibespace MCP experience enables Team Topos to collaboratively explore mathematical structures across different tools and interfaces, creating a shared cognitive space that transcends individual environments.