viaSocket Help

Python Client Integration


Use the Python client to connect to a viaSocket MCP server for efficient tool management and data access.

#

Installation

To install the required package:

pip install fastmcp

Or with uv support:

uv pip install fastmcp
#

Usage Example

import asyncio
import json
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

# Replace with your Mushroom cluster's MCP Endpoint URL
# Get this from mushroom.viasocket.com → your Cluster → Claude Configuration panel
server_url = "https://mcp.viasocket.com/mcp/YOUR_UNIQUE_ID"
transport = StreamableHttpTransport(server_url)

# Initialize the client
client = Client(transport=transport)

async def main():
    async with client:
        print("Connected to Mushroom MCP:", client.is_connected())

        # List all Mushrooms (apps) your cluster has access to
        tools = await client.list_tools()
        print(f"Available Mushroom tools: {json.dumps([t.name for t in tools], indent=2)}")

        # Example: call a tool from a connected Mushroom app (e.g. Google Sheets)
        result = await client.call_tool(
            "Add New Row To Sheet",
            {
                "spreadsheet_id": "your_spreadsheet_id",
                "sheet_name": "Sheet1",
                "values": ["2026-04-09", "New Lead", "Pending"]
            }
        )
        print("Tool result:", result)

if __name__ == "__main__":
    asyncio.run(main())
#

Notes:

  • Server URL: Copy the MCP Endpoint URL from your Mushroom cluster dashboard — it's unique to your cluster and authorises all its connected apps.

  • list_tools(): Returns every action available across all Mushrooms (apps) in your cluster — one URL, all your apps.

  • call_tool(): Executes a specific action on a connected Mushroom app. Tool names match exactly what you configured in your cluster (e.g. "Add New Row To Sheet", "Send Message", "Create Contact").

This setup will connect to your Mushroom cluster, list all available app tools, and let you call any of them programmatically.