Content
# law-open-api-mcp
Republic of Korea [National Law and Regulation Open API](https://open.law.go.kr) (Ministry of Government Legislation)
MCP server that enables calling in natural language from MCP clients such as Claude Desktop.
Provides **195 OPEN APIs** such as laws, administrative rules, local regulations, precedents, constitutional court decisions,
interpretations of laws, committee decisions, treaties, annexed tables and forms, and central ministry interpretations
through a single interface.
## Exposed Tools
| Tool | Description |
|---|---|
| `list_law_apis(query, category, endpoint, limit)` | Search by keyword/category in 195 API catalogs — for finding appropriate `target` |
| `call_law_api(target, endpoint, params)` | Actual API call. `endpoint="search"` (list) / `"service"` (content). Returns JSON response |
## Pre-Setup: Obtain OC (Open Channel) Key
1. Go to https://open.law.go.kr
2. Sign up → Log in
3. Check your OC value in the menu `OPEN API > Application` (usually email ID)
## Installation Method ① — DXT (Windows Office PC, recommended for non-developers)
> No need to install Docker or Python separately; **just Claude Desktop is required.**
1. Download `law-open-api-mcp.dxt` file from the latest release:
https://github.com/ridjunnie/law-open-api-mcp/releases/latest
2. Run Claude Desktop
3. Drag & drop the downloaded `.dxt` file into **Claude Desktop window**
4. Enter your issued OC key in the popup `OC key` field → Click **Install**
5. Done. (No need to restart Claude Desktop)
When updates are available, download the new `.dxt` file from the same page and drag & drop it again.
## Installation Method ② — Docker (for developers / other MCP clients)
Config file location:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
Add the following to the `mcpServers` section (replace `<your-oc>` with your issued OC key):
```json
{
"mcpServers": {
"law-open-api": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "LAW_OC",
"ghcr.io/ridjunnie/law-open-api-mcp:latest"
],
"env": {
"LAW_OC": "<your-oc>"
}
}
}
}
```
Save and **completely restart Claude Desktop (Cmd+Q)**.
> Docker Desktop must be installed and running.
> The image will be automatically pulled on the first run (~80MB).
## Usage Examples (Claude Desktop Chat)
> "Find the upcoming clauses of the Automobile Management Act"
>
> → Claude calls `list_law_apis(category="laws")` →
> calls `call_law_api("eflaw", "search", {"query": "Automobile Management Act"})` →
> summarizes results
> "Show me the latest 5 Supreme Court precedents related to drunk driving"
>
> → `call_law_api("prec", "search", {"query": "drunk driving", "display": 5})`
## Categories (18)
Laws, administrative rules, local regulations, precedents, constitutional court decisions,
interpretations of laws, administrative appeals, committee decisions, treaties,
annexed tables and forms, school regulations, public institutions,
legal terms, mobile, customized, law information knowledge base,
central ministry interpretations, special administrative appeals,
pre-consultation opinions
## Local Build / Development
```bash
# Virtual environment + dependencies
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Update catalog (optional, ~40 seconds)
python crawl.py
# Run directly (LAW_OC required)
LAW_OC=<your-oc> python law_mcp_server.py
# Build Docker
docker build -t law-open-api-mcp:dev .
docker run -i --rm -e LAW_OC=<your-oc> law-open-api-mcp:dev
```
## Notes
- OPEN API response format is forced to `type=JSON`, but some APIs only support XML/HTML.
In such cases, `call_law_api` returns the original content with an `error` key.
- This MCP is an unofficial project and is not affiliated with the Ministry of Government Legislation.
- API call volume follows the daily limit of the issued OC key.
## License
MIT