Skip to main content
Glama

CSV MCP Server

test_client.py2.58 kB
#!/usr/bin/env python3 """ Simple test client for the CSV MCP server. """ import asyncio import json from fastmcp import Client async def test_csv_server(): """Test the CSV MCP server functionality.""" try: # Connect to the server client = Client("csv_mcp_server/server.py") async with client: print("Connected to CSV MCP server!") # Test basic server info print("\n--- Server Info ---") tools = await client.list_tools() print(f"Available tools: {len(tools)}") for tool in tools: print(f" - {tool.name}: {tool.description}") resources = await client.list_resources() print(f"Available resources: {len(resources)}") for resource in resources: print(f" - {resource.uri}: {resource.name}") prompts = await client.list_prompts() print(f"Available prompts: {len(prompts)}") for prompt in prompts: print(f" - {prompt.name}: {prompt.description}") # Test creating a CSV file print("\n--- Testing CSV Creation ---") result = await client.call_tool("create_csv", { "filename": "test_data", "headers": ["name", "age", "city"], "data": [ ["Alice", 25, "New York"], ["Bob", 30, "Los Angeles"], ["Charlie", 35, "Chicago"] ] }) print(f"Create CSV result: {result.data}") # Test reading the CSV file print("\n--- Testing CSV Reading ---") result = await client.call_tool("read_csv", { "filename": "test_data" }) print(f"Read CSV result: {result.data}") # Test getting file info print("\n--- Testing File Info ---") result = await client.call_tool("get_info", { "filename": "test_data" }) print(f"File info: {result.data}") # Test listing CSV files print("\n--- Testing File Listing ---") result = await client.call_tool("list_csv_files", {}) print(f"File listing: {result.data}") except Exception as e: print(f"Error testing server: {e}") import traceback traceback.print_exc() if __name__ == "__main__": asyncio.run(test_csv_server())

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NovaAI-innovation/csv-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server