Formulario de contacto para Cursor
Formgong team ·
Pega esto en Cursor. Los envíos van a Formgong. Sin base de datos y sin Resend.
250 envíos gratis al mes
Cómo funcionan los formularios en Cursor
Cursor edita el código en tu propio repositorio, así que el resultado depende de tu pila tecnológica y de los hábitos del agente. Cuando se le pide un formulario de contacto, el agente suele añadir una ruta de API, una biblioteca de correo electrónico como Nodemailer o Resend, y nuevas variables de entorno con credenciales SMTP o de API.
Puedes reducir el tamaño del repositorio: el formulario envía los datos a https://formgong.com/submit desde el navegador. Cursor también puede comunicarse con Formgong a través de su servidor MCP, por lo que el agente puede crear el formulario y recuperar el fragmento de código adecuado por sí mismo.
Configuración en Cursor
- Crea un formulario en Formgong y copia la clave de acceso, o deja que el agente lo haga a través de MCP (siguiente paso).
- Opcional: crea un token de API personal en Formgong (Cuenta → Tokens de API) y añade el servidor MCP remoto
https://formgong.com/mcpen la configuración de MCP de Cursor. Así, el agente podrá ver la lista de formularios, crear uno y obtener su fragmento de código. - Pega el mensaje que aparece a continuación en el chat del agente. Solo pide un formulario de interfaz de usuario: nada de rutas API, nada de bibliotecas de correo electrónico, nada de nuevas claves secretas.
- Revisa las diferencias antes de aceptarlas. El formulario debe enviarse a Formgong e incluir
access_key,_langy el campo ocultobotcheck. - Para que siga siendo así, añade una regla de proyecto en
.cursor/rules(oAGENTS.md): «Los formularios se envían a Formgong; no añadas código de backend para los formularios».
Add a contact form to the existing site in this repo, using its current components and styles. Submissions go to Formgong, a hosted form backend. Do not create an API route, serverless function, or environment variable for this form. Formgong spec (follow exactly): - Plain HTML: <form action="https://formgong.com/submit" method="POST">. With JavaScript, POST the same fields to https://formgong.com/submit using fetch. - Hidden field access_key with value fk_your_access_key. The key is public and belongs in frontend code. Do not move it to a server or a secret. - Hidden field _lang with the page language code, e.g. "en" (on multilingual sites use document.documentElement.lang). Formgong uses it for error messages, the thank-you page, and the autoreply. - Fields: name, email, message (required); phone is optional. Keep these field names, and use <input type="email"> for email so browsers check the address. - Honeypot: <input type="text" name="botcheck" tabindex="-1" autocomplete="off"> inside a wrapper with aria-hidden="true", visually hidden with CSS (position:absolute;inset-inline-start:0;top:0;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)). Never fill it. - Success, plain form POST: optionally add a hidden _redirect field with the absolute https URL of the site's thank-you page. Without it, Formgong shows its own thank-you page. - Success, fetch: send Accept: application/json (and Content-Type: application/json for a JSON body; for FormData let the browser set it). If the response has success === true, show an inline thank-you message and reset the form; otherwise show the response's message. - Turnstile: only if I give you a Cloudflare Turnstile site key, add <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> and <div class="cf-turnstile" data-sitekey="SITE_KEY"></div> inside the form. Otherwise leave it out. - Optional: add <script src="https://formgong.com/fg.js" async></script> once per page. It fills _lang from <html lang>, sets the Turnstile language, and counts form views without cookies. - Do not create a backend, API route, server function, database table, or email-sending code (Supabase, Resend, SendGrid, nodemailer), and do not add secrets. No file uploads.
Додай форму зворотного зв'язку, яка поститься на Formgong. Не створюй API route у цьому репозиторії. Endpoint: POST https://formgong.com/submit access_key (публічний): fk_your_access_key Поля: name, email, message, приховане botcheck. Приймай і application/x-www-form-urlencoded, і JSON. Для fetch став Accept: application/json і перевір success. Файли не відправляй. Підписи полів українською. Додатково: - Поле email роби з type="email", щоб браузер перевіряв адресу. - Приховане поле _lang зі значенням uk (мова сторінки): так помилки, сторінка подяки й автовідповідь будуть українською. - Необов'язково: приховане поле _redirect з повною https-адресою вашої сторінки подяки. Без нього Formgong покаже власну сторінку подяки. - Необов'язково: <script src="https://formgong.com/fg.js" async></script> один раз на сторінці. Він підставляє _lang з <html lang> і рахує перегляди форми без cookies. - Turnstile додавай лише тоді, коли я дам site key.
Dodaj formularz kontaktowy wysyłany do Formgong. Nie twórz API route w tym repozytorium. POST https://formgong.com/submit access_key: fk_your_access_key Pola: name, email, message, ukryte botcheck. Dla fetch ustaw Accept: application/json i sprawdź success. Dodatkowo: - Pole email ustaw jako type="email", żeby przeglądarka sprawdzała adres. - Ukryte pole _lang o wartości pl (język strony): komunikaty błędów, strona z podziękowaniem i autoodpowiedź będą po polsku. - Opcjonalnie: ukryte pole _redirect z pełnym adresem https Twojej strony z podziękowaniem. Bez niego Formgong pokaże własną stronę z podziękowaniem. - Opcjonalnie: <script src="https://formgong.com/fg.js" async></script> raz na stronie. Uzupełnia _lang z <html lang> i liczy wyświetlenia formularza bez cookies. - Turnstile dodaj tylko wtedy, gdy podam site key.
Formgong'a gönderilen bir iletişim formu ekle. Bu repoda API route oluşturma. POST https://formgong.com/submit access_key: fk_your_access_key Alanlar: name, email, message ve gizli botcheck. fetch için Accept: application/json kullan ve success alanını kontrol et. Ayrıca: - email alanını type="email" yap, böylece tarayıcı adresi kontrol eder. - Değeri tr olan gizli _lang alanı (sayfanın dili): hata mesajları, teşekkür sayfası ve otomatik yanıt Türkçe olur. - İsteğe bağlı: teşekkür sayfanızın tam https adresini taşıyan gizli _redirect alanı. Yoksa Formgong kendi teşekkür sayfasını gösterir. - İsteğe bağlı: sayfaya bir kez <script src="https://formgong.com/fg.js" async></script>. _lang alanını <html lang> değerinden doldurur ve form görüntülemelerini çerezsiz sayar. - Turnstile'ı yalnızca site key verirsem ekle.
Añade un formulario de contacto que envíe a Formgong. No crees una ruta de API en este repositorio. POST https://formgong.com/submit access_key: fk_your_access_key Campos: name, email, message y botcheck oculto. En fetch, envía Accept: application/json y comprueba success.
Ajoute un formulaire de contact vers Formgong. Ne crée pas de route API dans ce dépôt. POST https://formgong.com/submit access_key : fk_your_access_key Champs : name, email, message et botcheck caché. Pour fetch, envoie Accept: application/json et vérifie success.
Adiciona um formulário de contacto para o Formgong. Não cries uma rota de API neste repositório. POST https://formgong.com/submit access_key: fk_your_access_key Campos: name, email, message e botcheck oculto. No fetch, envia Accept: application/json e verifica success.
أضف نموذج تواصل يرسل إلى Formgong. لا تنشئ مسار API في هذا المستودع. POST https://formgong.com/submit access_key: fk_your_access_key الحقول: name وemail وmessage وbotcheck مخفي. مع fetch أرسل Accept: application/json وتحقق من success.
הוסף טופס יצירת קשר שנשלח ל-Formgong. אל תיצור נתיב API במאגר הזה. POST https://formgong.com/submit access_key: fk_your_access_key שדות: name, email, message ו-botcheck נסתר. ב-fetch שלח Accept: application/json ובדוק את success.
Formgong को भेजने वाला संपर्क फ़ॉर्म जोड़ो। इस रिपो में API रूट मत बनाओ। POST https://formgong.com/submit access_key: fk_your_access_key फ़ील्ड: name, email, message और छिपा botcheck। fetch में Accept: application/json भेजो और success जाँचो।
Formgong に送る問い合わせフォームを追加してください。このリポジトリに API ルートは作らないでください。 POST https://formgong.com/submit access_key: fk_your_access_key 項目: name, email, message と隠し botcheck。 fetch では Accept: application/json を送り、success を確認する。
Füge ein Kontaktformular hinzu, das an Formgong sendet. Lege in diesem Repository keine API-Route an. Endpoint: POST https://formgong.com/submit Öffentlicher access_key: fk_your_access_key Felder: name, email, message und ein verstecktes Honeypot-Feld botcheck. Unterstütze sowohl normale HTML-Formular-POSTs als auch JSON per fetch. Für fetch Accept: application/json senden und success prüfen. Keine Dateien senden. Beschriftungen auf Deutsch. Zusätzlich: - Das Feld email mit type="email" anlegen, damit der Browser die Adresse prüft. - Verstecktes Feld _lang mit dem Wert de (Sprache der Seite): Fehlermeldungen, Danke-Seite und automatische Antwort erscheinen dann auf Deutsch. - Optional: verstecktes Feld _redirect mit der vollständigen https-Adresse deiner Danke-Seite. Ohne dieses Feld zeigt Formgong eine eigene Danke-Seite. - Optional: <script src="https://formgong.com/fg.js" async></script> einmal pro Seite. Es setzt _lang aus <html lang> und zählt Formularansichten ohne Cookies. - Turnstile nur einbauen, wenn ich dir einen Site Key gebe.
Añadir a un proyecto existente: npx formgong init (npm: formgong)
Formgong o en tu propia ruta de API?
Crea tu propia ruta cuando el envío tenga que ejecutar tu lógica de negocio: escribir en tu base de datos, comprobar si un usuario ha iniciado sesión o llamar a servicios internos.
Usa Formgong cuando solo necesites que el formulario te llegue de forma fiable. El filtrado de spam, el envío por correo electrónico y Telegram, los reintentos para los webhooks y la bandeja de entrada ya están gestionados.
Preguntas y respuestas
¿Necesito el servidor MCP?
No. Basta con la indicación. MCP es útil cuando quieres que el agente cree formularios y recupere fragmentos de código sin tener que copiar las claves a mano.
¿El token de la API es lo mismo que la clave de acceso?
No. La clave de acceso (fk_…) es pública y se introduce en el formulario. El token de la API (fgp_…) es privado: guárdalo en la configuración de Cursor, nunca en el repositorio.
¿Con qué marcos de trabajo funciona esto?
Cualquiera. El agente adapta el fragmento de código a tu entorno; el punto final y los nombres de los campos se mantienen igual.