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
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:
-
List existing servers:
codex mcp list -
If
regex101is absent, add it:codex mcp add regex101 --url https://regex101.com/mcp -
Start browser sign-in:
codex mcp login regex101 -
Complete sign-in and approve access for the named client.
-
Start a new Codex session.
-
Use
/mcpto verify that the regex101 tools are available.
Claude Code
-
Run
claude mcp listto see existing servers. -
If
regex101is absent, add it for all projects:claude mcp add --transport http --scope user regex101 https://regex101.com/mcp -
Open
/mcpin Claude Code. -
Select
regex101and start authentication. -
Complete browser sign-in and approve access for the named client.
Cursor
- Open Add regex101 to Cursor.
- Approve the server installation.
- 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.
- Add a remote Streamable HTTP server named
regex101. - Set its URL to
https://regex101.com/mcp. - 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_tagsto 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.
-
Install the skill:
npx skills add firasdib/regex101-skills --skill regex101 --global -
When the installer prompts, select your agent.
-
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
| Tool | Action |
|---|---|
get_workspace | Read a workspace by permalinkFragment; omit version for the latest version. |
get_user_tags | List tags used by the signed-in account. |
find_workspaces_by_tags | Find account workspaces with every supplied tag; use page for pagination. |
save_workspace | Create a public workspace. |
update_workspace | Add a version to an existing workspace. |
set_workspace_title | Change the title of an owned workspace. |
set_workspace_tags | Replace the tags of an owned workspace. |
delete_workspace | Permanently delete an owned workspace. |
delete_workspace_version | Permanently delete one owned version; deleting its last version deletes the workspace. |
explain_regex | Return 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:
- Get the workspace with
get_workspace. - Change the fields required by your task.
- Preserve its other fields, including test strings and unit tests.
- Use
update_workspacewith the existingpermalinkFragmentand 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 acceptORD-0042and rejectORD-42andXORD-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 flagi. Useexplain_regexwith 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.