Vectara MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> 🔌 **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:
Quick Start
Secure by Default (HTTP/SSE with Authentication)
Local Development Mode (STDIO)
Configuration Options
Transport Modes
HTTP Transport (Default - Recommended)
- **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
Authentication
HTTP/SSE Transport
When using HTTP or SSE transport, authentication is required by default:
Disabling Authentication (Development Only)
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.