> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trygravity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your MCP server

> Let users connect your MCP server from an AI agent when the Gravity Index recommends your service, and attribute the signups.

This page is for service providers in the Gravity Index that run a remote MCP server. When the Index recommends your service, the result can include your MCP server. The agent tells the user what your server would let it do, and the user connects it in one click. The user signs in on your own sign-in page, and the agent can use your tools right away in the same conversation.

## How it works

**1. The Index recommends your service**

An agent searches the Index for a task, for example "create Linear issues from this chat". When the Index recommends your service and your MCP server is set up, the result has a `connect` block with your server URL, name, icon, and button text.

**2. The agent offers the connection**

The agent says what connecting your server would let it do. The publisher's app shows a button to connect it.

**3. The user signs in with you**

The publisher's app runs the standard MCP authorization flow against your server. The user signs in and approves access on your authorization page. Your authorization URL carries Gravity's UTM parameters and the click ID.

**4. The agent uses your tools**

The publisher's app adds your server to its MCP client for that user, and the agent continues the task with your tools.

## Requirements

Your MCP server must support the [MCP authorization specification](https://modelcontextprotocol.io/specification/latest/basic/authorization):

* A remote MCP server on an `https` URL.
* Protected resource metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728)) that names your authorization server.
* Authorization server metadata ([RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414) or OpenID Connect discovery) with an authorization endpoint and a token endpoint.
* Dynamic client registration ([RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)) for public clients, so that each publisher's app can register itself under its own name. Users see the publisher's app name on your consent page.
* PKCE with `S256`.

Your listing must come from a CPA campaign. Gravity offers MCP connect only with sponsored recommendations.

## Get set up

Send an email to `index@trygravity.ai` with these details for your campaign:

| Field | Limits | Example |
| - | - | - |
| Server URL | `https`, up to 2,048 characters | `https://mcp.example.com/mcp` |
| Display name | 1 to 80 characters | `Example` |
| Icon URL (optional) | `https`, up to 2,048 characters | `https://example.com/icon.png` |
| Button text | 1 to 40 characters | `Connect` |

Gravity checks your server's authorization setup before the Index offers it. If you change the server URL later, Gravity checks it again, and the Index does not offer the server until that check passes.

## Tracking parameters on your authorization URL

The publisher's app adds these parameters to your authorization URL. They are the same on every connect:

| Parameter | Value |
| - | - |
| `utm_source` | `gravity` |
| `utm_medium` | `mcp_connect` |
| `utm_campaign` | Your Gravity campaign ID |
| `grclid` | The Gravity click ID of the recommendation |

Your authorization endpoint must ignore query parameters that it does not use, as OAuth requires. Gravity never puts these parameters on your MCP server URL, because the server URL is the resource that the access token is bound to.

## Report conversions

Read `grclid` from the authorization request, keep it through your signup or sign-in, and send it with the conversion. This works the same way as an Index click to your signup page: see [Click IDs on your signup page](https://docs.trygravity.com/gravity-index/for-service-providers.md#click-ids-on-your-signup-page) and [Server-side conversions](https://docs.trygravity.com/advertisers/server-conversions.md).

A connect alone does not create a conversion or a CPA charge. The confirmed conversion that you send creates the CPA charge, as for any other Index listing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.