| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Model Context Protocol (MCP) server for Gravity Forms. Interact with your WordPress forms, feeds, and entries through any MCP-compatible client.
Built by GravityKit for the Gravity Forms community.
No clone or npm install needed — npx runs the published package on demand. (To run from a local checkout for development, see Contributing.)
Enable the Gravity Forms REST API (one-time, required for any credential type):
Create credentials in WordPress (pick one):
Application password (recommended):
Gravity Forms API key (for scoped access, e.g. a read-only key):
Add to your MCP client. For Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"gravitykit-mcp": {
"command": "npx",
"args": ["-y", "@gravitykit/mcp"],
"env": {
"GRAVITY_FORMS_BASE_URL": "https://yoursite.com",
"GRAVITY_FORMS_CONSUMER_KEY": "your_wp_username",
"GRAVITY_FORMS_CONSUMER_SECRET": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}Then restart Claude Desktop — npx fetches and runs @gravitykit/mcp on demand. Notes:
Two planes: Gravity Forms (gf_*) — 26 static tools, listed whenever Gravity Forms credentials are valid — and GravityKit — dynamic tools generated from the Foundation catalog when it's active, where each add-on registers tools under its own prefix (GravityView uses gv_*). The gk_reload_abilities tool reloads the GravityKit catalog. The two planes are independent: a Gravity-Forms-only site lists just gf_*; a GravityKit site without Gravity Forms REST keys still lists its product tools.
When GravityKit Foundation is active on the connected site, additional tools are generated at runtime from its Abilities catalog — each GravityKit add-on under its own server-assigned prefix, so the exact set depends on the installed products and versions. GravityView is supported today, using the gv_* prefix: View lifecycle (gv_view_create, gv_view_config_apply, gv_view_delete), field/widget/search/grid editing (add a search bar in one call with gv_search_bar_add), and discovery (gv_layouts_list, gv_field_type_schema_get, …). Use the gv_*_list discovery tools to see what's available on your site, and gk_reload_abilities to reload the catalog after activating or updating GravityKit products.
// Search + sort + paginate, across one or more forms at once
await mcp.call('gf_list_entries', {
form_ids: [1, 2],
search: {
field_filters: [
{ key: "1.3", value: "John", operator: "contains" },
{ key: "id", value: [101, 102, 103], operator: "IN" } // multi-value membership
],
mode: "any" // any = OR, all = AND
},
sorting: { key: "date_created", direction: "desc", is_numeric: false },
paging: { page_size: 25, current_page: 2 } // or { offset: 25, page_size: 25 }
});
// Fetch specific entries by ID (returns any status, including trashed)
await mcp.call('gf_list_entries', { include: [101, 102] });await mcp.call('gf_add_field', {
form_id: 1,
field_type: 'email',
properties: {
label: 'Email Address',
isRequired: true
}
});await mcp.call('gf_submit_form_data', {
form_id: 1,
input_1: "John Doe",
input_2: "john@example.com",
input_3: "Message content"
});Set these as environment variables — in your MCP client's env block (the npx setup above) or in a .env file when running from a local clone.
The GravityKit product tools reach the same site over the WordPress REST Abilities API, so on a single install no extra configuration is needed — they reuse your GRAVITY_FORMS_* credentials (a WordPress username + application password). Override only if the WordPress root differs from the Gravity Forms URL, or to use a separate credential:
These tools appear only when GravityKit Foundation is active on the connected site. They authenticate with a WordPress application password over Basic auth, so — like the Gravity Forms plane — they refuse a remote plain-HTTP URL unless GRAVITY_FORMS_ALLOW_HTTP_BASIC_AUTH=true (HTTPS and local URLs are always fine).
The client picks the right transport from the shape of your credentials — you normally don't configure anything:
Set GRAVITY_FORMS_AUTH_METHOD only to override the auto-selection. Whatever the transport, access is limited to the WordPress user's capabilities (or the API key's permission level).
The server supports dual environment configuration to safely test without affecting production data.
Add test site credentials to your .env file alongside production credentials:
# Production/Live Site
GRAVITY_FORMS_CONSUMER_KEY=ck_live_key
GRAVITY_FORMS_CONSUMER_SECRET=cs_live_secret
GRAVITY_FORMS_BASE_URL=https://www.yoursite.com
# Test/Staging Site (recommended for safe testing)
GRAVITY_FORMS_TEST_CONSUMER_KEY=ck_test_key
GRAVITY_FORMS_TEST_CONSUMER_SECRET=cs_test_secret
GRAVITY_FORMS_TEST_BASE_URL=https://staging.yoursite.com
# Enable test mode (optional)
GRAVITYKIT_MCP_TEST_MODE=trueWhen using test configuration:
# Verify test environment configuration
GRAVITYKIT_MCP_TEST_MODE=true npm run check-env
# Create test data on test site (requires test credentials)
npm run setup-test-data
# Run all tests against test site (auto-detects test credentials)
npm test
# Interactive testing with MCP Inspector (test mode)
GRAVITYKIT_MCP_TEST_MODE=true npm run inspect
# Run specific test suites against test site
NODE_ENV=test npm run test:forms
NODE_ENV=test npm run test:entries
NODE_ENV=test npm run test:submissionsThe server automatically uses test configuration when:
The server includes multiple safety mechanisms to prevent accidental production data contamination:
# Run everything (offline suites + live integration)
npm run test:all
# Offline suites
npm run test:unit # custom-runner unit tests
npm run test:node # node:test units (field ops, helpers, query/wire builders, *-hardening adversarial suites, …)
npm run test:views # GravityView inspector / validator
npm run test:forms # per-endpoint suites: also test:entries, test:feeds, test:submissions, …
# Live, end-to-end against a real Gravity Forms site (self-seeds its own throwaway
# forms/entries, then cleans up). Set credentials and run:
LIVE_GF_URL=https://example.com LIVE_GF_USER=admin LIVE_GF_PW='xxxx xxxx ...' npm run test:live
# Legacy live integration suite
npm testDev-only benchmark suites (not shipped in the npm package, require a live test site):
# AI release gate — drives the full MCP surface through a small model and grades
# real Gravity Forms / GravityView state (needs the `claude` CLI; slow, token-costly)
npm run bench
# Deterministic field-output smoke suite
npm run bench:field-output
# Field-storage validation against real add-ons
npm run bench:field-storage
# Front-end render test: a parent View shows a nested form's Summary Fields
npm run bench:nested-formsIf you're using a local development environment (Laravel Valet, MAMP, Local WP, etc.) with self-signed SSL certificates, you may encounter authentication errors. To fix this, set:
GRAVITY_FORMS_ALLOW_SELF_SIGNED_CERTS=true
in your MCP client's env block ("GRAVITY_FORMS_ALLOW_SELF_SIGNED_CERTS": "true"), or in .env when running from a local clone.
⚠️ Security Warning: Only disable SSL certificate verification for local development environments. Never use this setting in production!
Enable detailed logging:
GRAVITY_FORMS_DEBUG=trueGPL-2.0 License - see LICENSE file for details.
We welcome contributions from the Gravity Forms community! Whether you're building add-ons, managing forms, or integrating with other services, your insights and code contributions can help everyone.
This repository uses GitHub Actions to automatically publish to npm when a new version is tagged:
Note for maintainers: Ensure the NPM_TOKEN secret is configured in the repository settings for automated publishing to work.
For Add-on Developers:
For Form Builders:
For Everyone:
Your contributions help make Gravity Forms automation better for everyone. Let's build something great together!
| Back | FazBrowse Home | New Git URL |