Skip to main content
Glama
ryoooo

e-Gov Law MCP Server

by ryoooo

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
EGOV_API_URLNoThe e-Gov API URLhttps://laws.e-gov.go.jp/api/2
EGOV_API_TOKENNoe-Gov API token (usually not required)
LAW_CONFIG_PATHNoPath to the law configuration fileconfig/laws.yaml
MCP_SERVER_NAMENoThe MCP server namee-Gov Law Server v2

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription
find_law_article
Find a specific article in Japanese law (ULTRA SMART & FAST)

Supports 16+ major laws with direct mapping for instant access.
Handles complex patterns like 条の2, 項, 号 automatically.

Args:
    law_name: Law name (e.g., "民法", "会社法", "憲法")
    article_number: Article number (e.g., "192", "325条の3", "第9条第2項")
    ctx: FastMCP context for logging and progress reporting

Returns:
    Dict with found article content and legal analysis metadata
search_laws
Search Japanese laws with smart filtering

Args:
    law_title: Law title (partial match)
    law_type: Law type (Act, CabinetOrder, etc.)
    law_num: Law number (partial match)
    limit: Maximum results (1-500)
    offset: Starting position
    ctx: FastMCP context for logging

Returns:
    Dict with search results
search_laws_by_keyword
Full-text keyword search in Japanese laws

Args:
    keyword: Search keyword (required)
    law_type: Law type filter (optional)
    limit: Maximum results (1-20)
    ctx: FastMCP context for logging

Returns:
    Dict with search results
get_law_content
Get law content (optimized per API spec with size limits)

Args:
    law_id: Law ID
    law_num: Law number
    response_format: "json" or "xml"
    elm: Element to retrieve (currently disabled due to API 400 errors)
    ctx: FastMCP context for logging

Returns:
    Dict with law content. For large laws (>800KB), returns summary with recommendation to use find_law_article for specific articles.

Note:
    - elm parameter is currently disabled due to e-Gov API 400 errors
    - Large laws like Company Law (会社法) will return a summary instead of full text
    - Use find_law_article tool for specific article searches in large laws
batch_find_articles
Batch find multiple law articles efficiently

Args:
    law_article_pairs: JSON string with law-article pairs, e.g. '[{"law":"民法","article":"192"},{"law":"憲法","article":"9"}]'
    ctx: FastMCP context for logging

Returns:
    Dict with batch results and performance stats
prefetch_common_laws
Prefetch commonly accessed laws for better performance

Args:
    ctx: FastMCP context for logging
    
Returns:
    Dict with prefetch results and cache status
get_cache_stats
Get current cache statistics and performance metrics

Args:
    ctx: FastMCP context for logging
    
Returns:
    Dict with detailed cache statistics
clear_cache
Clear specified cache or all caches

Args:
    cache_type: Cache type to clear ("all", "law_lookup", "law_content", "article")
    ctx: FastMCP context for logging

Returns:
    Dict with clear operation results

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
get_api_infoe-Gov Law API v2 information
get_law_typesSupported Japanese law types

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryoooo/e-gov-law-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server