Python MCP client + server example
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add client-example -- uv run src/client/mcp_client.py~/.codex/config.toml
[mcp_servers.client-example]
command = "uv"
args = ["run", "src/client/mcp_client.py"]
# codex mcp add client-example -- uv run src/client/mcp_client.py~/.cursor/mcp.json
{
"mcpServers": {
"client-example": {
"command": "uv",
"args": [
"run",
"src/client/mcp_client.py"
]
}
}
}.vscode/mcp.json
{
"servers": {
"client-example": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"src/client/mcp_client.py"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"client-example": {
"command": "uv",
"args": [
"run",
"src/client/mcp_client.py"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"client-example": {
"command": "uv",
"args": [
"run",
"src/client/mcp_client.py"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"client-example": {
"command": "uv",
"args": [
"run",
"src/client/mcp_client.py"
]
}
}
}