feat: Initial commit

This commit is contained in:
2026-03-16 14:12:06 +01:00
parent 33b1e3747c
commit 156727e689
11 changed files with 522 additions and 0 deletions

33
tests/conftest.py Normal file
View File

@@ -0,0 +1,33 @@
"""Shared pytest fixtures."""
import sys
from pathlib import Path
import pytest
import pytest_asyncio
from mcp_api import MCPToolbox
FIXTURES = Path(__file__).parent / "fixtures"
@pytest.fixture
def server_config() -> dict:
"""Config dict for the two test MCP servers, using the current Python interpreter."""
python = sys.executable
return {
"echo": {
"command": python,
"args": [str(FIXTURES / "echo_server.py")],
},
"math": {
"command": python,
"args": [str(FIXTURES / "math_server.py")],
},
}
@pytest_asyncio.fixture
async def toolbox(server_config: dict) -> MCPToolbox:
async with MCPToolbox.from_config(server_config) as tb:
yield tb