polyvia Python package wraps the entire REST API in a typed, IDE-friendly client and provides first-class support for connecting to the Polyvia MCP server from any AI framework.
Quick Start
POLYVIA_API_KEY in your environment and omit the argument:
MCP Server
client.mcp returns an MCPConfig object with a helper for every major client:
| Method | Use with |
|---|---|
to_anthropic_mcp_server() | ant.beta.messages.create(mcp_servers=[...]) |
to_openai_responses_tool() | oai.responses.create(tools=[...]) |
to_openai_mcp_server() | OpenAI Agents SDK MCPServerStreamableHTTP |
to_claude_desktop_config() | ~/.claude/claude_desktop_config.json |
Anthropic beta MCP client
OpenAI Responses API
OpenAI Agents SDK
Claude Desktop
Print a snippet to copy-paste into~/.claude/claude_desktop_config.json:
Agent Tools (programmatic)
If you’d rather manage the tool-dispatch loop yourself — or your framework doesn’t support remote MCP — useclient.tools to get JSON-schema tool definitions and an executor.
All 10 Polyvia tools are available: ingest, status, list/get/update/delete documents, list/create/delete groups, and query.
Anthropic Messages API
OpenAI ChatCompletion
LangChain
Requirespip install "polyvia[langchain]".
Async Client
Every method onAsyncPolyvia is a coroutine — same API surface as the sync client.
Error Handling
Links
PyPI
pip install polyvia
GitHub
Source code and examples
