finland-law-mcp-server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Overview
Read Finnish and Swedish legal material from Finlex. Search by title or metadata, resolve citations, and follow statutes to amendments, court decisions, and preparatory works. The Statute Book contains the authentic as-enacted wording. Finlex consolidations are informational and can include adopted amendments before they take effect. For wording on a date, request an effective-date read and retain its evidence.
Tools
Tool | Description |
| Find consolidated or as-enacted statutes by title, keyword, year, or type |
| Find KKO and KHO decisions by court, collection, exact keyword, or year |
| Find government proposals by title or year |
| Resolve legal citations and turn provision references into tool inputs |
| Read an outline, a chapter, or commencement text and related sources |
| Read selected provisions as enacted, on a date, or in an adopted snapshot |
| Trace commencement dates, transitional rules, and preparatory works |
| Read KKO and KHO decisions or selected published sections |
| Read a proposal outline or section, or get the source PDF link |
| Look up citation syntax, collection coverage, and accepted filters |
Related MCP server: US Code MCP
Capability reference
The three search tools filter titles or metadata. Finlex Open Data has no full-text search. They accept language (fin by default, or swe), start_year, end_year, published_since, and limit (default 5, capped at 10 with a notice). Results are oldest first by year and number. Use next_cursor as cursor with the original query. Finlex supplies no total for these searches.
filaw_search_statutes tool
Search Finnish or Swedish title substrings or exact Finlex keyword labels. Use
statute_typewith slugs such asactordecree, also accepted aslakiorasetus.collectiondefaults toconsolidated. Useas_enactedfor the Statute Book.in_forceapplies only to consolidated records.Results include canonical numbers, source URIs, and
has_textso callers can identify title-only records.
filaw_search_decisions tool
Choose
court: "KKO"(Supreme Court) or"KHO"(Supreme Administrative Court). The defaulttypeisprecedent. Both courts supportother_decision, and KHO also supportssummary_archive.keywordmatches exact Finlex labels. On an empty initial page, the server tries capitalizing a lowercase initial once and carries the resulting query into the continuation cursor.
filaw_search_government_proposals tool
titlematches a case-insensitive substring, for exampletyösopimuslain. Results identify proposals by HE number, link affected statutes, and report XML, PDF-only, or unknown text availability.
filaw_lookup_citation tool
Resolve up to 25
citationsper call. Accepted forms include55/2001,SK 55/2001(as enacted),Työsopimuslaki,55/2001 7 luku 2 §,HE 157/2000, and court numbers or ECLIs.Each citation returns its own outcome. Ambiguous numbers or titles return candidates. A resolved citation with a provision address provides input for
filaw_get_provision.
filaw_get_statute tool
Omit
partfor the outline and metadata, including available decree, preparatory work, correction, and translation links. Use a chapter such as7 lukuorentry_into_forcefor the corresponding text.Consolidated reads can select an
asofdate or an exactversion, one at a time. The outline provides section selectors forfilaw_get_provision. Translation links identify the last included amendment when Finlex records it.
filaw_get_provision tool
Select up to ten
provisionsfrom one statute. Use natural addresses such as7 luku 2 §or copy selectors from the statute outline.In the consolidated collection,
asofrequests wording effective on an ISO date and defaults to today in Europe/Helsinki when noversionis supplied. An eight-digitversionselects a served adoption snapshot, which may include prospective wording.Dated reads can return established fragments, candidate wording, and unresolved paths when snapshots or commencement evidence leave gaps. Use
filaw_list_amendmentsto inspect the underlying amendments and transitional text.
filaw_list_amendments tool
Lists amending acts newest first, with recorded commencement and end dates, published commencement and transitional text, preparatory-work references, and the earliest served version where available. Filter by recorded start dates or current status in Europe/Helsinki. The response includes the date used for status.
Pages default to 25 amendments and cap at 100. Continue with
next_offsetasoffset.
filaw_get_decision tool
Read up to ten decisions. Use court numbers, numeric ECLIs, legacy KKO series such as
KKO 1975 I 1, or structured{ court, type, year, number }selectors.Omit
sectionsfor all published body text. Selectintroduction,background,arguments,motivation, ordecisionto narrow the read. Results identify missing sections and summary-only coverage where applicable.
filaw_get_government_proposal tool
Use a proposal number such as
HE 157/2000. Omitpartfor the heading outline and text sizes. Use a selector from the outline or an exact unique heading for section text.PDF-only proposals return metadata and the source PDF link. The server reads text supplied as XML.
filaw_list_reference tool
Returns citation and provision syntax, curated abbreviation mappings, statute types, court collections, language and history coverage, and pagination rules. Takes an empty object and works offline.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Finlex requests start at least one second apart, with up to three in flight. When the shared queue fills, the server returns a retry delay.
A combined XML page above 16 MiB is fetched one document at a time. An individual expression above 8 MiB returns
finlex_response_too_large. Read that expression directly on Finlex. Limits apply after decompression.Resolved expressions and latest-version aliases are cached for up to ten minutes, with up to 64 entries per cache and a 24 MiB source-size budget for parsed documents.
Text returned in
content[]preserves the data instructuredContent, including evidence, source links, and unresolved results.
Getting started
claude mcp add finland-law-mcp-server -- npx -y @cyanheads/finland-law-mcp-serverFor other clients, add this to the MCP config file:
{
"mcpServers": {
"finland-law-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/finland-law-mcp-server"]
}
}
}Finlex requires no API key. For Docker or a source build, see Running the server.
Configuration
Variable | Description | Default |
| Transport, |
|
| HTTP listen address |
|
| HTTP server port |
|
| HTTP endpoint path |
|
| HTTP session mode, |
|
| Authentication, |
|
| Log level |
|
| Directory for log files |
|
| Framework storage backend |
|
| Enable OpenTelemetry |
|
| Opt in to sending tool-call summaries to the maintainer |
|
See .env.example for common framework overrides.
Running the server
Local development
Requires Bun v1.4.4 or higher and Node.js v24+.
Clone and install:
git clone https://github.com/cyanheads/finland-law-mcp-server.git cd finland-law-mcp-server && bun install cp .env.example .env # optional framework overridesBuild and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Docker
docker run --rm -p 3010:3010 ghcr.io/cyanheads/finland-law-mcp-server:latestThe image defaults to HTTP transport, stateless session mode, and logs to /var/log/finland-law-mcp-server. To run it over stdio from an MCP client, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/finland-law-mcp-server:latest"]. To build locally, docker build -t finland-law-mcp-server .; OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Directory | Purpose |
| Ten tool definitions and shared statute schemas |
| Finlex transport, Akoma Ntoso parsing, document lookup, citations, and effective-date reconstruction |
| Fixture-backed integration tests |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Source material from Finlex Open Data, published by Finland’s Ministry of Justice and Legal Register Centre under CC BY 4.0. This server reformats the material.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Temporal search and comparison for official Luxembourg and reviewed EU law, with provenance.
Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.
Search and read UK legislation at any date, resolve citations, list amendments, track changes.
French case law (Judilibre) and codes (Légifrance) from official sources, with citation checking.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables accessing Finnish legislation from the Finlex open-data API, listing statutes by year and retrieving their full texts with ELI identifiers and Finnish citations.443 PyPI1Apache 2.0
- AlicenseAqualityCmaintenanceEnables searching and reading federal statutes with linked legal and inline citations, listing published titles, and retrieving complete sections with bounded pagination through hosted HTTP or local stdio.3MIT
- AlicenseAqualityBmaintenanceEnables read-only search and retrieval of Finnish legislation and multi-tier court decisions from official sources, with citation verification and Markdown conversion of legal documents.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching Brazilian federal norms and STF constitutional-review decisions, resolving citations to Senado IDs, reading published or consolidated texts and specific articles, and tracing amendments by act or provision. Runs over STDIO or Streamable HTTP with an optional local index mirror for cross-year search.Apache 2.0