Vectara MCP Server is an implementation of the Model Context Protocol (MCP) that enables AI systems to interact with Vectara's Trusted RAG platform. It provides agentic applications with access to fast, reliable RAG capabilities with reduced hallucination risk, all through the standardized MCP protocol.
You can install the package directly from PyPI:
pip install vectara-mcp
# Start server with secure HTTP transport (DEFAULT)
python -m vectara_mcp
# Server running at http://127.0.0.1:8000 with authentication enabled
# For Claude Desktop or local development
python -m vectara_mcp --stdio
# ⚠️ Warning: STDIO transport is less secure. Use only for local development.
# Custom host and port
python -m vectara_mcp --host 0.0.0.0 --port 8080
# SSE transport mode
python -m vectara_mcp --transport sse --path /sse
# Disable authentication (DANGEROUS - dev only)
python -m vectara_mcp --no-auth
--stdio flag# Required
export VECTARA_API_KEY="your-api-key"
# Optional
export VECTARA_AUTHORIZED_TOKENS="token1,token2" # Additional auth tokens
export VECTARA_ALLOWED_ORIGINS="http://localhost:*,https://app.example.com"
export VECTARA_TRANSPORT="http" # Default transport mode
export VECTARA_AUTH_REQUIRED="true" # Enforce authentication
When using HTTP or SSE transport, authentication is required by default:
# Using curl with bearer token
curl -H "Authorization: Bearer $VECTARA_API_KEY" \
-H "Content-Type: application/json" \
-X POST http://localhost:8000/call/ask_vectara \
-d '{"query": "What is Vectara?", "corpus_keys": ["my-corpus"]}'
# Using X-API-Key header (alternative)
curl -H "X-API-Key: $VECTARA_API_KEY" \
http://localhost:8000/sse
# ⚠️ NEVER use in production
python -m vectara_mcp --no-auth
Configure and validate your Vectara API key for the session (one-time setup).
Arguments:
Returns:
Clear the stored API key from server memory.
Returns:
Run a RAG query using Vectara, returning search results with a generated response.
Arguments:
Returns:
Run a semantic search query using Vectara, without generation.
Arguments:
Returns:
Identify and correct hallucinations in generated text using Vectara's VHC (Vectara Hallucination Correction) API.
Arguments:
Returns:
Evaluate the factual consistency of generated text against source documents using Vectara's dedicated factual consistency evaluation API.
Arguments:
Returns:
Note: API key must be configured first using setup_vectara_api_key tool or VECTARA_API_KEY environment variable.
To use with Claude Desktop, update your configuration to use STDIO transport:
{
"mcpServers": {
"Vectara": {
"command": "python",
"args": ["-m", "vectara_mcp", "--stdio"],
"env": {
"VECTARA_API_KEY": "your-api-key"
}
}
}
}
Or using uv:
{
"mcpServers": {
"Vectara": {
"command": "uv",
"args": ["tool", "run", "vectara-mcp", "--stdio"]
}
}
}
Note: Claude Desktop requires STDIO transport. While less secure than HTTP, it's acceptable for local desktop use.
After completing the installation and configuring the Claude desktop app, completely close and re-open the app to see the Vectara-mcp server. You should see a hammer icon in the bottom left of the app indicating available MCP tools. Click on the hammer icon to see more detail on the Vectara tools.
Claude will have access to all six Vectara tools.
First-time setup (one-time per session):
setup-vectara-api-key
API key: [your-vectara-api-key]
After setup, use any tools without exposing your API key:
ask-vectara
Query: Who is Amr Awadallah?
Corpus keys: ["your-corpus-key"]
search-vectara
Query: events in NYC?
Corpus keys: ["your-corpus-key"]
correct-hallucinations
Generated text: [text to check]
Documents: ["source1", "source2"]
eval-factual-consistency
Generated text: [text to evaluate]
Documents: ["reference1", "reference2"]
--no-auth for local testingVECTARA_ALLOWED_ORIGINS to restrict accessVECTARA_API_KEY and VECTARA_AUTHORIZED_TOKENSTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "Vectara" '{"command":"uv","args":["tool","run","vectara-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"Vectara": {
"command": "uv",
"args": [
"tool",
"run",
"vectara-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"Vectara": {
"command": "uv",
"args": [
"tool",
"run",
"vectara-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect