DHLAB MCP Server
Provides access to the National Library of Norway's Digital Humanities Lab, enabling text and image search, NGram analysis, word lookup, concordance finding, and corpus statistics from Norwegian digital collections.
README
dhlab-mcp
MCP server providing access to DHLAB (National Library of Norway Digital Humanities Lab) functionality through the Model Context Protocol.
Overview
This server exposes tools for:
- Text search: Search the National Library's digital text collection
- NGram analysis: Analyze word frequency trends over time
- Concordance: Find word contexts in documents
- Collocations: Discover words that appear together
- Word lookup: Look up Norwegian word forms and lemmas
- Image search: Search for images in the digital collection
- Corpus statistics: Get information about document collections
Installation
This project uses uv, which can be installed with:
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
Clone and install:
git clone https://github.com/marksverdhei/dhlab-mcp.git
cd dhlab-mcp
uv sync --dev
Or install directly:
pip install git+https://github.com/marksverdhei/dhlab-mcp.git
Usage
Configuring in Claude Code CLI
Add the MCP server to your Claude Code configuration:
claude mcp add --transport stdio dhlab -- uv --directory /path/to/dhlab-mcp run dhlab-mcp
Replace /path/to/dhlab-mcp with the actual path where you cloned this repository.
Verify the server is added:
claude mcp list
The DHLAB tools will then be available in your Claude Code sessions.
Running the MCP Server Standalone
You can also run the server directly for testing:
dhlab-mcp
Or in development mode:
uv run dhlab-mcp
Available Tools
1. search_texts
Search for texts in the digital collection.
{
"query": "ibsen",
"limit": 10,
"from_year": 1900,
"to_year": 1950,
"media_type": "aviser" # or "bøker", "tidsskrift"
}
2. ngram_frequencies
Get word frequency trends over time.
{
"words": ["frihet", "demokrati"],
"corpus": "bok", # or "avis"
"from_year": 1810,
"to_year": 2020
}
3. find_concordances
Find word contexts in a document.
{
"urn": "URN:NBN:no-nb_digibok_2008051404065",
"word": "Norge",
"window": 25
}
4. find_collocations
Find words that appear near the target word.
{
"urn": "URN:NBN:no-nb_digibok_2008051404065",
"word": "frihet",
"window": 5
}
5. lookup_word_forms
Look up different forms of a Norwegian word.
{
"word": "løpe"
}
6. lookup_word_lemma
Look up the lemma (base form) of a word.
{
"word": "løper"
}
7. search_images
Search for images in the collection.
{
"query": "Oslo",
"limit": 10,
"from_year": 1900,
"to_year": 1950
}
8. get_corpus_statistics
Get statistics about a set of documents.
{
"urns": ["URN:NBN:no-nb_digibok_2008051404065"]
}
Development
For development, install with:
uv sync --dev
uv pip install -e .
Run tests:
pytest
Format code:
ruff format src/ tests/
About DHLAB
DHLAB is a Python library for qualitative and quantitative analyses of digital texts from the National Library of Norway's collection. For more information, visit:
License
See LICENSE file.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.