@gravity-ai/index-mcp 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/bin/cli.mjs +7 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
An [MCP](https://modelcontextprotocol.io/) server that lets AI coding agents
|
|
4
4
|
**discover developer services and get install instructions** from the
|
|
5
|
-
[Gravity Index](https://index.trygravity.
|
|
5
|
+
[Gravity Index](https://index.trygravity.com).
|
|
6
6
|
|
|
7
7
|
Zero dependencies, zero build step — a single Node.js file that speaks
|
|
8
8
|
JSON-RPC 2.0 over stdio.
|
|
@@ -80,7 +80,7 @@ Docker, etc.) are required.
|
|
|
80
80
|
|
|
81
81
|
| Var | Default | Notes |
|
|
82
82
|
|---|---|---|
|
|
83
|
-
| `GRAVITY_INDEX_URL` | `https://index.trygravity.
|
|
83
|
+
| `GRAVITY_INDEX_URL` | `https://index.trygravity.com` | Override for self-hosted or staging |
|
|
84
84
|
| `GRAVITY_PUBLISHER_KEY` | *(required)* | Your Gravity publisher API key — requests and integrations attribute to your account |
|
|
85
85
|
| `GRAVITY_INDEX_MONETIZATION_MODE` | *(unset)* | Optional private publisher ranking mode: `boost_cpa`, `cpa_only`, or `cpa_desc`. Not exposed to the calling agent. |
|
|
86
86
|
|
|
@@ -89,6 +89,10 @@ users), set `GRAVITY_PUBLISHER_KEY` so every request and install attributes to y
|
|
|
89
89
|
`gravity_index_search` also accepts `external_session_id`, `external_user_id_hash`,
|
|
90
90
|
`email_hash`, and `metadata` for attribution and payout matching.
|
|
91
91
|
|
|
92
|
+
Every search sends the required `user_ip`. This server runs on the user's
|
|
93
|
+
machine, so it sends `"caller"` and Index uses the connection's IP. If you run
|
|
94
|
+
it on a server instead, set `GRAVITY_INDEX_USER_IP` to the end user's IP.
|
|
95
|
+
|
|
92
96
|
---
|
|
93
97
|
|
|
94
98
|
## Example conversation
|
|
@@ -99,7 +103,7 @@ agent uses gravity_index_search → returns Neon with:
|
|
|
99
103
|
- npm install @neondatabase/serverless
|
|
100
104
|
- lib/db.ts stub
|
|
101
105
|
- DATABASE_URL env var
|
|
102
|
-
- https://index.trygravity.
|
|
106
|
+
- https://index.trygravity.com/go/abc123 ← setup link
|
|
103
107
|
- search_id: s_0f9...
|
|
104
108
|
agent: Here's the setup. Open the link above, paste your DATABASE_URL
|
|
105
109
|
back, and I'll wire it up.
|
|
@@ -112,6 +116,6 @@ agent uses gravity_index_report_integration(search_id=s_0f9..., integrated_slug=
|
|
|
112
116
|
|
|
113
117
|
## See also
|
|
114
118
|
|
|
115
|
-
- Gravity Index REST API: <https://index.trygravity.
|
|
116
|
-
- Docs: <https://docs.trygravity.
|
|
119
|
+
- Gravity Index REST API: <https://index.trygravity.com>
|
|
120
|
+
- Docs: <https://docs.trygravity.com/gravity-index/introduction>
|
|
117
121
|
- Python MCP (identical tools, requires `python3`): `index/mcp/gravity_index_mcp.py` in the Gravity monorepo
|
package/bin/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Gravity Index MCP Server — bare stdio JSON-RPC, zero dependencies.
|
|
3
|
-
// Wraps https://index.trygravity.
|
|
3
|
+
// Wraps https://index.trygravity.com as a Model Context Protocol tool server.
|
|
4
4
|
//
|
|
5
5
|
// Install per-project: npm install -g @gravity-ai/index-mcp
|
|
6
6
|
// One-shot: npx -y @gravity-ai/index-mcp
|
|
@@ -10,7 +10,7 @@ import readline from "node:readline";
|
|
|
10
10
|
import process from "node:process";
|
|
11
11
|
|
|
12
12
|
const API_URL =
|
|
13
|
-
process.env.GRAVITY_INDEX_URL || "https://index.trygravity.
|
|
13
|
+
process.env.GRAVITY_INDEX_URL || "https://index.trygravity.com";
|
|
14
14
|
const PUBLISHER_KEY = process.env.GRAVITY_PUBLISHER_KEY || "";
|
|
15
15
|
const MONETIZATION_MODE = (process.env.GRAVITY_INDEX_MONETIZATION_MODE || "").trim();
|
|
16
16
|
const UA = "GravityIndex-MCP-JS/1.1";
|
|
@@ -308,7 +308,11 @@ async function handleRequest(req) {
|
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
if (name === "gravity_index_search") {
|
|
311
|
-
|
|
311
|
+
// This server runs on the user's machine, so the caller is the user.
|
|
312
|
+
const body = {
|
|
313
|
+
query: args.query,
|
|
314
|
+
user_ip: process.env.GRAVITY_INDEX_USER_IP || "caller",
|
|
315
|
+
};
|
|
312
316
|
if (args.search_id) body.search_id = args.search_id;
|
|
313
317
|
if (args.context && typeof args.context === "object") body.context = args.context;
|
|
314
318
|
if (args.external_session_id) body.external_session_id = args.external_session_id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ai/index-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "MCP server for the Gravity Index — lets AI agents discover developer services (DBs, auth, payments, hosting, etc.) and get install instructions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"author": "Gravity Team",
|
|
28
28
|
"license": "MIT",
|
|
29
|
-
"homepage": "https://docs.trygravity.
|
|
29
|
+
"homepage": "https://docs.trygravity.com/gravity-index/introduction",
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|