Model Context Protocol (MCP)
Enable AI assistants like Claude to query your Scrapalot knowledge base directly. MCP integration lets you ask questions about your documents during AI conversations.
What is MCP?
Model Context Protocol allows AI assistants to access external context sources, including your Scrapalot documents.
Benefits:
- Ask Claude to search your documents during conversations
- Get answers with citations from your knowledge base
- Seamless integration with AI development tools
- Real-time document access
Use Cases
Development with Claude
Scenario: Working with Claude Desktop on a coding project
With MCP:
- Ask Claude: "Search my Scrapalot docs for the authentication setup"
- Claude queries your knowledge base
- Gets relevant context and citations
- Provides answer based on your documents
Without MCP:
- Manually search your documents
- Copy relevant sections
- Paste into Claude conversation
- Ask question again
Documentation Research
Scenario: Researching across multiple document sets
With MCP:
- "Find all mentions of deployment in my technical docs"
- "What does my security policy say about data retention?"
- "Search my meeting notes for decisions about the new feature"
Setup Guide
Prerequisites
- Scrapalot running on
http://localhost:8090or your server - Documents uploaded to at least one collection
- MCP-compatible client (Claude Desktop recommended)
Configuration
For Claude Desktop:
Edit your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonAdd Scrapalot MCP server:
{
"mcpServers": {
"scrapalot": {
"command": "scrapalot-mcp",
"args": ["--api-url", "http://localhost:8090"],
"env": {
"SCRAPALOT_API_KEY": "your-api-key-here"
}
}
}
}Getting Your API Key
- Log into Scrapalot
- Go to Settings → API Keys
- Create new API key
- Copy key to configuration
- Restart Claude Desktop
Using MCP with Claude
Basic Queries
Ask Claude to search your docs:
Can you search my Scrapalot documents for information about deployment?Specify a collection:
Search the "Technical Docs" collection for authentication setupGet specific information:
Find the deployment checklist in my documentsAdvanced Queries
Multi-collection search:
Search both "API Docs" and "User Guides" for rate limiting informationSemantic search:
Find documents related to security best practicesFollow-up questions:
Based on what you found, what's the recommended approach?Available Operations
Search Documents
Query your knowledge base
Parameters:
- Query text (required)
- Collection ID (optional)
- Max results (optional, default: 5)
Returns:
- Relevant document chunks
- Source document names
- Relevance scores
- Citations
List Collections
See available document collections
Parameters: None
Returns:
- Collection names and IDs
- Document counts
- Creation dates
Troubleshooting
MCP Server Not Responding
Check Scrapalot is running:
curl http://localhost:8090/healthVerify MCP endpoint:
curl http://localhost:8090/mcp/collectionsReview Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp.log - Windows:
%APPDATA%\Claude\Logs\mcp.log
Authentication Errors
Verify API key:
- Check key in config is correct
- Ensure key hasn't expired
- Test key with direct API call:
curl -H "Authorization: Bearer YOUR_KEY" \
http://localhost:8090/api/v1/collectionsIf key invalid:
- Generate new API key in Scrapalot
- Update config file
- Restart Claude Desktop
No Results Returned
Common causes:
- Collection has no documents
- Query doesn't match content
- API key lacks collection access
- Max results set too low
Solutions:
- Verify documents in collection
- Try broader search terms
- Check permissions
- Increase max_results parameter
Connection Refused
Check firewall:
- Ensure port 8090 accessible
- Allow localhost connections
- Check network settings
Verify Scrapalot running:
# Check process
ps aux | grep scrapalot
# Check port
lsof -i :8090Best Practices
Query Formulation
Be specific:
- Good: "Find the API rate limit configuration"
- Poor: "Tell me about limits"
Use collection names:
- "Search the Security Policies collection for..."
- "In the API Documentation, find..."
Iterate:
- Start broad, then narrow down
- Ask follow-up questions
- Request clarification
Organization
Organize collections meaningfully:
- Separate by topic or project
- Use descriptive collection names
- Keep related documents together
Maintain document quality:
- Clear, descriptive filenames
- Well-structured content
- Regular updates
Security
Protect your API key:
- Store in config only
- Don't commit to version control
- Rotate periodically
- Use separate keys for different purposes
Control access:
- Use read-only API keys for MCP
- Limit collection access if needed
- Monitor usage logs
Integration Examples
Research Workflow
Research new technology:
- Upload relevant documentation to Scrapalot
- During Claude conversation, search docs for specific topics
- Get contextual answers with citations
- Dive deeper into specific areas
Documentation Writing
Create documentation with Claude:
- Store existing docs in Scrapalot
- Ask Claude to search for related information
- Get consistent terminology and approach
- Reference existing content
Code Review
Review code with context:
- Store architectural docs in Scrapalot
- During code review, ask Claude to check against standards
- Get design pattern references
- Ensure consistency with existing code
Advanced Configuration
Custom MCP Client
Build your own integration:
import requests
def query_scrapalot(query: str, api_key: str, collection_id: str = None):
"""Query Scrapalot via MCP endpoint"""
response = requests.post(
"http://localhost:8090/mcp/query",
json={
"query": query,
"collection_id": collection_id,
"max_results": 5
},
headers={"Authorization": f"Bearer {api_key}"}
)
return response.json()["results"]Multiple Scrapalot Instances
Connect to multiple Scrapalot servers:
{
"mcpServers": {
"scrapalot-prod": {
"command": "scrapalot-mcp",
"args": ["--api-url", "https://prod.scrapalot.com"],
"env": {"SCRAPALOT_API_KEY": "prod-key"}
},
"scrapalot-dev": {
"command": "scrapalot-mcp",
"args": ["--api-url", "http://localhost:8090"],
"env": {"SCRAPALOT_API_KEY": "dev-key"}
}
}
}Related Documentation
- API Reference - REST API endpoints
- Security - Authentication and access control
- RAG Strategy - How search works
- User Guide - Using Scrapalot features
MCP integration brings your Scrapalot knowledge base directly into your AI conversations. Set it up once and search your documents naturally during any Claude conversation.