Files
lovdata-test/README.md

2.7 KiB

Demo Project

This is a demo project where I test-run the MCP server developed in ~/git/lovdata-ai.

MCP Server Configuration

The MCP server has been configured for project scope. This means the server will only be available when working in this specific project directory (/home/lindahl/git/lovdata-test).

Adding the MCP Server

If you need to add the MCP server in another location or reconfigure it, use this command:

claude mcp add --transport stdio lovdata --env PGDATABASE=lovdata CWD=/home/lindahl/git/lovdata-ai/python/lovdata-mcp -- /home/lindahl/git/lovdata-ai/python/lovdata-mcp/.venv/bin/python -m lovdata_mcp.server

This command:

  • Adds the MCP server to project scope (creates .mcp.json in project root)
  • Sets the working directory to the MCP server location
  • Configures the production database (lovdata)
  • Uses the correct Python executable from the virtual environment

Server Configuration File

The configuration is stored in .mcp.json at the project root:

{
  "mcpServers": {
    "lovdata-mcp": {
      "command": "/home/lindahl/git/lovdata-ai/python/lovdata-mcp/.venv/bin/python",
      "args": [
        "-m",
        "lovdata_mcp.server"
      ],
      "cwd": "/home/lindahl/git/lovdata-ai/python/lovdata-mcp",
      "env": {
        "PGDATABASE": "lovdata"
      }
    }
  }
}

Cleanup

After the MCP server is configured, you can remove the old .claude/ directory that was created by the global command:

rm -rf .claude

Available MCP Tools

When the server is running, you can query:

Laws & Provisions:

  • get_law - Retrieve Norwegian law by slug/doc_id
  • get_provision - Get single provision by ID
  • get_provisions_batch - Batch retrieve multiple provisions
  • list_provisions - List provisions with pagination
  • list_laws - List available laws
  • list_legal_areas - List legal areas/categories

Search:

  • search_laws - Search laws by keyword
  • search_provisions_fts - Full-text search provisions (Norwegian)
  • search_provisions_vector - Vector similarity search for provisions
  • search_all_provisions_fts - Full-text search across all provisions
  • search_all_provisions_vector - Vector search across all provisions
  • search_lover - Search "lover" (laws)

Gazettes:

  • search_gazettes_fts - Full-text search gazettes
  • get_full_gazette - Retrieve full gazette document

Legacy:

  • search_all_forskrifter_fts - Full-text search (deprecated terminology)

Database

  • 769 Norwegian laws loaded
  • 20,254 provisions with full-text search indexes
  • Production database: lovdata

See Also