Pasal

DatabasesCloud and DevOps

Pasal.id - The first open, AI-native Indonesian legal platform. MCP server + REST API + web app giving AI grounded access Indonesian laws.

Your AI app calls the Pasal MCP server, which does the databases and cloud and DevOps work and sends the result back to the chat.

About Pasal

Pasal is a community MCP server from ilhamfp, filed in our directory under databases and cloud and devops. Pasal.id - The first open, AI-native Indonesian legal platform. MCP server + REST API + web app giving AI grounded access Indonesian laws.

Pasal runs as a remote server at https://pasal-mcp-server-production.up.railway.app/mcp, so there is nothing to install: your AI app connects over streamable HTTP, and most remote servers ask you to sign in with OAuth the first time.

At a glance

Publisher
ilhamfp (community)
Runs
As a hosted remote server
Written in
TypeScript
License
AGPL-3.0
GitHub stars
290

How to set up Pasal

  1. Nothing to install: Pasal is a remote server, so all you need is an AI app that accepts a remote MCP URL.
  2. Check the Pasal README for keys or settings; the registry lists none that Pasal requires.
  3. Add Pasal to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Pasal tools to confirm the connection.
  5. Run one read-only task with Pasal first, and keep your app asking before each tool call until the results look right.

Pasal compared with similar servers

  • Mongo by kiliczsh has fewer GitHub stars than Pasal (282 against 290); both are community servers, and Mongo runs on your own machine and Pasal runs as a remote server.
  • Consult7 by szeider has more GitHub stars than Pasal (295 against 290); both are community servers, and Consult7 runs on your own machine and Pasal runs as a remote server.
  • OmniFocus by themotionmachine has fewer GitHub stars than Pasal (256 against 290); both are community servers, and OmniFocus runs on your own machine and Pasal runs as a remote server.

Before you connect Pasal

  • Give Pasal its own sign-in or token with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Pasal tool call until you trust what it does with them.
  • Treat text that Pasal fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Pasal on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Pasal

How marketing and sales teams put Pasal to work, by company size. Pick the size closest to yours and start Pasal on one use case.

Small business

  • A small business with its own app can ask Pasal plain questions about customers and orders, without writing SQL.
  • Owners can use Pasal to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • A small business can ask Pasal why the site is slow or down and get the likely cause in plain words.
  • Pasal runs as a remote server, so a small team can connect it in a few minutes with no install to maintain.

Mid-market

  • Marketing analysts can connect Pasal to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use Pasal to build audience lists from product data and check counts before a send.
  • Web teams can connect Pasal to watch deploys during a launch and roll back fast if a campaign page breaks.
  • Start Pasal on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should point Pasal at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through Pasal, so marketing gets self-serve answers without access to raw customer tables.
  • Enterprises should give Pasal read access first, with changes gated by the same approvals as any infrastructure change.
  • Pasal is a community server, so have security review the code and pin a version before Pasal touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Pasal README

From ilhamfp/pasal on GitHub, shared under its AGPL-3.0 license. Images are left out; the original has them.

README.md

The First Open, AI-Native Platform for Indonesian Law

Demo Video · Website · Connect to Claude · REST API · AGPL-3.0 License

The Problem

280 million Indonesians have no practical way to read their own laws. The official legal database (peraturan.go.id) offers only PDF downloads: no search, no structure, no API. When you ask AI about Indonesian law, you get hallucinated articles and wrong citations because no grounded data source exists.

Try It Now

Connect Claude to real Indonesian legal data in one command:

claude mcp add --transport http pasal-id https://pasal-mcp-server-production.up.railway.app/mcp

Then ask:

"Apa saja hak pekerja kontrak menurut UU Ketenagakerjaan?" (What are contract worker rights under the Labor Law?) "Jelaskan pasal tentang perlindungan data pribadi" (Explain articles on personal data protection) "Apakah UU Perkawinan 1974 masih berlaku?" (Is the 1974 Marriage Law still in force?)

Claude searches 40,000+ regulations and 937,000+ structured articles, cites specific Pasal (articles), and gives grounded answers. No hallucination.

Or browse the web app at pasal.id.

What We Built

Feature Description
Search Full-Text Legal Search Indonesian stemmer + 3-tier fallback across 937,000+ articles
Read Structured Reader Three-column law reader with TOC, amendment timeline, and verification badges
AI MCP Server 4 grounded tools giving Claude access to actual legislation with exact citations
API REST API Public JSON endpoints for search, browsing, and article retrieval
Correct Crowd-Sourced Corrections Anyone can submit corrections; AI verifies before applying
Verify AI Verification Agent Opus 4.6 vision compares parsed text against original PDF images
Track Amendment Chains Full relationship tracking: amendments, revocations, cross-references
Globe Bilingual UI Indonesian + English interface via next-intl (legal content stays Indonesian)

How Opus 4.6 Powers the Platform

The entire codebase, from the Next.js frontend to the MCP server to the data pipeline, was built with Claude Opus 4.6 via Claude Code during the hackathon period. But Opus 4.6 isn't just the development tool. It's embedded in the product itself, running a self-improving correction flywheel that makes the platform more accurate over time:

                    ┌───────────────────────────────┐
                    │     Users submit corrections   │
                    │     via pasal.id web app       │
                    └──────────────┬────────────────┘
                                   ▼
                    ┌───────────────────────────────┐
                    │  Opus 4.6 Verification Agent   │
                    │  Uses VISION to compare text   │
                    │  against original PDF images   │
                    │  → accept / reject / correct   │
                    └──────┬───────────────┬────────┘
                           │               │
              ≥85% conf    │               │    parser_feedback
              auto-apply   │               │    from each review
                           ▼               ▼
                    ┌──────────┐   ┌───────────────────────┐
                    │ Database │   │  Opus 4.6 reads the   │
                    │ updated  │   │  parser source code   │
                    │ via safe │   │  + aggregated feedback │
                    │ revision │   │  → creates GitHub     │
                    │ function │   │    issues with fixes   │
                    └──────────┘   └───────────────────────┘

1. MCP Server: Grounded Legal Access

Claude gets 4 tools to search real legislation, retrieve specific articles, check amendment status, and browse regulations. All returning real data with exact citations, not generated text.

2. Multimodal Verification Agent

When users submit corrections, Opus 4.6 uses vision to compare the parsed text against the original PDF page image. It reads the actual PDF, character by character, and makes accept/reject/correct decisions with confidence scores. (scripts/agent/opus_verify.py)

3. Self-Improving Feedback Loop

Every verification produces parser_feedback: notes on why the parser got it wrong. Opus 4.6 aggregates this feedback, fetches the parser source code from GitHub, analyzes systematic bugs, and creates GitHub issues with specific code fixes. The AI improves the pipeline that feeds it. (scripts/agent/parser_improver.py)

4. Human-in-the-Loop Safety

High-confidence corrections (≥85%) are auto-applied through a transaction-safe revision function. Below that threshold, corrections are queued for admin review. Every mutation is logged in an append-only audit trail. Nothing is silently overwritten.

5. Claude Code as Development Tool

The entire platform was built with Claude Code guided by 489 lines of CLAUDE.md specifications across 4 directories (root, web app, MCP server, and data pipeline), encoding architecture decisions, coding conventions, database invariants, and domain knowledge.

Architecture

                ┌──────────────────────────────────────┐
                │          Supabase (PostgreSQL)        │
                │   40,143 regulations · 937,155 Pasal  │
                │   49 migrations · FTS · RLS            │
                └─────────┬──────────────┬─────────────┘
                          │              │
         ┌────────────────┘              └────────────────┐
         ▼                                                ▼
┌─────────────────────┐                     ┌───────────────────────┐
│   MCP Server (Py)   │                     │   Next.js 16 Web App  │
│   FastMCP · Railway │                     │   Vercel · pasal.id   │
│                     │                     │                       │
│  · search_laws      │                     │  · /search            │
│  · get_pasal        │                     │  · /jelajahi          │
│  · get_law_status   │                     │  · /peraturan/[type]  │
│  · list_laws        │                     │  · /connect · /api    │
└─────────┬───────────┘                     └───────────────────────┘
          │
          ▼                                 ┌───────────────────────┐
┌─────────────────────┐                     │  Opus 4.6 Correction  │
│   Claude / AI       │                     │  Agent · Railway      │
│   Grounded answers  │                     │                       │
│   with citations    │                     │  Verify · Auto-apply  │
└─────────────────────┘                     │  Parser improvement   │
                                            └───────────────────────┘

Built to Last: Technical Depth

This isn't a weekend hack. Key engineering decisions:

  • 49 SQL migrations with iterative schema evolution, not a single dump
  • 3-layer search with identity fast-path: regex-detected regulation IDs (score 1000) → works FTS (score 1-15) → content FTS with 3-tier fallback (websearch_to_tsquery → plainto_tsquery → ILIKE), capped candidate CTEs to prevent O(N) snippet generation
  • Append-only revision audit trail: content is never directly UPDATE'd; all mutations go through apply_revision() SQL function in a single transaction (revision insert + node update + suggestion update)
  • Transaction-safe content mutations: if any step fails, everything rolls back
  • Row-Level Security on all tables with public read policies for legal data
  • Input sanitization: [^a-zA-Z0-9 ] stripped before tsquery to prevent injection
  • ISR with on-demand revalidation for static generation + instant updates when content changes
  • Atomic job claiming: FOR UPDATE SKIP LOCKED prevents duplicate processing in the scraper pipeline
  • 11 regulation types covering laws from 1945 to 2026, from official government sources

MCP Tools

Tool Description
search_laws Full-text keyword search across all legal provisions with Indonesian stemming
get_pasal Get the exact text of a specific article (Pasal) by law and number
get_law_status Check if a law is in force, amended, or revoked with full amendment chain
list_laws Browse available regulations with type, year, and status filters

Tech Stack

Layer Technology
Frontend Next.js 16 (App Router), React 19, TypeScript, Tailwind v4, shadcn/ui
Database Supabase (PostgreSQL FTS with indonesian stemmer + pg_trgm)
MCP Server Python + FastMCP, deployed on Railway
Correction Agent Claude Opus 4.6 (vision + code analysis), deployed on Railway
Data Pipeline Python, httpx, PyMuPDF, BeautifulSoup
Search 3-layer: identity fast-path → works FTS → content FTS with ILIKE fallback
i18n next-intl with Indonesian (default) + English

Legal Coverage

Currently covers 40,143 regulations across 11 types including:

  • UU (Undang-Undang) · Primary laws from parliament
  • PP (Peraturan Pemerintah) · Government regulations
  • Perpres (Peraturan Presiden) · Presidential regulations
  • UUD · The 1945 Constitution
  • Permen, Perda, and more from official government sources

Development

# Frontend
cd apps/web && npm install && npm run dev

# MCP Server
cd apps/mcp-server && pip install -r requirements.txt && python server.py

# Correction Agent
cd scripts && pip install -r requirements.txt
python -m scripts.agent.run_correction_agent

Built with Claude Opus 4.6 for the Claude Code Hackathon
AGPL-3.0

Questions about Pasal

What is the Pasal MCP server?

Pasal.id - The first open, AI-native Indonesian legal platform. MCP server + REST API + web app giving AI grounded access Indonesian laws. Pasal is maintained by ilhamfp on GitHub at ilhamfp/pasal, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I add Pasal to Claude Code?

Pasal is a remote server, so you add its URL instead of installing a package: run claude mcp add --transport http pasal https://pasal-mcp-server-production.up.railway.app/mcp in your terminal. In other apps, add the Pasal URL as a remote or custom connector.

Does Pasal need an API key?

The registry lists no required keys for Pasal. Check the Pasal README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Pasal an official MCP server?

No. Pasal is a community server maintained by ilhamfp. Community servers can be excellent; read the code and the open issues before you give Pasal access to company data.

What license is Pasal under?

Pasal is released under the AGPL-3.0 license, according to its GitHub repository. The license covers the code of Pasal; the service it connects to has its own terms.