Skip to main content
Polyvia AI implements the Model Context Protocol (MCP), enabling seamless integration with AI assistants like Claude Desktop, IDEs, and other MCP-compatible tools.

What is MCP?

Model Context Protocol is an open standard that allows AI applications to securely access external data sources and tools. Polyvia’s MCP server exposes your knowledge base as a set of tools and resources that AI assistants can use to answer questions with citations.

Installation

Prerequisites

  • Node.js 18+ or Python 3.10+
  • Polyvia AI account with API key
  • MCP-compatible client (Claude Desktop, Cline, etc.)

Setup with Claude Desktop

1

Install the Polyvia MCP Server

Install the MCP server package globally:
npm install -g @polyvia/mcp-server
Or using Python:
pip install polyvia-mcp
2

Configure Claude Desktop

Add Polyvia to your Claude Desktop configuration file:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "polyvia": {
      "command": "npx",
      "args": ["-y", "@polyvia/mcp-server"],
      "env": {
        "POLYVIA_API_KEY": "your_api_key_here"
      }
    }
  }
}
Never commit your API key to version control. Store it securely in environment variables.
3

Restart Claude Desktop

Close and reopen Claude Desktop to load the MCP server.
You should see Polyvia tools available in Claude’s tool palette.

Available Tools

The Polyvia MCP server provides the following tools:

search_documents

Perform semantic search across your knowledge base. Parameters:
  • query (string, required): Search query
  • limit (integer, optional): Maximum results to return (default: 10)
  • filters (object, optional): Filter by document metadata
Example:
{
  "query": "What are the security features?",
  "limit": 5
}

get_document

Retrieve a specific document by ID with full content. Parameters:
  • document_id (string, required): Document identifier

query_knowledge_graph

Query the knowledge graph for entities and relationships. Parameters:
  • query (string, required): Natural language query
  • entity_types (array, optional): Filter by entity types

Available Resources

MCP resources provide read access to your knowledge base:

document://[document_id]

Access individual documents as resources. Claude can read these directly without tool calls.

graph://entities

Browse all entities in your knowledge graph.

Configuration Options

Environment Variables

POLYVIA_API_KEY
string
required
Your Polyvia API key from the dashboard
POLYVIA_BASE_URL
string
default:"https://api.polyvia.ai"
API base URL (for self-hosted instances)
POLYVIA_TIMEOUT
integer
default:"30000"
Request timeout in milliseconds

Usage Examples

Asking Questions with Citations

Once configured, you can ask Claude questions that leverage your Polyvia knowledge base:
“Using the Polyvia knowledge base, what are our company’s data retention policies?”
Claude will automatically use the search_documents tool to find relevant information and provide cited answers.

Exploring the Knowledge Graph

“Show me all entities related to ‘customer onboarding’ in our knowledge graph”
Claude will use the query_knowledge_graph tool to traverse relationships and present findings.

Troubleshooting

  • Verify the configuration file path is correct
  • Check that the API key is valid
  • Restart Claude Desktop completely
  • Check Claude’s logs for error messages
  • Ensure your API key is correctly set in the environment variables
  • Verify the API key has not expired
  • Check that you have an active Polyvia subscription
  • Large knowledge bases may take longer to search
  • Consider using filters to narrow search scope
  • Increase the POLYVIA_TIMEOUT value if needed

Next Steps