Taiwan Legal RAG · legal data, inside your AI

Let the AI you already use read Taiwanese law.

Judgments, statutes and administrative rulings come back into the conversation with their sources. No new tool to learn; keep the research workflow you already have.

  • Free to use
  • Fine for law practice
  • Sign in with an account, no API key
  • Retrieval only, no generation
22,795,389
Court judgments
All courts and levels
8,284
Statutes and regulations in force
Constitution, acts, regulations
107,889
Administrative rules
From 90 issuing agencies
4,384,977
Appellate links
Trace a case through the instances

Snapshot as of 2026-11-11, not a live query. Categories and counts follow the public project’s README. Counts in different units (statutes, articles, documents) are not additive.

Get connected

Which AI do you use?

Open the one you use and follow only those steps. The Chinese guide has screenshots for Claude, ChatGPT, Gemini Spark and Copilot: view it here.

MCP endpoint (Streamable HTTP, OAuth with dynamic client registration)

https://tlr.dr-legal.com.tw/mcp
ClaudeWeb / Desktop

Fallback: custom connector URL

https://tlr.dr-legal.com.tw/mcp
  1. Open the Taiwan Legal RAG page in the Claude connector directory (https://claude.ai/directory/taiwan-legal-rag), or search the Claude Directory for Taiwan Legal RAG.
  2. Click Connect, sign in to Dr.Legal on the page that opens, and you are returned to Claude automatically. No URL or API key is needed.
  3. Go back to your tool, confirm the TLR tools are loaded, and run a real query. A saved setting does not mean a working connection.

When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed. Taiwan Legal RAG is listed in the Claude directory as a Community connector; organization accounts may need an administrator to allow it. If the directory is unavailable, open Settings → Connectors, choose Add custom connector, name it Taiwan Legal RAG and paste the URL above. If you added TLR earlier as a custom connector with the legacy URL https://tlr.dr-lawbot.com/mcp, remove it and re-add Taiwan Legal RAG from the directory before 2026-11-15: the legacy host shuts down on that date. Connections already using tlr.dr-legal.com.tw are unaffected.

Taiwan Legal RAG in the Claude directory Claude connector settings

ChatGPTCustom MCP app

Remote MCP server URL

https://tlr.dr-legal.com.tw/mcp
  1. In ChatGPT on the web, click the @ icon in the left sidebar to open Apps, then New → Create custom MCP server. If you do not see it, enable Developer mode in Settings first; organization accounts may need an administrator to allow it.
  2. Name it Taiwan Legal RAG, choose Server URL and paste the URL above, keep authentication on OAuth. TLR supports dynamic client registration, so no client ID or secret is needed.
  3. Confirm the acknowledgement, click Create, complete the authorization, then select TLR in a conversation before asking.

When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed. If Developer mode is missing, check your account permissions; it is not a TLR login failure. Legacy GPT Actions and MCP apps are different mechanisms. The legacy endpoint https://tlr.dr-lawbot.com/mcp shuts down on 2026-11-15. If your existing setup still points to it, change the server URL to https://tlr.dr-legal.com.tw/mcp before then.

Open ChatGPT Apps OpenAI developer mode guide

Claude CodeCommand line

Terminal: add for all your projects

claude mcp add --transport http --scope user tlr https://tlr.dr-legal.com.tw/mcp
  1. Run claude mcp list first to make sure TLR is not already configured. The command uses user scope so your other projects can use it too.
  2. Run the command above, then start Claude Code, type /mcp, pick TLR and complete the authorization.
  3. Go back to your tool, confirm the TLR tools are loaded, and run a real query. A saved setting does not mean a working connection.

Use --scope local instead of --scope user to limit it to the current project. When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed. The legacy endpoint https://tlr.dr-lawbot.com/mcp shuts down on 2026-11-15. If your existing setup still points to it, change the server URL to https://tlr.dr-legal.com.tw/mcp before then.

Claude Code MCP docs

CodexCLI / App

Terminal: add an HTTP MCP server

codex mcp add tlr --url https://tlr.dr-legal.com.tw/mcp
codex mcp login tlr
  1. Run codex mcp list first to confirm TLR is not already set up.
  2. Run the add command; if the tool has not completed authorization yet, run the login command and follow the browser prompts. codex mcp login authorizes TLR; it does not sign you out of Codex or ChatGPT.
  3. In the Codex App, the same server can be added under Settings → Integrations / MCP as a custom HTTP server; local MCP settings are shared with the CLI through config.toml.

When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed.

Codex CLI commands

GeminiCLI / Spark / Antigravity

Merge into ~/.gemini/settings.json (do not overwrite the file)

{
  "mcpServers": {
    "tlr": {
      "httpUrl": "https://tlr.dr-legal.com.tw/mcp"
    }
  }
}
  1. Gemini CLI: use a recent version with HTTP MCP support, merge the tlr entry above into settings.json without removing other mcpServers, start gemini, type /mcp auth tlr and complete the browser authorization. /mcp list shows the status.
  2. Gemini Spark (web): open gemini.google.com/spark/apps → Custom apps, paste the MCP URL, click Continue and authorize. Then select TLR with @ in Spark before asking; ordinary Gemini chat does not get TLR from this setting. Availability depends on your account and region.
  3. Antigravity: add tlr with serverUrl to mcpServers in mcp_config.json, then open Agent settings → Customizations, click Authenticate next to TLR, finish in the browser, copy the authorization code back into the panel and press Submit.

The CLI field is httpUrl; Antigravity uses serverUrl. OAuth needs a browser and a reachable localhost callback, so it will not complete unattended over SSH or in containers. When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed. The legacy endpoint https://tlr.dr-lawbot.com/mcp shuts down on 2026-11-15. If your existing setup still points to it, change the server URL to https://tlr.dr-legal.com.tw/mcp before then.

Gemini CLI MCP docs Gemini Spark custom apps Antigravity MCP docs

Copilot StudioMicrosoft 365 Copilot via an agent

Server URL (Streamable HTTP MCP)

https://tlr.dr-legal.com.tw/mcp
  1. In Copilot Studio, open or create an agent, go to Tools, then Add a tool → New tool → Model Context Protocol.
  2. Enter a server name (for example Taiwan Legal RAG) and description, paste the URL above as Server URL, set Authentication to OAuth 2.0 with Type Dynamic discovery, and click Create.
  3. Choose Create a new connection, complete the authorization, then Add to agent. Test in the agent's chat by asking it to look up a judgment through TLR, then publish the agent to Microsoft 365 Copilot or Teams.

Copilot Studio connects through Power Platform connectors, so your organization's DLP and connector policies apply; the transport is Streamable HTTP, which TLR supports. Microsoft 365 Copilot chat, the lightweight Agent Builder and the consumer copilot.com have no entry point for custom MCP servers; use a Copilot Studio agent instead. When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed. The legacy endpoint https://tlr.dr-lawbot.com/mcp shuts down on 2026-11-15. If your existing setup still points to it, change the server URL to https://tlr.dr-legal.com.tw/mcp before then.

Microsoft docs: add an existing MCP server

TLR CLI / RESTPython / skill / your own code

Install in your own virtual environment and search

python -m pip install twlegalrag
twlegalrag pack "租賃押金返還" -n 3
  1. Requires Python 3.9 or later. Install in your own virtual environment or with pipx; do not modify the system Python.
  2. The pack command bundles retrieval results for your own AI to read and cite.
  3. For your own programs use the public REST interface; the MCP URL is not the REST base URL.

Since 30 October 2026 the public REST API requires a credential: sign in at /mcp/keys to create a connection key (set TWLEGALRAG_TLR_API_KEY), or implement OAuth (authorization-code + PKCE, or the device authorization flow for headless machines) and call with the Bearer access token. Anonymous calls receive 401 with instructions. The CLI does not open an OAuth login page.

CLI install and setup (GitHub) Claude Code skill

Cursor and other MCP clientsAny Streamable HTTP MCP client with OAuth

Streamable HTTP MCP URL

https://tlr.dr-legal.com.tw/mcp
  1. Confirm the tool supports remote Streamable HTTP MCP with OAuth, then add the URL in its MCP settings.
  2. Start the connection from the tool and follow its authorization prompts. Proxies, stdio wrappers and enterprise connectors each have their own configuration; one JSON does not fit all.
  3. If the connection fails, send us the tool name, version and the error message. Never send passwords, keys or authorization callback URLs.

When the tool opens the authorization screen, sign in to Dr.Legal with Google or an email account (free registration on the spot). No API key is needed.

Project and integration notes (GitHub)

Data coverage

What the tools can find

Search and read judgments

Search by issue or retrieve the full text by case number, from every court and level.

Look up statutes and rulings

Statute articles with amendment history, agency interpretations and administrative rules, with validity status.

Trace appeals and verify citations

Appellate links between decisions, plus a citation check list so the AI cites only what it actually read.

Detailed tables by court, agency and document type are on the Chinese page and in the project README. Coverage does not imply completeness of every official source; verify citations against the original text.

A few things to know

Before you start

Do I need an account or an API key?

An account, not a key. Since 30 October 2026, connecting an AI tool to TLR opens the Dr.Legal sign-in page: sign in with Google or an email account (Ask and Search accounts work; registration is free and immediate). Active connections stay signed in; only 30 days of inactivity require signing in again. Servers, schedulers and headless proxies can create a connection key at /mcp/keys after signing in, or use the device authorization flow; organisations may also email [email protected].

Will existing connections break?

Connected tools keep working until their current authorization expires (at most 30 days). The tool then shows the authorization screen again; sign in to Dr.Legal and it continues, with no reinstall. Programs calling the public REST API directly need an OAuth access token or a named API key since 30 October 2026; anonymous calls receive 401 with instructions.

Can I use it for paid legal work?

Yes. Study, research, law practice and internal corporate use are all allowed. Charging for your own legal services is not reselling TLR. Reselling the service, lending credentials, or bulk-mirroring the data requires our written permission; see the Terms of Use.

I connected it, but my AI does not use TLR.

Saving the configuration, completing authorization and actually using the tool are separate steps. Enable TLR in your AI tool, then ask it explicitly to use TLR for the query. ChatGPT requires selecting the app in the conversation; in Gemini, custom apps work in Spark, not in ordinary chat.

What data does TLR receive?

The search parameters your tool sends and the connection record. If the AI puts a fragment of your conversation into a query, that fragment is sent too. Do not send unnecessary personal or confidential information; see the Privacy Notice.

Does the GitHub project include the whole database?

No. The published CLI and skill are clients that connect to the hosted retrieval service; they do not contain the judgment database. The software license (Elastic License 2.0), the hosted service terms and the data scope are documented separately in the project.

TLR Terms of UseTLR Privacy NoticeQuestions or partnerships: [email protected]