# Lokal

> Lokal is an open-source MCP server for security. Indonesia-ready agent tools: NIK, NPWP, phone, QRIS, Rupiah, regions and PII masking. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/lokal-id/lokal/tree/HEAD/packages/mcp
- **MCP Registry name:** io.github.lokal-id/lokal
- **Categories:** [security](https://ai-powered.com/categories/security), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Indonesian data has quirks a general model gets wrong, and this server encodes them. parse_nik decodes region, birth date and sex; validate_npwp handles 15- and 16-digit numbers; parse_qris checks a payment payload including its CRC, and set_qris_amount makes a merchant code dynamic. Rupiah tools write terbilang and read slang like "2jtan" or "goceng". Kemendagri region and postal code data back search_wilayah, lookup_kode_pos and parse_alamat, and list_holidays and working_days know national holidays and cuti bersama for 2026 and 2027.

The larger part is Samaran. read_file_masked opens CSV, Excel, logs, DOCX or text PDFs with personal data swapped for stable placeholders, and write_file_unmasked restores the real values locally. File tools are confined to LOKAL_ROOT. A guard hook blocks prompts and commands that would print personal files, a proxy masks LLM requests, and Kembaran produces realistic stand-ins for staging data.

The code is MIT licensed. An optional NER model catches names without cues.

## Features

- **Identity validation:** parse_nik, validate_npwp and parse_phone check and decode Indonesian identifiers.
- **QRIS payloads:** Read and verify a payload, or set an amount with a new CRC.
- **Regions and postcodes:** Provinces down to villages with codes and postal codes.
- **Masked file reading:** Personal data becomes placeholders, restored on write, locally.
- **Samaran Guard:** Hook that holds prompts and commands that would expose personal data.
- **Staging data:** anonymize_file makes realistic stand-ins for every person.

## Good for

- Validate a customer's NIK and NPWP in a workflow
- Let an agent analyse a production CSV without seeing real personal data
- Compute SLA due dates around Indonesian holidays
- Parse a free-text Indonesian address into regions and postal code

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add lokal -- npx -y @lokal-id/mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "lokal": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add lokal -- npx -y @lokal-id/mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.lokal]
command = "npx"
args = ["-y", "@lokal-id/mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user lokal npx -- -y @lokal-id/mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "lokal": {
      "command": "npx",
      "args": [
        "-y",
        "@lokal-id/mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 18 tools change data; 10 names don't say. From the server's own tool labels and tool names; not verified by us.

- `parse_nik`: Validate and decode a NIK
- `validate_npwp` (name suggests: reads): Validate a 15- or 16-digit NPWP
- `parse_phone`: Normalise phone numbers
- `parse_qris`: Read and check a QRIS payload
- `set_qris_amount` (name suggests: changes): Make a merchant QRIS dynamic for an amount
- `format_rupiah`: Format Rupiah amounts
- `parse_rupiah`: Parse Rupiah expressions into numbers
- `search_wilayah` (name suggests: reads): Search Indonesian regions
- `list_wilayah` (name suggests: reads): List regions
- `lookup_kode_pos` (name suggests: reads): Postal code to villages
- `parse_alamat`: Free-text address to structured parts
- `list_holidays` (name suggests: reads): National holidays and cuti bersama
- `working_days`: Working-day and SLA date calculations
- `scan_pii`: Scan files for personal data
- `read_file_masked` (name suggests: reads): Read a file with personal data masked
- `write_file_unmasked` (name suggests: changes): Write results with placeholders restored
- `anonymize_file`: Copy files with realistic stand-ins
- `clear_vault`: Forget real values behind placeholders

## FAQ

### Where is the data masked?

On your machine; the vault of real values stays local.

### Is there a hosted mode?

lokal-mcp serve --http offers the data tools over HTTP, without file tools.

### What licence?

MIT.

### Which files can Lokal read masked?

Text, CSV, JSON, logs, xlsx, docx and text-based PDF.

### How do I clear Lokal?

clear_vault forgets every real value behind the session's placeholders.

### Is Lokal free?

Yes. Lokal is open source, so you can use and self-host it for free.

### How do I add Lokal to Claude Code?

Run this command in your terminal: claude mcp add lokal -- npx -y @lokal-id/mcp

### What are the best alternatives to Lokal?

The closest alternatives to Lokal are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/lokal
