polyvia npm package wraps the entire REST API in a fully-typed, ESM/CJS-compatible 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:
REST API
Ingest
Query
Groups
Documents
Usage & Rate Limits
MCP Server
client.mcp returns an MCPConfig object with a helper for every major client:
| Method | Use with |
|---|---|
toAnthropicMcpServer() | ant.beta.messages.create({ mcp_servers: [...] }) |
toOpenAIResponsesTool() | oai.responses.create({ tools: [...] }) |
toOpenAIMcpServer() | OpenAI Agents SDK MCPServerStreamableHTTP |
toClaudeDesktopConfig() | ~/.claude/claude_desktop_config.json |
Anthropic beta MCP client
OpenAI Responses API
OpenAI Agents SDK
Claude Desktop
Agent Tools (programmatic)
Useclient.tools to get JSON-schema tool definitions and an executor that calls
the REST API directly — for frameworks that don’t support remote MCP.
All 10 Polyvia tools are available: ingest, status, list/get/update/delete documents,
list/create/delete groups, and query.
Anthropic Messages API
OpenAI ChatCompletion
Error Handling
Links
npm
npm install polyvia
GitHub
Source code and examples
