2.7 KiB
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.jsonin 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_idget_provision- Get single provision by IDget_provisions_batch- Batch retrieve multiple provisionslist_provisions- List provisions with paginationlist_laws- List available lawslist_legal_areas- List legal areas/categories
Search:
search_laws- Search laws by keywordsearch_provisions_fts- Full-text search provisions (Norwegian)search_provisions_vector- Vector similarity search for provisionssearch_all_provisions_fts- Full-text search across all provisionssearch_all_provisions_vector- Vector search across all provisionssearch_lover- Search "lover" (laws)
Gazettes:
search_gazettes_fts- Full-text search gazettesget_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
- MCP_SERVER_TESTING.md - Detailed testing guide