Skip to main content
Glama

mcp-server-public-transport

test_be.py1.34 kB
import pytest from fastmcp import FastMCP from tools.be import register_be_tools @pytest.fixture def mcp(): return FastMCP("test-be") @pytest.fixture(autouse=True) def mock_fetch_json(monkeypatch): async def dummy(url, params): return {"dummy": True} monkeypatch.setattr("tools.be.fetch_json", dummy) return dummy class TestBETools: @pytest.mark.unit async def test_be_search_connections(self, mcp): fn = next(t for t in register_be_tools(mcp) if t.name == "be_search_connections") result = await fn.fn("Brussels", "Antwerp") assert result == {"dummy": True} @pytest.mark.unit async def test_be_search_stations(self, mcp): fn = next(t for t in register_be_tools(mcp) if t.name == "be_search_stations") result = await fn.fn("Brussels") assert result == {"dummy": True} @pytest.mark.unit async def test_be_get_departures(self, mcp): fn = next(t for t in register_be_tools(mcp) if t.name == "be_get_departures") result = await fn.fn("Brussels", limit=7) assert result == {"dummy": True} @pytest.mark.unit async def test_be_get_vehicle(self, mcp): fn = next(t for t in register_be_tools(mcp) if t.name == "be_get_vehicle") result = await fn.fn("IC531") assert result == {"dummy": True}

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/mirodn/mcp-server-public-transport'

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