FAQ
MCP Server
Python Client Integration

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 viaSocket MCP server URL
server_url = "https://mcp.viasocket.com/****************/sse"
transport = StreamableHttpTransport(server_url)

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

async def main():
    async with client:
        print("Client connected:", client.is_connected())

        # Fetch available tools
        tools = await client.list_tools()
        print(f"Available tools: {json.dumps([t.name for t in tools], indent=2)}")

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

Notes:

  • Server URL: Replace server_url with your viaSocket MCP server URL.

  • Tools Fetching: The list_tools() method fetches available tools from your MCP server.

This setup will connect to the viaSocket MCP server and list available tools.