Dhlab

Dhlab mcp
  • python

0

GitHub Stars

python

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

You run the DHLAB MCP Server to access Digital Humanities Lab tools through the Model Context Protocol. It exposes text search, n-gram analysis, concordance lookups, collocations, word form lookups, image search, and corpus statistics, all accessible from MCP clients. This enables you to explore Norwegian digital text collections and related data through a consistent, programmable interface.

How to use

You connect to the DHLAB MCP Server using an MCP client configured to communicate via stdio or HTTP. For local testing, you can start the server in your terminal and then run your MCP-enabled client in the same environment. When the server is running, you can perform searches, lookups, and analyses described by the available tools to explore texts, images, and linguistic data from DHLAB.

How to install

# Prerequisites
- Python and pip (for server dependencies)
- uv (the Universal Verifier runner) required for development + testing

# Install uv (on macOS and Linux)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the DHLAB MCP server from source
git clone https://github.com/marksverdhei/dhlab-mcp.git
cd dhlab-mcp
uv sync --dev

# Or install directly via pip
pip install git+https://github.com/marksverdhei/dhlab-mcp.git

Configuration and starting the MCP server

You can run the MCP server locally in stdio mode for CLI integration or start an HTTP API if you need network access. The following commands illustrate starting in each mode.

# Run the server in stdio mode (CLI integration)
uv run dhlab-mcp

# Run the server as a local HTTP API (default port 8000)
dhlab-mcp --transport http

# Run the HTTP API on a custom port
dhlab-mcp --transport http --port 9000

# Run the HTTP API on a specific host and port
dhlab-mcp --transport http --host 0.0.0.0 --port 8080

Usage patterns you can try

  • Search for texts in the DHLAB collection to locate articles, newspapers, or books by keywords and date ranges.

  • Analyze word frequency trends over time with n-gram frequencies to observe shifts in terms like liberty or democracy.

  • Retrieve concordances to study the context around a target word within documents.

  • Discover words that frequently co-occur with a target term using collocations.

  • Look up Norwegian word forms and lemmas to support linguistic research.

  • Search for images in the DHLAB collection to accompany textual analyses.

  • Obtain corpus statistics for a set of documents to understand composition and scope.

Available tools

search_texts

Search for texts in the digital collection using a query, with optional year ranges and media type to filter results.

ngram_frequencies

Compute word frequency trends over time for specified words and corpus.

find_concordances

Find word contexts in a document and return HTML-formatted text with matches highlighted.

word_concordance

Find word contexts with a structured, non-HTML output including surrounding text.

find_collocations

Identify words that commonly appear near a target word within a defined window.

lookup_word_forms

Look up different forms of a Norwegian word to support linguistic analysis.

lookup_word_lemma

Look up the lemma (base form) of a word to normalize variants.

search_images

Search for images within the DHLAB collection based on a query and date range.

get_corpus_statistics

Return statistics for a set of documents identified by URNs.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational