mcpx-py
@dylibso
About mcpx-py
Python client library for https://mcp.run - call portable & secure tools for your AI Agents and Apps
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcpx-py": {
"command": "npx",
"args": [
"--yes",
"-p",
"@dylibso/mcpx",
"gen-session",
"--write"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is mcpx-py?
mcpx-py is a Python library for interacting with large language models (LLMs) using tools provided by mcp.run. It supports all models supported by PydanticAI and offers both a Python API and a command-line interface.
How to use mcpx-py?
Install the library via uv add mcpx-py or pip install mcpx-py. Obtain an mcp.run session ID by running npx --yes -p @dylibso/mcpx gen-session --write and set the MCP_RUN_SESSION_ID environment variable. Then import mcpx_py to use the Chat class or invoke the mcpx-client command-line tool.
Key features of mcpx-py
- Python library for LLM interaction via mcp.run tools.
- Supports all models supported by PydanticAI.
- Structured output with Pydantic models.
- Command line interface for chat, list, and tool calls.
- Works with Anthropic, OpenAI, Gemini, Ollama, and Llamafile.
Use cases of mcpx-py
- Summarize web content using an LLM.
- Call remote tools via mcp.run from Python or CLI.
- Build AI applications with structured data outputs.
- Experiment with multiple LLM providers.
FAQ from mcpx-py
What dependencies are required?
You need uv, npm, and optionally ollama for local models.
How do I set up authentication?
Generate an mcp.run session ID using npx --yes -p @dylibso/mcpx gen-session and either write it to a config file (with --write) or set the MCP_RUN_SESSION_ID environment variable.
Which LLM providers are supported?
The library supports Claude, OpenAI, Gemini, Ollama, Llamafile, and any model supported by PydanticAI.
How do I get structured output from the LLM?
Pass a Pydantic BaseModel subclass as the result_type parameter when creating a Chat instance, then call send_message_sync.
Can I use mcpx-py without installing it permanently?
Yes, you can run mcpx-client directly using uvx --from mcpx-py mcpx-client without permanent installation.
Frequently asked questions
What dependencies are required?
You need `uv`, `npm`, and optionally `ollama` for local models.
How do I set up authentication?
Generate an mcp.run session ID using `npx --yes -p @dylibso/mcpx gen-session` and either write it to a config file (with `--write`) or set the `MCP_RUN_SESSION_ID` environment variable.
Which LLM providers are supported?
The library supports Claude, OpenAI, Gemini, Ollama, Llamafile, and any model supported by PydanticAI.
How do I get structured output from the LLM?
Pass a Pydantic `BaseModel` subclass as the `result_type` parameter when creating a `Chat` instance, then call `send_message_sync`.
Can I use mcpx-py without installing it permanently?
Yes, you can run `mcpx-client` directly using `uvx --from mcpx-py mcpx-client` without permanent installation.
Basic information
More Other MCP servers
FastMCP v2 π
jlowinπ The fast, Pythonic way to build MCP servers and clients.

Peekaboo MCP β lightning-fast macOS screenshots for AI agents
steipetePeekaboo is a macOS CLI & optional MCP server that enables AI agents to capture screenshots of applications, or the entire system, with optional visual question answering through local or remote AI models.

DeepMark
DeepMark helps teachers deliver rapid, consistent marking with meaningful feedback for every student β in a fraction of the time. What once took a week, now takes one free period.
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
Mobile Mcp
mobile-nextModel Context Protocol Server for Mobile Automation and Scraping (iOS, Android, Emulators, Simulators and Real Devices)
Comments