MCP Server — Connect CaveauAI to Claude Code & Claude Desktop

2 views

MCP Server Integration

Blue Note Logic provides a Model Context Protocol (MCP) server that lets you search our legal and regulatory knowledge bases directly from Claude Code and Claude Desktop. This gives AI assistants real-time access to curated European legal knowledge without leaving your development environment.


What is MCP?

The Model Context Protocol (MCP) is an open standard by Anthropic that allows AI models to access external tools and data sources. Our MCP server exposes CaveauAI's knowledge corpus as a set of tools that Claude can call during conversations.

Instead of copy-pasting legal text into a chat window, you simply ask Claude a question and it automatically searches our knowledge bases, retrieves relevant passages, and cites its sources.


Available Tools

Our MCP server (legal-knowledge) provides 9 tools:

Search & Retrieval

Tool Description
search_corpus Semantic vector search across all shared corpuses. Accepts natural language queries and returns the most relevant document chunks with metadata.
search_keywords Metadata-based search (no embedding). Filter by jurisdiction, authority type, year range, language, and category.
search_private Search a client's private uploaded documents. Tenant-isolated — results are scoped to the specified client ID.
get_document Retrieve the full text of a document by ID, with all chunks in order. Useful for reading a complete document found via search.

Analysis & Q&A

Tool Description
ask Full RAG pipeline: embeds your question → searches relevant chunks → builds context → generates an LLM answer with source citations. One-stop question answering.

Corpus Management

Tool Description
list_corpuses List all available knowledge corpuses with document and chunk counts.
get_categories Get the hierarchical category taxonomy for a corpus (categories → subcategories).
corpus_stats Detailed analytics: document/chunk counts broken down by category, jurisdiction, language, and publication year.
ingest_text Ingest a text document into a corpus. Chunks the text, embeds each chunk, and stores in both MySQL and Qdrant.

Available Corpuses

Corpus Slug Contents
do-better-legal Norwegian law — Lovdata, KOFA decisions, court rulings, regulations, family law
corpus_eu_ai EU AI Act — DPA decisions, EDPB guidance, enforcement actions, implementing acts
corpus_co2 CO2 & Climate — EU ETS, Paris Agreement, Nordic climate laws, ESG frameworks
corpus_telecom Telecom regulation — BEREC guidelines, ETSI standards, Nkom decisions

Setup for Claude Code (CLI)

Add this to your .mcp.json file in your project root:

{
  "mcpServers": {
    "legal-knowledge": {
      "command": "ssh",
      "args": [
        "bluenotelogic@89.167.24.252",
        "/home/bluenotelogic/mcp-legal/venv/bin/python /home/bluenotelogic/mcp-legal/server.py --stdio"
      ]
    }
  }
}

Prerequisites:

  • SSH access configured (key-based authentication to S1)
  • Claude Code installed (npm install -g @anthropic-ai/claude-code)

Once configured, Claude Code will automatically discover the MCP server and make the tools available in conversations.


Setup for Claude Desktop

Claude Desktop connects via SSE (Server-Sent Events) transport on port 8001:

{
  "mcpServers": {
    "legal-knowledge": {
      "transport": "sse",
      "url": "http://89.167.24.252:8001/sse"
    }
  }
}

The SSE transport runs as a systemd service on S1, ensuring it's always available.


Search Filters

Most search tools support these optional filters:

Filter Values Description
corpus do-better-legal, corpus_eu_ai, etc. Limit search to specific corpus
language en, no, fr, de, sv, etc. Filter by document language
jurisdiction eu, no, se, dk, fi, etc. Filter by jurisdiction
authority_type law, regulation, guidance, case_law, commentary, report, treaty Filter by document type
year_from / year_to e.g., 2020-2026 Publication year range
category e.g., gdpr, ai-act, nis2 Filter by category slug

Example Usage in Claude Code

Once configured, you can ask questions naturally:

"Search the EU AI corpus for high-risk AI system requirements"

Claude will call search_corpus with your query, retrieve relevant chunks, and synthesize an answer with citations to specific articles and regulatory documents.

"What Norwegian laws apply to employee monitoring in the workplace?"

Claude calls search_corpus targeting do-better-legal, finds relevant provisions from arbeidsmiljøloven and datatilsynet guidance, and provides a sourced answer.

"Get the full text of document 18445"

Claude calls get_document and returns the complete document with all chunks.


Technical Details

  • Server: Python FastMCP server running on S1
  • Embedding model: nomic-embed-text (768-dimensional vectors)
  • Vector store: Qdrant on S2 (10.0.0.4:6333)
  • LLM for ask tool: Configurable (default: qwen2.5:14b)
  • Response format: JSON with chunk content, metadata, relevance scores, and document references