Vectara RAG-as-a-Service MCP Server
Query Vectara's trusted RAG-as-a-service MCP server for secure, scalable retrieval-augmented generation and fast, accurate answers.
npx -y @vectara/vectara-mcpOverview
The Vectara RAG-as-a-Service MCP (Model Context Protocol) server is a lightweight bridge that connects your applications to Vectara’s retrieval-augmented generation pipeline. It exposes a secure, production-ready endpoint that accepts query requests, retrieves relevant context from indexed corpora, and returns structured candidate passages or augmented answers suitable for use with an LLM. The MCP server is designed for predictable latency, multi-tenant deployments, and enterprise-grade access controls.
This server is useful when you want to separate retrieval and context management from LLM inference: it standardizes context fetch and scoring, centralizes access policies, and simplifies scaling retrieval independently of model serving. Developers use MCP to get fast, relevant evidence for answering questions, to build automated support agents, and to power internal knowledge search with auditable request/response semantics.
Features
- Retrieval-augmented generation (RAG) gateway that returns scored context passages and citations
- Secure API with API-key or bearer token support and configurable auth backends
- Multi-tenant and multi-corpus support for enterprise deployments
- Metrics and health endpoints for observability and integration with monitoring systems
- Docker-friendly and configurable via environment variables or a YAML config file
- Simple JSON API that integrates with any LLM or downstream orchestration layer
Installation / Configuration
Clone the repository and run using Docker (recommended) or a prebuilt binary.
- Clone the repo
- Build and run with Docker
# Build (if you want to create a local image)
# Run with environment variables from a file
- Run with a prebuilt image from a container registry (example)
- Example .env configuration
# Vectara account and corpus identifiers
VECTARA_CUSTOMER_ID=123456789
VECTARA_CORPUS_ID=example-corpus
# API credentials for Vectara
VECTARA_API_KEY=sk_live_...
# MCP server settings
MCP_PORT=8080
MCP_HOST=0.0.0.0
# Optional TLS and auth
TLS_CERT=/etc/ssl/certs/mcp.crt
TLS_KEY=/etc/ssl/private/mcp.key
API_KEYS=client1:secret1,client2:secret2
- Example YAML config (alternative to env vars)
server:
host: 0.0.0.0
port: 8080
vectara:
customerId: 123456789
corpusId: example-corpus
apiKey: sk_live_...
auth:
type: api_keys
keys:
- id: client1
secret: secret1
Available Resources
The MCP server exposes a small set of HTTP endpoints for integration:
| Endpoint | Method | Purpose |
|---|---|---|
| /mcp/query | POST | Run a retrieval request; returns contexts, scores, and metadata |
| /mcp/health | GET | Liveness/Readiness check for orchestration |
| /mcp/metrics | GET | Prometheus-compatible metrics (if enabled) |
| /mcp/config | GET (admin) | Return effective configuration (restricted) |
Example query request (JSON)
Example response (truncated)
SDKs and integrations
- Use any HTTP-capable SDK (curl, requests, fetch). You can wrap the MCP output and feed it to your LLM prompt builder.
- Check the GitHub repo for example clients and CI/CD deployment manifests: https://github.com/vectara/vectara-mcp
Use Cases
- Customer support agent: Query internal FAQs and return top passages to an LLM to produce concise, cited answers. Example flow: user question → MCP query → LLM synthesize with citations → respond to user.
- Secure internal search: Only allow requests from authorized clients with API keys, and funnel all retrieval through MCP for auditing and rate-limiting.
- Multi-tenant knowledge access: Host corpora for multiple business units and route requests to the appropriate corpus using configuration or request-scoped metadata.
- Real-time operations: Use MCP’s low-latency retrieval to enrich live chat or voice assistants with accurate, up-to-date documentation excerpts.
Tips for Developers
- Start by indexing the documents you want Vectara to search; MCP expects corpora to be available in your Vectara account.
- Tune top_k and filters to balance recall vs. latency for downstream LLM prompts.
- Use /mcp/health and /mcp/metrics in your orchestration to provide automated restarts and capacity planning.
- Protect admin endpoints and configuration access; rotate your Vectara API key periodically.
For full implementation details, examples, and advanced deployment patterns, see the repository: https://github.com/vectara/vectara-mcp.