What is MCP?
Model Context Protocol (MCP) is an open standard that allows AI assistants to securely connect to external data sources and tools. The Airweave MCP server makes your synced data searchable directly from AI assistants.Features
- Semantic Search: Natural language queries across all your connected data sources
- Advanced Parameters: Full control over search method, ranking, reranking, and more
- AI Completion: Get AI-generated answers from search results
- Multi-tenant: Hosted mode supports thousands of users with per-session isolation
- Production-Ready: Redis-backed sessions, rate limiting, OAuth2 support
- Two Deployment Modes: Local (stdio) for desktop clients, Hosted (HTTP) for cloud platforms
Installation
Quick Start (Recommended)
The easiest way to use the MCP server locally:Global Installation
From Source
Configuration
Local Mode (Desktop AI Clients)
For Claude Desktop, Cursor, and other desktop AI assistants.Required Environment Variables
AIRWEAVE_API_KEY: Your Airweave API key (get from dashboard)AIRWEAVE_COLLECTION: The readable ID of the collection to search
Optional Environment Variables
AIRWEAVE_BASE_URL: Base URL for the Airweave API (default:https://api.airweave.ai)
Hosted Mode (Cloud AI Platforms)
For OpenAI Agent Builder and cloud-based AI platforms.Production Endpoint
Required Headers
X-API-Key: Your Airweave API keyX-Collection-Readable-ID: The readable ID of the collection to search
Alternative: OAuth2 Authentication
Authorization: Bearer <oauth-access-token>
Hosted mode enables true multi-tenancy: each user can search their own collections without requiring separate server deployments.
Setup Guides
Claude Desktop
Add the following to your Claude Desktop configuration file: Location:~/.config/Claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%/Claude/claude_desktop_config.json (Windows)
Cursor
Add to~/.cursor/mcp.json:
OpenAI Agent Builder
Configure MCP Server
In OpenAI Agent Builder, add a new MCP server:MCP Server URL:
https://mcp.airweave.ai/mcpAdd Authentication Headers
Add custom headers:Header 1:
- Name:
X-API-Key - Value:
<your-airweave-api-key>
- Name:
X-Collection-Readable-ID - Value:
<your-collection-readable-id>
Available Tools
Once configured, the MCP server exposes two tools to AI assistants:search-{collection}
Searches within the configured Airweave collection with full parameter control.
Parameters:
The search query text to find relevant documents and data
Format of the response:
raw: Returns search results with scores and metadatacompletion: Returns AI-generated natural language answers
Maximum number of results to return (1-1000)
Number of results to skip for pagination (≥0)
How much to weigh recency vs similarity (0.0 to 1.0)
0: No recency effect1: Rank by recency only
Minimum similarity score threshold (0.0 to 1.0). Only return results above this score.
Search method:
hybrid: Combines neural (semantic) + keyword search (default)neural: Semantic search onlykeyword: Text matching only
Query expansion strategy:
auto: Generates query variations (default)llm: AI-powered expansionno_expansion: Use exact query
Enable LLM-based reranking to improve result relevance
Enable automatic filter extraction from natural language queries
get-config
Shows the current server configuration and status.
Parameters: None
Usage Examples
Once configured, you can use natural language to search:- Basic Search
- AI-Generated Answer
- Recent Results
- Pagination
- High-Quality Results
search-{collection} tool with:Architecture
Local Mode (Stdio Transport)
- Uses standard input/output (stdio)
- Runs as a subprocess on the user’s machine
- Configuration via environment variables
Hosted Mode (HTTP Transport)
- Session Manager: Redis-backed distributed sessions with local caching
- OAuth Validator: Token validation with 1-hour caching
- Rate Limiter: Per-API-key rate limiting (100 sessions/hour)
- Multi-tenant: Per-session isolation with separate
McpServerinstances
Hosted Mode Features
Session Management
- 30-minute session TTL: Automatic expiration after inactivity
- Distributed Sessions: Redis stores session metadata
- Stateless Design: Any pod can handle any request
- Session Binding: IP + User-Agent validation prevents hijacking
Rate Limiting
- 100 sessions per hour per API key
- Automatic cleanup of expired sessions
- Rate limit resets every hour
Security
- API keys are hashed (SHA-256) before storage
- Keys never logged or exposed in error messages
- Session binding prevents session hijacking
- OAuth2 token validation and caching
Testing
Test Hosted Mode
You can test the hosted MCP server using curl:Run Tests Locally
Troubleshooting
Local Mode Issues
“Error: AIRWEAVE_API_KEY environment variable is required”- Set the
AIRWEAVE_API_KEYenvironment variable - Verify your API key is valid in the Airweave dashboard
- Set the
AIRWEAVE_COLLECTIONto your collection’s readable ID - Verify the collection exists in your Airweave instance
- Check that the collection ID is correct
- Verify the collection exists and you have access
- Check that your API key is valid
- Ensure the API key has necessary permissions
Hosted Mode Issues
“Rate limit exceeded”- You’ve created more than 100 sessions in the past hour
- Wait for the rate limit window to reset
- Session expired after 30 minutes of inactivity
- Create a new session (omit
mcp-session-idheader)
- Token may be expired or revoked
- Obtain a new OAuth access token
Debug Mode
The MCP server logs diagnostic information to stderr:Package Information
- Package Name:
airweave-mcp-search - Version: 0.5.7
- MCP Protocol: 2025-03-26 (Streamable HTTP) + legacy stdio
- Node.js: 20.0.0 or higher
- License: MIT
Source Code
The MCP server source code is available in the Airweave monorepo:Need Help?
- MCP Documentation - Learn about Model Context Protocol
- Airweave Discord - Get help from the community
- GitHub Issues - Report bugs or request features
- Security Issues - Report security vulnerabilities