MCP connect

Connect your AI assistant to Singapore law.

Add laws.sg as an MCP server so Claude, Cursor, and other assistants can search and cite Singapore legislation directly, using your personal access token.

Token

Create a personal MCP token from your account. Tokens are shown once and can be revoked any time.

Manage tokens

Endpoint

https://laws.sg/api/mcp
{
  "mcpServers": {
    "laws.sg": {
      "type": "streamable-http",
      "url": "https://laws.sg/api/mcp",
      "headers": {
        "Authorization": "Bearer laws_sg_REPLACE_WITH_YOUR_TOKEN"
      }
    }
  }
}

Client setup

Codex CLI

Use an environment-backed bearer token so the token does not live in the config file.

export LAWS_SG_MCP_TOKEN=laws_sg_REPLACE_WITH_YOUR_TOKEN
codex mcp add laws-sg --url https://laws.sg/api/mcp --bearer-token-env-var LAWS_SG_MCP_TOKEN

Claude Desktop or Claude CLI

Add the remote HTTP server with an Authorization header.

export LAWS_SG_MCP_TOKEN=laws_sg_REPLACE_WITH_YOUR_TOKEN
claude mcp add --transport http laws-sg https://laws.sg/api/mcp --header "Authorization: Bearer ${LAWS_SG_MCP_TOKEN}"

Cursor

Use mcp.json with a streamable HTTP server and a token environment variable.

{
  "mcpServers": {
    "laws.sg": {
      "type": "streamable-http",
      "url": "https://laws.sg/api/mcp",
      "headers": {
        "Authorization": "Bearer ${LAWS_SG_MCP_TOKEN}"
      }
    }
  }
}

VS Code MCP

Prompt for the token at runtime and pass it as an Authorization header.

{
  "inputs": [
    {
      "type": "promptString",
      "id": "laws-sg-mcp-token",
      "description": "laws.sg MCP token",
      "password": true
    }
  ],
  "servers": {
    "laws.sg": {
      "type": "http",
      "url": "https://laws.sg/api/mcp",
      "headers": {
        "Authorization": "Bearer ${input:laws-sg-mcp-token}"
      }
    }
  }
}