MCPager 📟
A lightweight synchronous client for Model Context Protocol (MCP) servers
MCPager is a small, fast, and predictable Python client for interacting with Model Context Protocol (MCP) servers.
It is designed for independent AI developers who want to connect tools, agents, and LLMs to MCP backends without asyncio, event loops, or framework lock-in.
MCPager acts like a pager: it sends a request, waits for a response, and delivers it reliably — whether the MCP server is running over stdio, HTTP, or streaming (SSE).
Why MCPager?
Most MCP client libraries today are:
- deeply async,
- tightly coupled to one agentic framework, if any (e.g. LangChain),
- or built around complex lifecycle management.
MCPager takes a different approach:
Simple. Synchronous. Composable.
- No
asyncio - No background event loops
- Provides abstract adapter for an agentic implementation of your choice (although a concrete LangChain adapter also available out of the box)
- Designed for tool-calling agents
Features
- 🧠 Session-based MCP protocol
- 🔌 Multiple transports
stdio(local processes)http(FastMCP, remote servers)text/event-stream(SSE / streaming MCP)
- 🧰 Tool discovery & invocation
- 🧩 LangGraph & LangChain integration
- 🧵 Thread-safe synchronous request handling
- 🔍 Built-in JSON-RPC and session ID management
Installation
pip install mcpager
Quick Example
- Start an MCP server
For example, using FastMCP:
fastmcp run examples/echo_server.py --transport http
- Connect using MCPager
from mcpager.client import StdioTransport, HttpTransport, Session, MCPClient
from mcpager.adapters import LangGraphBackend
transport = HttpTransport('http://localhost:8000/mcp')
# or you can use StdioTransport for local testing like this:
# transport = StdioTransport(["fastmcp", "run", "echo_server.py"])
session = Session(transport)
backend = LangGraphBackend()
client = MCPClient(backend, session)
client.initialize()
tools = client.list_tools()
print(tools)
result = client.call_tool("echo", text="Hello from MCPager!")
print(result)
Using MCPager with LangGraph
MCPager can expose MCP tools directly to LangGraph agents.
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini")
agent = create_react_agent(llm, tools)
response = agent.invoke(
{
'messages': [
{
'role': 'user',
'content': "Please echo the text 'Hello from MCPClient!'"
}
]
}
)
print("Agent response:", response)
Your MCP tools are now callable by the agent as native LangGraph tools.
Architecture
MCPager is built around three simple layers:
MCPClient
↓
BackendAdapter (LangGraphBackend, etc.)
↓
Session (JSON-RPC + session handling)
↓
Transport (stdio, http, SSE)
This makes MCPager:
-
easy to test
-
easy to extend
-
safe to embed in agents, workers, or pipelines
Transports
Stdio (local MCP servers)
StdioTransport(["python", "my_server.py"])
HTTP (FastMCP or remote MCP)
HttpTransport("http://localhost:3000")
Supports:
-
normal JSON responses
-
text/event-stream (SSE streaming)
Documentation
Full documentation and guides are available here:
This includes:
-
MCP protocol overview
-
Tool schemas
-
Server & client examples
-
Agent integration patterns
Who is MCPager for?
MCPager is for:
-
Independent AI developers
-
Agent builders
-
Tool & plugin authors
-
Anyone building MCP-based systems without wanting async complexity
If you want reliable tool calls from LLM agents to real backends, MCPager is built for you.
Project Philosophy
MCPager follows a few strict principles:
-
Synchronous by default
-
Explicit session handling
-
No hidden magic
-
Transport-agnostic
-
Agent-friendly
Think of it as:
“The curl of MCP.”
License
Apache 2.0
Contributions
PRs, issues, and ideas are welcome. MCPager is meant to grow with the MCP ecosystem. 📟
Below is our current backlog:
- Task: support sampling
- Task: support elicitation
- 30.12.2025 MCPager client released!
Metadata
Release files for mcpager 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcpager-0.1.1.tar.gz | 14.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcpager-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.5 kB
Release files / mcpager-0.1.1.tar.gz
| Download URL | mcpager-0.1.1.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86d5fa465548400f5f8f6fabad5105e4b1d39458aacca8a86e1a23c013482f66
|
|
BLAKE2b-256 checksum How to use checksums |
9c86d2db9f4fc9cb31a840b9dbade4abf84fc7ed77b39a68d786d799dbe06301
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.23
|
Release files / mcpager-0.1.1-py3-none-any.whl
| Download URL | mcpager-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b3b8a07e9c75d82bb65846b3e3247d2c6cf135aa9f90eb390604ba0f52c3378
|
|
BLAKE2b-256 checksum How to use checksums |
a0d42da224e0f57ad2ff9d8393a2b3d4e8d1550be0c5ab8fdf623a4fe6bea881
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.23
|
Security for mcpager 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.