Skip to content

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:

  1. Ask Claude: "Search my Scrapalot docs for the authentication setup"
  2. Claude queries your knowledge base
  3. Gets relevant context and citations
  4. Provides answer based on your documents

Without MCP:

  1. Manually search your documents
  2. Copy relevant sections
  3. Paste into Claude conversation
  4. 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

  1. Scrapalot running on http://localhost:8090 or your server
  2. Documents uploaded to at least one collection
  3. MCP-compatible client (Claude Desktop recommended)

Configuration

For Claude Desktop:

Edit your Claude Desktop config file:

macOS:

bash
~/Library/Application Support/Claude/claude_desktop_config.json

Windows:

bash
%APPDATA%\Claude\claude_desktop_config.json

Add Scrapalot MCP server:

json
{
  "mcpServers": {
    "scrapalot": {
      "command": "scrapalot-mcp",
      "args": ["--api-url", "http://localhost:8090"],
      "env": {
        "SCRAPALOT_API_KEY": "your-api-key-here"
      }
    }
  }
}

Getting Your API Key

  1. Log into Scrapalot
  2. Go to Settings → API Keys
  3. Create new API key
  4. Copy key to configuration
  5. 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 setup

Get specific information:

Find the deployment checklist in my documents

Advanced Queries

Multi-collection search:

Search both "API Docs" and "User Guides" for rate limiting information

Semantic search:

Find documents related to security best practices

Follow-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:

bash
curl http://localhost:8090/health

Verify MCP endpoint:

bash
curl http://localhost:8090/mcp/collections

Review Claude Desktop logs:

  • macOS: ~/Library/Logs/Claude/mcp.log
  • Windows: %APPDATA%\Claude\Logs\mcp.log

Authentication Errors

Verify API key:

  1. Check key in config is correct
  2. Ensure key hasn't expired
  3. Test key with direct API call:
bash
curl -H "Authorization: Bearer YOUR_KEY" \
     http://localhost:8090/api/v1/collections

If 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:

bash
# Check process
ps aux | grep scrapalot

# Check port
lsof -i :8090

Best 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:

  1. Upload relevant documentation to Scrapalot
  2. During Claude conversation, search docs for specific topics
  3. Get contextual answers with citations
  4. Dive deeper into specific areas

Documentation Writing

Create documentation with Claude:

  1. Store existing docs in Scrapalot
  2. Ask Claude to search for related information
  3. Get consistent terminology and approach
  4. Reference existing content

Code Review

Review code with context:

  1. Store architectural docs in Scrapalot
  2. During code review, ask Claude to check against standards
  3. Get design pattern references
  4. Ensure consistency with existing code

Advanced Configuration

Custom MCP Client

Build your own integration:

python
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:

json
{
  "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"}
    }
  }
}

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.

Released under the MIT License.