Legal Search MCP

Legal Search MCP

MCP server that enables AI agents to search Korean laws and retrieve article contents using the Korean Ministry of Legislation's law information API.

Category
Visit Server

README

Legal Search MCP

한국 법제처 법령정보 API를 활용한 MCP(Model Context Protocol) 서버입니다. AI 에이전트가 한국 법령을 검색하고 조문 내용을 조회할 수 있도록 지원합니다.

기능

🔍 search-law

법령을 검색합니다.

파라미터 타입 필수 설명
query string ✅ 검색 키워드 (예: "자동차관리법", "개인정보")
searchType enum - name: 법령명 검색(기본), content: 본문 검색
lawStatus enum - current: 현행, scheduled: 시행예정, history: 연혁, all: 전체
display number - 결과 개수 (기본: 20, 최대: 100)
page number - 페이지 번호 (기본: 1)
sort enum - lasc/ldes: 법령명순, dasc/ddes: 공포일순, efasc/efdes: 시행일순
org string - 소관부처 코드 (예: "1613000"=국토교통부)

📖 get-law-detail

법령의 상세 내용(조문)을 조회합니다.

파라미터 타입 필수 설명
lawId string ⚡ 법령 ID (search-law 결과에서 확인)
mst string ⚡ 법령 마스터 번호
efYd string 조건부 시행일자 (mst 사용시 필수, 형식: YYYYMMDD)
articleNumber string - 특정 조문 번호 (6자리: 조번호4자리+가지번호2자리)

⚡ lawId 또는 mst 중 하나는 반드시 입력해야 합니다.

설치

# 의존성 설치
npm install

# 빌드
npm run build

설정

환경 변수

.env.example을 .env로 복사하고 법제처 API 인증 정보를 설정합니다.

cp .env.example .env
# 법제처 API OC 값 (이메일 ID 부분)
# 예: g4c@korea.kr → LAW_API_OC=g4c
# 주의: https://open.law.go.kr 에서 IP 등록이 완료된 환경에서만 작동합니다.
LAW_API_OC=your_email_id_here

⚠️ 중요: 법제처 API는 IP 기반 접근 제어를 수행합니다. API를 호출하는 서버(또는 로컬 PC)의 IP가 국가법령정보센터 Open API 관리 페이지에 등록되어 있어야 합니다.> 💡 법제처 API는 별도 인증 키 없이 이메일 ID(OC)만 입력하면 사용할 수 있습니다.

연결 및 기능 검증

설정 후 아래 명령어로 API 연결과 기능이 정상 작동하는지 확인할 수 있습니다.

npm test

MCP 클라이언트 설정

Cursor / Claude Desktop

~/.cursor/mcp.json 또는 claude_desktop_config.json에 추가:

{
  "mcpServers": {
    "legal-search": {
      "command": "node",
      "args": ["/path/to/legal-search-mcp/dist/index.js"],
      "env": {
        "LAW_API_OC": "your_email_id"
      }
    }
  }
}

npx로 실행 (개발용)

npx @modelcontextprotocol/inspector dist/index.js

사용 예시

법령 검색

"자동차관리법" 검색해줘
국토교통부 소관 법령 중 "도로"가 포함된 법령 찾아줘

법령 상세 조회

자동차관리법(법령ID: 1747)의 전체 내용 보여줘
자동차관리법 제3조 내용만 조회해줘

개발

# 개발 모드 (TypeScript 감시)
npm run dev

# MCP Inspector로 테스트
npm run inspector

라이선스

MIT License

참고

배포 및 공유 방법

1. GitHub에 배포하기 (소스 코드 공유)

소스 코드를 GitHub에 올려 다른 사람들과 공유하거나, 다른 컴퓨터에서 git clone하여 사용할 수 있습니다.

  1. GitHub에서 새 레포지토리(Repository) 생성 (예: legal-search-mcp)
  2. 로컬 프로젝트를 GitHub에 연결 및 푸시:
# git 초기화 (이미 되어 있다면 생략)
git init

# 파일 추가 및 커밋
git add .
git commit -m "Initial commit"

# 원격 저장소 연결 (URL은 본인의 레포지토리 주소로 변경)
git remote add origin https://github.com/YOUR_USERNAME/legal-search-mcp.git
git branch -M main
git push -u origin main

2. NPM에 배포하기 (패키지 공유)

NPM에 배포하면 npx 명령어로 누구나 설치 없이 바로 실행할 수 있습니다. (NPM 계정 필요)

  1. package.json의 name이 유니크한지 확인 (이미 누가 쓰고 있다면 변경 필요)
  2. NPM 로그인 및 게시:
# NPM 로그인
npm login

# 패키지 게시
npm publish --access public

사용법 (배포 후):

npx your-package-name

(물론 .env 설정이나 환경 변수 주입은 필요합니다.)

3. Docker로 실행하기 (권장)

Docker를 사용하면 환경 설정 없이 바로 실행할 수 있습니다.

1. 이미지 빌드

docker build -t legal-search-mcp .

2. 실행 (테스트)

docker run -e LAW_API_OC="본인_OC_코드" legal-search-mcp

3. Claude Desktop 설정 (Docker 사용)

claude_desktop_config.json에 다음과 같이 추가합니다:

{
  "mcpServers": {
    "legal-search-docker": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e", "LAW_API_OC=본인_OC_코드",
        "legal-search-mcp"
      ]
    }
  }
}

4. 상시 실행 (PM2 사용)

로컬 컴퓨터에서 서버를 끄지 않고 계속 실행해두고 싶다면 pm2를 사용할 수 있습니다.

npm install -g pm2
npm run build
pm2 start dist/index.js --name "legal-search-mcp"

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured