How to Use the PDF.co MCP in LangChain
Feed PDF.co tools directly into your LangChain multi-step reasoning chains and track every document conversion with LangSmith.
Works with every AI agent you already use
…and any MCP-compatible client
Connect PDF.co MCP to LangChain
Create your Vinkius account to connect PDF.co to LangChain — we handle the hosting, security, and runtime updates so you don't have to. No server setup required.
Key Capabilities
Multi-step data extraction pipelines
The `pdf_to_json` tool acts as the starting point for your LangChain document processing chains. Your agent runs this tool to extract raw layout data, then feeds that exact JSON structure directly into subsequent LLM analysis steps. You track the entire extraction process in LangSmith, which logs the latency and token usage for each document conversion. If the document is too large, the agent dynamically switches to `split_pdf` to process smaller chunks in parallel before merging results.
Dynamic OCR and table parsing in LangChain
The `ocr_image` tool translates scans into machine-readable text inside your ReAct agent loops. When your chain encounters a scanned invoice, the agent detects the image format and calls this tool before passing the text to a database integration. For structured financial documents, the agent triggers `pdf_to_csv` instead. This keeps your LangChain pipelines clean by converting tables into clean CSV strings that feed straight into your agent's analytical prompt context.
Secure document handling via LangChain MCP Server
The `protect_pdf` tool secures your generated reports before they leave your LangChain pipeline. Your agent automatically applies passwords and encryption to output files right after combining raw files with the `merge_pdfs` tool. This setup runs entirely through a single secure MCP Server endpoint, removing the need to manage different API clients for each document task. Your agent handles the workflow, and LangSmith records the input and output parameters for every security operation.
Set up PDF.co MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes PDF.co tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"pdfco-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent PDF.co transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by PDF.co. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about PDF.co MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the PDF.co MCP today
We host it, we monitor it, we maintain it. You just paste one token.