Agentset: Build Production RAG Apps with MCP
What you'll learn: How to set up Agentset MCP server to connect your knowledge base to AI assistants, enabling semantic search and document retrieval through Claude, Cursor, Windsurf, and other MCP clients.
What is Agentset?
Agentset is an open-source platform for building production-ready RAG (Retrieval-Augmented Generation) applications. It handles the entire RAG pipeline: document ingestion, chunking, embedding, and retrieval—so you can focus on building AI features instead of infrastructure.
Key Features
| Feature | Description | |---------|-------------| | High-Accuracy RAG | Hybrid search + reranking for precise results | | 22+ File Formats | PDF, DOCX, Markdown, HTML, and more | | Automatic Citations | Built-in source attribution for answers | | Deep Research Mode | Extended analysis across multiple sources | | Model Agnostic | Works with any LLM, embedding model, or vector DB | | MCP Server | Native integration with AI assistants |
Why Use Agentset with MCP?
MCP (Model Context Protocol) allows AI assistants to access external tools and data. With Agentset's MCP server, your AI assistant can:
- Search your knowledge base in natural language
- Retrieve relevant documents with citations
- Answer questions using your proprietary data
- Maintain context across conversations
Prerequisites
Before starting, you'll need:
- Node.js 16+ installed
- Agentset account (free tier: 1,000 pages, 10,000 retrievals)
- API key from Agentset dashboard
- Namespace ID for your knowledge base
Quick Start
Step 1: Create an Agentset Account
- Visit app.agentset.ai
- Sign up for a free account
- Create a new namespace for your documents
- Upload your documents (PDFs, docs, markdown, etc.)
Step 2: Get Your Credentials
From the Agentset dashboard:
- Navigate to Settings → API Keys
- Copy your API key (format:
agentset_xxx) - Go to your namespace and copy the Namespace ID (format:
ns_xxx)
Step 3: Test the MCP Server
Run a quick test to verify everything works:
# Windows PowerShell
$env:AGENTSET_API_KEY="your-api-key"
npx @agentset/mcp --ns your-namespace-id
# macOS/Linux
AGENTSET_API_KEY=your-api-key npx @agentset/mcp --ns your-namespace-id
If successful, you'll see the server start and connect to your knowledge base.
Client Configuration
Claude Desktop
Add to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"agentset": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_xxx"
}
}
}
}
Restart Claude Desktop after saving.
Cursor
- Open Settings → MCP Servers
- Add new server with this configuration:
{
"agentset": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_xxx"
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"agentset": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_xxx"
}
}
}
}
VS Code with GitHub Copilot
Add to your VS Code MCP settings:
{
"mcp": {
"servers": {
"agentset": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_xxx"
}
}
}
}
}
Available Tools
Once connected, the Agentset MCP server provides these tools:
search_knowledge_base
Search through your indexed documents using natural language.
Example prompts:
- "Find documents about API authentication"
- "What does our documentation say about deployment?"
- "Search for error handling best practices"
get_document
Retrieve a specific document by its ID.
Example prompts:
- "Get the full content of the API guide"
- "Show me document doc_123"
semantic_search
Perform semantic search with additional context.
Example prompts:
- "Find information about deployment strategies, focusing on Kubernetes"
- "Search for security guidelines related to OAuth"
Advanced Configuration
Custom Tool Description
Add a custom description for the tool that appears in your AI assistant:
npx @agentset/mcp --ns your-namespace-id -d "Search my company's internal documentation"
Multi-Tenant Setup
For applications serving multiple organizations:
{
"mcpServers": {
"agentset": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest", "-t", "tenant_abc123"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_xxx"
}
}
}
}
Multiple Namespaces
Connect multiple knowledge bases by adding separate server entries:
{
"mcpServers": {
"agentset-docs": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_documentation"
}
},
"agentset-code": {
"command": "npx",
"args": ["-y", "@agentset/mcp@latest"],
"env": {
"AGENTSET_API_KEY": "agentset_xxx",
"AGENTSET_NAMESPACE_ID": "ns_codebase"
}
}
}
}
Real-World Use Cases
1. Internal Documentation Search
Scenario: Your team has hundreds of internal docs, wikis, and guides.
Setup:
- Upload all docs to Agentset
- Connect MCP server to Claude Desktop
- Ask questions like: "What's our deployment approval process?"
Result: Instant answers with citations to specific documents.
2. Codebase Knowledge Base
Scenario: Help developers understand your codebase.
Setup:
- Index README files, architecture docs, and API specs
- Connect to Cursor or Windsurf
- Ask: "How does our authentication middleware work?"
Result: Context-aware answers while coding.
3. Customer Support Knowledge
Scenario: AI-powered support using your documentation.
Setup:
- Upload product docs, FAQs, and troubleshooting guides
- Integrate via MCP
- Query: "How do I reset my password?"
Result: Accurate, cited responses from official docs.
Troubleshooting
API Key Authentication Failed
Symptoms: 401 Unauthorized errors
Solution:
- Verify API key in Agentset dashboard
- Check for typos in environment variable
- Ensure key hasn't expired
Namespace Not Found
Symptoms: "Namespace does not exist" errors
Solution:
- Double-check namespace ID format (
ns_xxx) - Verify you have access permissions
- Ensure documents have been indexed
Poor Search Results
Symptoms: Irrelevant or missing results
Solution:
- Add more descriptive metadata to documents
- Use more specific search queries
- Check if documents finished indexing
- Consider reindexing with better chunking settings
Connection Timeouts
Symptoms: Slow responses or timeouts
Solution:
- Check network connectivity
- Large documents may take longer to process
- Contact Agentset support for performance optimization
Self-Hosting Agentset
For full control, you can self-host Agentset:
# Clone the repository
git clone https://github.com/agentset-ai/agentset
cd agentset
# Install dependencies
bun install
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Set up database
bun db:deploy
# Start the server
bun dev:web
Full self-hosting documentation: docs.agentset.ai/open-source/self-hosting
Comparison with Other RAG Solutions
| Feature | Agentset | DIY RAG | Other Platforms | |---------|----------|---------|-----------------| | Setup Time | Minutes | Days/Weeks | Hours | | MCP Support | Native | Custom | Varies | | File Formats | 22+ | Limited | Varies | | Citations | Built-in | Manual | Varies | | Pricing | Free tier | Infrastructure costs | Usually paid |
Next Steps
- Explore more MCP servers: Browse the directory
- Learn MCP basics: Complete setup guide
- Optimize your RAG: Check Agentset documentation
Related Resources
Last updated: December 2025 | Have questions? Browse more MCP guides