Skip to main content
Glama
vectara

Vectara MCP server

Official
by vectara

Vectara MCP Server

GitHub Repo stars PyPI version License Security

🔌 Compatible with Claude Desktop, and any other MCP Client!

Vectara MCP is also compatible with any MCP client

The Model Context Protocol (MCP) is an open standard that enables AI systems to interact seamlessly with various data sources and tools, facilitating secure, two-way connections.

Vectara-MCP provides any agentic application with access to fast, reliable RAG with reduced hallucination, powered by Vectara's Trusted RAG platform, through the MCP protocol.

Installation

You can install the package directly from PyPI:

pip install vectara-mcp

Related MCP server: mcp-rag-server

Quick Start

Secure by Default (HTTP/SSE with Authentication)

# Start server with secure HTTP transport (DEFAULT)
python -m vectara_mcp
# Server running at http://127.0.0.1:8000 with authentication enabled

Local Development Mode (STDIO)

# For Claude Desktop or local development (less secure)
python -m vectara_mcp --stdio
# ⚠️ Warning: STDIO transport is less secure. Use only for local development.

Configuration Options

# 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

Transport Modes

  • Security: Built-in authentication via bearer tokens

  • Encryption: HTTPS ready

  • Rate Limiting: 100 requests/minute by default

  • CORS Protection: Configurable origin validation

  • Use Case: Production deployments, cloud environments

SSE Transport

  • Streaming: Server-Sent Events for real-time updates

  • Authentication: Bearer token support

  • Compatibility: Works with legacy MCP clients

  • Use Case: Real-time streaming applications

STDIO Transport

  • ⚠️ Security Warning: No transport-layer security

  • Performance: Low latency for local communication

  • Use Case: Local development, Claude Desktop

  • Requirement: Must be explicitly enabled with --stdio flag

Environment Variables

# 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

Authentication

HTTP/SSE Transport

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

Disabling Authentication (Development Only)

# ⚠️ NEVER use in production
python -m vectara_mcp --no-auth

Available Tools

API Key Management

  • setup_vectara_api_key: Configure and validate your Vectara API key for the session (one-time setup).

    Args:

    • api_key: str, Your Vectara API key - required.

    Returns:

    • Success confirmation with masked API key or validation error.

  • clear_vectara_api_key: Clear the stored API key from server memory.

    Returns:

    • Confirmation message.

Query Tools

  • ask_vectara: Run a RAG query using Vectara, returning search results with a generated response.

    Args:

    • query: str, The user query to run - required.

    • corpus_keys: list[str], List of Vectara corpus keys to use for the search - required.

    • n_sentences_before: int, Number of sentences before the answer to include in the context - optional, default is 2.

    • n_sentences_after: int, Number of sentences after the answer to include in the context - optional, default is 2.

    • lexical_interpolation: float, The amount of lexical interpolation to use - optional, default is 0.005.

    • max_used_search_results: int, The maximum number of search results to use - optional, default is 10.

    • generation_preset_name: str, The name of the generation preset to use - optional, default is "vectara-summary-table-md-query-ext-jan-2025-gpt-4o".

    • response_language: str, The language of the response - optional, default is "eng".

    Returns:

    • The response from Vectara, including the generated answer and the search results.

  • search_vectara: Run a semantic search query using Vectara, without generation.

    Args:

    • query: str, The user query to run - required.

    • corpus_keys: list[str], List of Vectara corpus keys to use for the search - required.

    • n_sentences_before: int, Number of sentences before the answer to include in the context - optional, default is 2.

    • n_sentences_after: int, Number of sentences after the answer to include in the context - optional, default is 2.

    • lexical_interpolation: float, The amount of lexical interpolation to use - optional, default is 0.005.

    Returns:

    • The response from Vectara, including the matching search results.

Analysis Tools

  • correct_hallucinations: Identify and correct hallucinations in generated text using Vectara's VHC (Vectara Hallucination Correction) API.

    Args:

    • generated_text: str, The generated text to analyze for hallucinations - required.

    • documents: list[str], List of source documents to compare against - required.

    • query: str, The original user query that led to the generated text - optional.

    Returns:

    • JSON-formatted string containing corrected text and detailed correction information.

  • eval_factual_consistency: Evaluate the factual consistency of generated text against source documents using Vectara's dedicated factual consistency evaluation API.

    Args:

    • generated_text: str, The generated text to evaluate for factual consistency - required.

    • documents: list[str], List of source documents to compare against - required.

    • query: str, The original user query that led to the generated text - optional.

    Returns:

    • JSON-formatted string containing factual consistency evaluation results and scoring.

Note: API key must be configured first using setup_vectara_api_key tool or VECTARA_API_KEY environment variable.

Configuration with Claude Desktop

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.

Usage in Claude Desktop App

Once the installation is complete, and the Claude desktop app is configured, you must completely close and re-open the Claude desktop app to see the Vectara-mcp server. You should see a hammer icon in the bottom left of the app, indicating available MCP tools, you can click on the hammer icon to see more detail on the Vectara-search and Vectara-extract tools.

Now claude will have complete access to the Vectara-mcp server, including all six Vectara tools.

Secure Setup Workflow

First-time setup (one-time per session):

  1. Configure your API key securely:

setup-vectara-api-key
API key: [your-vectara-api-key]

After setup, use any tools without exposing your API key:

Vectara Tool Examples

  1. RAG Query with Generation:

ask-vectara
Query: Who is Amr Awadallah?
Corpus keys: ["your-corpus-key"]
  1. Semantic Search Only:

search-vectara
Query: events in NYC?
Corpus keys: ["your-corpus-key"]
  1. Hallucination Detection & Correction:

correct-hallucinations
Generated text: [text to check]
Documents: ["source1", "source2"]
  1. Factual Consistency Evaluation:

eval-factual-consistency
Generated text: [text to evaluate]
Documents: ["reference1", "reference2"]

Security Best Practices

  1. Always use HTTP transport for production - Never expose STDIO transport to the network

  2. Keep authentication enabled - Only disable with --no-auth for local testing

  3. Use HTTPS in production - Deploy behind a reverse proxy with TLS termination

  4. Configure CORS properly - Set VECTARA_ALLOWED_ORIGINS to restrict access

  5. Rotate API keys regularly - Update VECTARA_API_KEY and VECTARA_AUTHORIZED_TOKENS

  6. Monitor rate limits - Default 100 req/min, adjust based on your needs

See SECURITY.md for detailed security guidelines.

Support

For issues, questions, or contributions, please visit: https://github.com/vectara/vectara-mcp

Available Tools

2 tools
ask_vectaraA
Run a RAG query using Vectara, returning search results with a generated response.

Args:
    query: str, The user query to run - required.
    corpus_keys: list[str], List of Vectara corpus keys to use for the search - required. Please ask the user to provide one or more corpus keys. 
    api_key: str, The Vectara API key - required.
    n_sentences_before: int, Number of sentences before the answer to include in the context - optional, default is 2.
    n_sentences_after: int, Number of sentences after the answer to include in the context - optional, default is 2.
    lexical_interpolation: float, The amount of lexical interpolation to use - optional, default is 0.005.
    max_used_search_results: int, The maximum number of search results to use - optional, default is 10.
    generation_preset_name: str, The name of the generation preset to use - optional, default is "vectara-summary-table-md-query-ext-jan-2025-gpt-4o".
    response_language: str, The language of the response - optional, default is "eng".

Returns:
    The response from Vectara, including the generated answer and the search results.
ParametersJSON Schema
NameRequiredDescriptionDefault
api_keyNo
corpus_keysNo
generation_preset_nameNovectara-summary-table-md-query-ext-jan-2025-gpt-4o
lexical_interpolationNo
max_used_search_resultsNo
n_sentences_afterNo
n_sentences_beforeNo
queryYes
response_languageNoeng

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the tool's function (RAG query with response generation) and mentions required parameters, but lacks details on authentication needs (though 'api_key' is implied), rate limits, error handling, or what happens if corpus keys are invalid. It adds some context but falls short of comprehensive behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear opening sentence, followed by an 'Args:' section detailing parameters and a 'Returns:' section. It is appropriately sized for a complex tool with many parameters, though some sentences could be more concise (e.g., the parameter explanations are verbose but necessary).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no annotations, no output schema), the description is partially complete. It covers the purpose, parameters, and return statement, but lacks information on output format, error cases, or dependencies. Without an output schema, more detail on the response structure would improve completeness for such a multifaceted tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains each parameter's purpose, required status, and default values (e.g., 'query: str, The user query to run - required'), compensating fully for the schema's lack of descriptions. This is essential given the 9 parameters with only 1 required.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Run a RAG query using Vectara') and resources ('returning search results with a generated response'). It distinguishes from the sibling tool 'search_vectara' by emphasizing the generation of a response alongside search results, which suggests 'search_vectara' might only return raw search results without generation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (for RAG queries with Vectara) and includes guidance on required parameters like asking the user for corpus keys. However, it does not explicitly state when NOT to use it or mention alternatives like 'search_vectara' for non-generation searches, which would be needed for a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_vectaraA
Run a semantic search query using Vectara, without generation.

Args:
    query: str, The user query to run - required.
    corpus_keys: list[str], List of Vectara corpus keys to use for the search - required. Please ask the user to provide one or more corpus keys. 
    api_key: str, The Vectara API key - required.
    n_sentences_before: int, Number of sentences before the answer to include in the context - optional, default is 2.
    n_sentences_after: int, Number of sentences after the answer to include in the context - optional, default is 2.
    lexical_interpolation: float, The amount of lexical interpolation to use - optional, default is 0.005.

Returns:
    The response from Vectara, including the matching search results.
ParametersJSON Schema
NameRequiredDescriptionDefault
api_keyNo
corpus_keysNo
lexical_interpolationNo
n_sentences_afterNo
n_sentences_beforeNo
queryYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that the tool performs a semantic search and returns matching results, but lacks details on behavioral traits like authentication needs (though 'api_key' is a parameter), rate limits, error handling, or what 'without generation' entails operationally. The description doesn't contradict annotations (none provided), but offers minimal behavioral context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by 'Args:' and 'Returns:' sections. It's appropriately sized, with each sentence adding value (e.g., explaining parameters and returns). However, it could be more front-loaded by integrating key parameter details into the initial statement, and some phrasing is slightly verbose (e.g., 'Please ask the user to provide').

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters, 0% schema coverage, no annotations, and no output schema, the description is moderately complete. It covers parameter semantics well but lacks behavioral transparency (e.g., auth, limits) and detailed return value explanation beyond 'including the matching search results.' For a search tool with multiple parameters and no structured support, more context on outputs and behavior would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema by explaining all 6 parameters: purpose (e.g., 'query' is 'The user query to run'), requirements (e.g., 'corpus_keys' and 'api_key' are 'required'), defaults (e.g., 'n_sentences_before' default is 2), and user guidance (e.g., 'Please ask the user to provide one or more corpus keys'). This fully documents parameter semantics not covered by the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Run a semantic search query using Vectara, without generation.' It specifies the verb ('search'), resource ('Vectara'), and distinguishes it from sibling 'ask_vectara' by noting 'without generation.' However, it doesn't explicitly contrast with the sibling tool beyond this implicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating 'without generation,' suggesting this is for pure search versus generative queries. It mentions 'Please ask the user to provide one or more corpus keys' for the 'corpus_keys' parameter, offering some guidance. However, it lacks explicit when-to-use versus 'ask_vectara' or other alternatives, and no exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv1.0.0
    • First observedask_vectara
    • First observedsearch_vectara

TDQS

A3.6/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: ask_vectara performs RAG queries with generated responses, while search_vectara performs semantic search without generation. Their descriptions explicitly differentiate between these functions, leaving no room for confusion or overlap in intended use.

Naming Consistency5/5

Both tools follow a perfect verb_noun pattern with 'vectara' as the consistent noun component. The naming is completely uniform across the tool set, using snake_case consistently without any deviations or mixed conventions.

Tool Count2/5

With only 2 tools, this server feels significantly under-scoped for a Vectara integration. A comprehensive MCP server for a search/RAG platform would typically include tools for corpus management, document operations, configuration settings, and additional query types beyond just these two basic search functions.

Completeness2/5

The tool surface is severely incomplete for a Vectara integration. While it covers basic querying, it lacks essential operations like creating/updating/deleting corpora, managing documents within corpora, configuring search parameters, handling authentication more robustly, or providing administrative functions. This creates significant gaps that will limit agent capabilities.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Local MCP server that provides semantic search (RAG) over code repositories, enabling AI clients like Claude and Gemini to access project context without manual re-upload.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that indexes documents and serves relevant context to LLMs via Retrieval Augmented Generation (RAG).
    48
    37
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that exposes document retrieval as tools (semantic search and source listing) for any LLM, using a vector index built from DocPilot's ingestion pipeline.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vectara/vectara-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server