Skip to content
Back to search

mcp-regru-mtls

MCP server for Reg.ru DNS API with client TLS certificate (mTLS) support — fork of konser80/mcp-regru

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ferrumlogic--mcp-regru-mtls/badge.svg)](/listings/ferrumlogic--mcp-regru-mtls)

HTML

<a href="/listings/ferrumlogic--mcp-regru-mtls"><img src="/api/listings/ferrumlogic--mcp-regru-mtls/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

git clone https://github.com/FerrumLogic/mcp-regru-mtls.git
cd mcp-regru-mtls
npm install
npm run build

The server entry point is `dist/index.js` (absolute path needed in client configs).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 291 lines
  1. # mcp-regru-mtls
  2. MCP server for managing DNS records via the [Reg.ru API 2.0](https://www.reg.ru/reseller/api2doc), with **client TLS certificate (mTLS) support**.
  3. A fork of [konser80/mcp-regru](https://github.com/konser80/mcp-regru). The upstream server authenticates with a username and password only. Some Reg.ru accounts additionally require a client certificate ("SSL для API"), and such accounts answer every password-only request with:
  4. ```json
  5. { "result": "error", "error_code": "NO_CERTIFICATE", "error_text": "..." }
  6. ```
  7. This fork keeps everything upstream does and adds certificate authentication, so the same MCP server works for both kinds of accounts.
  8. Works with [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Cursor](https://cursor.com), [OpenCode](https://opencode.ai) and any other MCP-compatible client.
  9. ## Requirements
  10. - Node.js >= 18
  11. - A [Reg.ru](https://www.reg.ru/) account with API 2.0 access enabled
  12. ## Installation
  13. ```bash
  14. git clone https://github.com/FerrumLogic/mcp-regru-mtls.git
  15. cd mcp-regru-mtls
  16. npm install
  17. npm run build
  18. ```
  19. The server entry point is `dist/index.js` (absolute path needed in client configs).
  20. ## Configuration
  21. All settings come from environment variables:
  22. | Variable | Required | Description |
  23. |----------|----------|-------------|
  24. | `REGRU_USERNAME` | Yes | Reg.ru account username |
  25. | `REGRU_PASSWORD` | Yes | Reg.ru account password |
  26. | `REGRU_CERT_PATH` | No | Path to the client certificate (PEM), e.g. `/home/me/.creds/regru.crt` |
  27. | `REGRU_KEY_PATH` | No | Path to the certificate private key (PEM), e.g. `/home/me/.creds/regru.key` |
  28. | `REGRU_CERT_BASE64` | No | The same certificate, base64-encoded, in a single variable |
  29. | `REGRU_KEY_BASE64` | No | The same private key, base64-encoded, in a single variable |
  30. | `REGRU_PROXY` | No | HTTP proxy URL (e.g. `http://user:pass@host:port`) |
  31. Certificate settings are resolved in this order:
  32. 1. **Files** — `REGRU_CERT_PATH` + `REGRU_KEY_PATH`
  33. 2. **Base64** — `REGRU_CERT_BASE64` + `REGRU_KEY_BASE64` (fallback, convenient for Docker, CI and remote agents)
  34. 3. **Nothing set** — password-only authentication, exactly like upstream
  35. Only one of the two pairs is used: if the path pair is complete, the base64 pair is ignored. A *half-specified* pair (`cert` without `key`, or the reverse) is a startup error — the server prints the problem to stderr and exits with code 1 instead of silently dropping mTLS and failing later with a confusing `NO_CERTIFICATE`.
  36. At startup the server logs which mode it picked (to stderr, so it never pollutes the stdio MCP channel):
  37. ```
  38. Using client certificate: files /home/me/.creds/regru.crt / /home/me/.creds/regru.key
  39. Using client certificate: base64 environment variables
  40. No client certificate configured, using password-only authentication
  41. ```
  42. ## mTLS: client certificates
  43. ### Why it is needed
  44. Reg.ru can protect API 2.0 with a client certificate. When that option is on, the API validates the TLS client certificate **in addition to** username and password. Without a certificate the connection is rejected with `NO_CERTIFICATE`, no matter how correct the password is. This is mutual TLS (mTLS): both sides present a certificate.
  45. The upstream server only sends `username`/`password` in the POST body, so it cannot work with such an account. This fork loads the certificate and private key into the TLS layer via [undici](https://github.com/nodejs/undici)'s `Agent`, so the handshake itself carries the certificate.
  46. ### How to get a certificate in the Reg.ru panel
  47. 1. Generate a self-signed key pair (Reg.ru accepts a self-signed certificate; the public part is uploaded to the panel):
  48. ```bash
  49. openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
  50. -keyout regru.key -out regru.crt \
  51. -subj "/CN=regru-api-client"
  52. chmod 600 regru.key
  53. ```
  54. 2. In the Reg.ru personal account open **Настройки безопасности** → <https://www.reg.ru/user/prefs/security> and click **«Управление сертификатами»**. Follow the instructions there and upload the contents of `regru.crt`.
  55. 3. Keep `regru.key` private: it is the secret half of the pair. Store both files outside the repository, for example in `~/.creds/regru/`, and never commit them.
  56. 4. Make sure the machine's public IP is allowed in the API settings as well — Reg.ru checks the IP allowlist independently of the certificate (see [Troubleshooting](#troubleshooting)).
  57. ### Mode 1 — certificate files (recommended for a workstation)
  58. ```json
  59. {
  60. "REGRU_USERNAME": "your_username",
  61. "REGRU_PASSWORD": "your_password",
  62. "REGRU_CERT_PATH": "/home/you/.creds/regru/regru.crt",
  63. "REGRU_KEY_PATH": "/home/you/.creds/regru/regru.key"
  64. }
  65. ```
  66. Paths are read once at startup. The key may be an unencrypted PEM (`BEGIN PRIVATE KEY` or `BEGIN RSA PRIVATE KEY`); encrypted keys are not supported by Node's TLS stack without a passphrase, so generate the pair with `-nodes`.
  67. ### Mode 2 — base64 in environment variables (Docker, CI, remote agents)
  68. Useful when there is no filesystem to mount, or when secrets are injected as environment values by a secret manager:
  69. ```bash
  70. # one-line base64, no wrapping
  71. base64 -w0 regru.crt # Linux
  72. base64 regru.crt | tr -d '\n' # macOS
  73. ```
  74. Then set:
  75. ```json
  76. {
  77. "REGRU_USERNAME": "your_username",
  78. "REGRU_PASSWORD": "your_password",
  79. "REGRU_CERT_BASE64": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t...",
  80. "REGRU_KEY_BASE64": "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0t..."
  81. }
  82. ```
  83. Whitespace inside the value is ignored, and literal `\n` sequences are tolerated, so a PEM pasted with escaped newlines still decodes.
  84. > Base64 is an encoding, not encryption. Anyone who can read the environment of the process can read the key — protect the config file with `chmod 600` and prefer a secret manager where available.
  85. ### Mode 3 — password only (upstream behaviour)
  86. If the account does not require a certificate, set neither pair and the server behaves exactly like upstream:
  87. ```json
  88. {
  89. "REGRU_USERNAME": "your_username",
  90. "REGRU_PASSWORD": "your_password"
  91. }
  92. ```
  93. ### Certificates and proxy together
  94. If both `REGRU_PROXY` and a certificate pair are set, the certificate is attached to the proxy tunnel's TLS handshake (`requestTls` of undici's `ProxyAgent`), so mTLS keeps working through an HTTP proxy instead of being silently dropped.
  95. ## Client configuration
  96. ### Claude Code
  97. Project-level `.mcp.json` in the repository root, or `~/.claude/settings.json` for all projects:
  98. ```json
  99. {
  100. "mcpServers": {
  101. "regru": {
  102. "command": "node",
  103. "args": ["/absolute/path/to/mcp-regru-mtls/dist/index.js"],
  104. "env": {
  105. "REGRU_USERNAME": "your_username",
  106. "REGRU_PASSWORD": "your_password",
  107. "REGRU_CERT_PATH": "/home/you/.creds/regru/regru.crt",
  108. "REGRU_KEY_PATH": "/home/you/.creds/regru/regru.key"
  109. }
  110. }
  111. }
  112. }
  113. ```
  114. Same with base64 instead of paths — swap the two `*_PATH` keys for `REGRU_CERT_BASE64` / `REGRU_KEY_BASE64`.
  115. ### Cursor
  116. `.cursor/mcp.json` in the project or `~/.cursor/mcp.json` globally:
  117. ```json
  118. {
  119. "mcpServers": {
  120. "regru": {
  121. "command": "node",
  122. "args": ["/absolute/path/to/mcp-regru-mtls/dist/index.js"],
  123. "env": {
  124. "REGRU_USERNAME": "your_username",
  125. "REGRU_PASSWORD": "your_password",
  126. "REGRU_CERT_PATH": "/home/you/.creds/regru/regru.crt",
  127. "REGRU_KEY_PATH": "/home/you/.creds/regru/regru.key"
  128. }
  129. }
  130. }
  131. }
  132. ```
  133. ### OpenCode
  134. `opencode.json` (project) or `~/.config/opencode/opencode.json` (global). Note that OpenCode uses `command` as an array and `environment` instead of `env`:
  135. ```json
  136. {
  137. "$schema": "https://opencode.ai/config.json",
  138. "mcp": {
  139. "regru": {
  140. "type": "local",
  141. "command": ["node", "/absolute/path/to/mcp-regru-mtls/dist/index.js"],
  142. "environment": {
  143. "REGRU_USERNAME": "your_username",
  144. "REGRU_PASSWORD": "your_password",
  145. "REGRU_CERT_PATH": "/home/you/.creds/regru/regru.crt",
  146. "REGRU_KEY_PATH": "/home/you/.creds/regru/regru.key"
  147. }
  148. }
  149. }
  150. }
  151. ```
  152. For base64 in OpenCode, keep the values on a single line inside `environment`:
  153. ```json
  154. "environment": {
  155. "REGRU_USERNAME": "your_username",
  156. "REGRU_PASSWORD": "your_password",
  157. "REGRU_CERT_BASE64": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t...",
  158. "REGRU_KEY_BASE64": "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0t..."
  159. }
  160. ```
  161. ### Other MCP clients
  162. Use the stdio transport your client supports: command `node`, argument `/absolute/path/to/mcp-regru-mtls/dist/index.js`, and the environment variables listed above.
  163. ## Tools
  164. | Tool | Description |
  165. |------|-------------|
  166. | `regru_check_domain_availability` | Check if one or more domains are available for registration |
  167. | `regru_get_dns_records` | Get all DNS records for a domain |
  168. | `regru_add_a_record` | Add an A record (IPv4) |
  169. | `regru_add_aaaa_record` | Add an AAAA record (IPv6) |
  170. | `regru_add_cname_record` | Add a CNAME record (alias) |
  171. | `regru_add_mx_record` | Add an MX record (mail exchange) |
  172. | `regru_add_txt_record` | Add a TXT record (SPF, DKIM, verification) |
  173. | `regru_add_ns_record` | Add an NS record (nameserver delegation) |
  174. | `regru_add_srv_record` | Add an SRV record (service discovery) |
  175. | `regru_add_caa_record` | Add a CAA record (certificate authority) |
  176. | `regru_remove_record` | Remove a specific DNS record |
  177. | `regru_update_records` | Bulk add/remove DNS records |
  178. | `regru_update_soa` | Update SOA record TTL settings |
  179. | `regru_update_nss` | Replace the domain's authoritative nameservers (with optional glue records) |
  180. | `regru_get_nss` | Get the domain's current authoritative nameservers |
  181. | `regru_clear_zone` | Remove all DNS records (destructive) |
  182. ## Usage examples
  183. Once configured, manage DNS through natural language:
  184. - "Is example.com available?"
  185. - "Check example.com, example.ru and example.net"
  186. - "Show DNS records for example.com"
  187. - "Point www.example.com to 1.2.3.4"
  188. - "Add an MX record for Google Workspace"
  189. - "Add an SPF record for example.com"
  190. - "Remove the old A record for api.example.com"
  191. ## Troubleshooting
  192. | Symptom | Cause and fix |
  193. |---------|----------------|
  194. | `NO_CERTIFICATE` in the API response | The account requires a client certificate and none was sent. Set `REGRU_CERT_PATH`+`REGRU_KEY_PATH` or the base64 pair. |
  195. | `ERROR: REGRU_CERT_PATH and REGRU_KEY_PATH must be set together` | Only half of the pair is configured. Set both variables or neither. |
  196. | `ERROR: Cannot read REGRU_CERT_PATH (...): file not found` | Wrong path, or the client runs as a different user. Use an absolute path and check `chmod`/ownership. |
  197. | `ERROR: Cannot read ... : permission denied` | The key is not readable by the user running the MCP client. `chmod 600` the key and make sure the owner is correct. |
  198. | `ACCESS_DENIED_FROM_IP` | Reg.ru rejects the request because the machine's public IP is not in the API allowlist. Add the IP in the personal account; the certificate does not replace the allowlist. |
  199. | TLS handshake errors mentioning the key | The key does not match the certificate, or it is passphrase-protected. Regenerate the pair with `openssl req -x509 -nodes ...`. |
  200. | Server starts but tools fail with auth errors | Check `REGRU_USERNAME`/`REGRU_PASSWORD`; the certificate is an extra factor, not a replacement. |
  201. Server diagnostics go to stderr and appear in the MCP client's log for this server.
  202. ## Security notes
  203. - Never commit `*.crt`, `*.key`, `*.pem`, `.env` files or base64-encoded keys. `.gitignore` in this repository already covers the common certificate extensions.
  204. - Keep the private key outside the repository (`~/.creds/...`) and readable only by your user (`chmod 600`).
  205. - Base64 variables are convenient but not secret storage: config files holding them need `chmod 600`.
  206. - Rotate the pair if the key may have leaked: upload the new certificate in the Reg.ru panel and replace both files/variables.
  207. ## Development
  208. ```bash
  209. npm run dev # Watch mode with tsx
  210. npm run build # Compile TypeScript
  211. npm start # Run compiled server
  212. ```
  213. `ARCHITECTURE.md` describes the code layout and how to add a new tool.
  214. ## License
  215. MIT — see [LICENSE](LICENSE).
  216. Original project: [konser80/mcp-regru](https://github.com/konser80/mcp-regru), © konser80.
  217. mTLS support and base64 configuration: © FerrumLogic.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.