Skip to main content

Connect AI tools to regex101 with MCP

The regex101 MCP server lets an AI client read, save, and organize workspaces. Pro accounts can also request regex explanations. Open a returned workspace link to inspect and test the pattern locally in your browser.

Server URL: https://regex101.com/mcp

Plan access​

Free
Basic tools with an account
Pro
Requires account
Self-hosted
Optional add-on with account
Compare plans

Workspace tools use your account permissions. Saving more than two test strings requires Pro on regex101.com, even when the workspace tool itself is available.

The explain_regex tool requires Pro. A self-hosted deployment needs the MCP entitlement and the separate Explain Regex API entitlement for explanations.

The save and update tools accept regular workspaces. Use the Workspace API for substitution pipelines.

Connect a client​

Choose the instructions for your client. The connection uses browser sign-in. No API key is required.

Codex​

Use the Codex CLI to add the server:

  1. List existing servers:

    codex mcp list
  2. If regex101 is absent, add it:

    codex mcp add regex101 --url https://regex101.com/mcp
  3. Start browser sign-in:

    codex mcp login regex101
  4. Complete sign-in and approve access for the named client.

  5. Start a new Codex session.

  6. Use /mcp to verify that the regex101 tools are available.

Codex MCP reference.

Claude Code​

  1. Run claude mcp list to see existing servers.

  2. If regex101 is absent, add it for all projects:

    claude mcp add --transport http --scope user regex101 https://regex101.com/mcp
  3. Open /mcp in Claude Code.

  4. Select regex101 and start authentication.

  5. Complete browser sign-in and approve access for the named client.

Claude Code MCP reference.

Cursor​

  1. Open Add regex101 to Cursor.
  2. Approve the server installation.
  3. When Cursor prompts for authentication, complete browser sign-in.

Manage the connection under Customize > MCPs. The Cursor MCP reference also covers manual installation with mcp.json.

Other clients and self-hosted deployments​

The client must support remote Streamable HTTP servers and OAuth.

  1. Add a remote Streamable HTTP server named regex101.
  2. Set its URL to https://regex101.com/mcp.
  3. Complete browser sign-in and approve access for the named client.

For a self-hosted deployment, use its /mcp URL. Your administrator must enable MCP and configure account sign-in.

Verify the connection​

Give your client this task:

Use get_user_tags to list my regex101 workspace tags.

An empty tag list is a valid result. This request reads account data without creating a workspace. If authentication fails, repeat the sign-in step for your client.

Use the regex101 skill​

The optional regex101 skill on GitHub gives compatible agents a workflow for saved regexes and unit-test definitions. Follow-up edits add versions to the same workspace and preserve unrelated fields. If the MCP tools are unavailable, the skill guides client setup and browser sign-in.

  1. Install the skill:

    npx skills add firasdib/regex101-skills --skill regex101 --global
  2. When the installer prompts, select your agent.

  3. Restart your agent to load the skill.

The installation README includes commands for Codex, Claude Code, Cursor, and project installations. The skill uses MCP tools. Run saved unit tests in the regex101 browser editor to verify their results.

Tools​

ToolAction
get_workspaceRead a workspace by permalinkFragment; omit version for the latest version.
get_user_tagsList tags used by the signed-in account.
find_workspaces_by_tagsFind account workspaces with every supplied tag; use page for pagination.
save_workspaceCreate a public workspace.
update_workspaceAdd a version to an existing workspace.
set_workspace_titleChange the title of an owned workspace.
set_workspace_tagsReplace the tags of an owned workspace.
delete_workspacePermanently delete an owned workspace.
delete_workspace_versionPermanently delete one owned version; deleting its last version deletes the workspace.
explain_regexReturn a text or structured explanation of a pattern.

Workspace workflow​

save_workspace creates a public workspace. It does not accept a private save mode. For private content, use the browser's private save mode or the Workspace API.

To add a version to an existing workspace:

  1. Get the workspace with get_workspace.
  2. Change the fields required by your task.
  3. Preserve its other fields, including test strings and unit tests.
  4. Use update_workspace with the existing permalinkFragment and the complete updated workspace.

Use save_workspace when you need a separate workspace. Set its title and tags with the metadata tools after creation.

Save and update results include a workspaceUrl you can open in the browser. MCP results omit the REST API's delete codes.

Save a pattern for local verification​

For synthetic input, give your client this task:

Create a new JavaScript workspace with ^ORD-[0-9]{4}$ and no flags. Include unit tests that accept ORD-0042 and reject ORD-42 and XORD-0042. Return the workspace link.

Open the returned link. Select Unit Tests, then Run tests. The MCP tool saves the expectations. The browser runs them. Verify an AI-generated regex explains how to choose cases and verify the target runtime.

Try an explanation​

For example, give your client this task:

Explain [a-z]+ with PCRE2 and flag i. Use explain_regex with text output.

The tool call uses this input:

{
"pattern": "[a-z]+",
"parserOptions": { "flavor": "pcre2", "flags": "i", "delimiter": "/" },
"format": "text"
}

The explanation identifies a character range, repetition of at least one character, and case-insensitive matching.

Privacy and processing​

MCP requests exchange the supplied fields with regex101. The AI client controls how it handles conversation content and tool results. The MCP tools manage workspaces and explain patterns. They do not run matches or unit tests. Matching runs locally after you open the workspace in the browser editor. See privacy and local processing.

Authentication​

The MCP connection requires sign-in. The client completes OAuth in your browser and stores the resulting credential.

Do not put credentials in prompts, workspace content, or shared URLs. Your client controls which tool results enter its conversation.

If sign-in expires, reconnect through your client. If a tool returns a plan or permission error, verify account access before retrying.