diff --git a/README.md b/README.md index 1d68080..0f2f483 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,11 @@ Or install directly from the marketplace: [cursor.com/marketplace/pinecone](http ## Prerequisites - **Pinecone account** — free at [app.pinecone.io](https://app.pinecone.io/?sessionType=signup) -- **API key** — create one in the Pinecone console, then set it: - ```bash - export PINECONE_API_KEY="your-key" +- **API key** — create one in the Pinecone console, then add it to a `.env` file at your workspace root: ``` + PINECONE_API_KEY=your-key + ``` + The bundled MCP config loads this file via Cursor's [`envFile`](https://cursor.com/docs/mcp) field, so you don't need to export the key in your shell. (If you prefer, `export PINECONE_API_KEY="your-key"` also works for terminal scripts.) - **Node.js v18+** — required for the MCP server (`npx`) ### Optional @@ -71,7 +72,7 @@ Or install directly from the marketplace: [cursor.com/marketplace/pinecone](http ## Getting started 1. Install the plugin from the [Cursor Marketplace](https://cursor.com/marketplace) -2. Set your `PINECONE_API_KEY` environment variable +2. Add `PINECONE_API_KEY=your-key` to a `.env` file at your workspace root (Cursor will load it into the MCP server via `envFile`) 3. Open Cursor Agent chat and type `/quickstart` to get started 4. Verify the MCP server is connected: Cursor Settings > Features > Model Context Protocol diff --git a/mcp.json b/mcp.json index 034191e..32cd39f 100644 --- a/mcp.json +++ b/mcp.json @@ -1,14 +1,13 @@ { "mcpServers": { "pinecone": { + "type": "stdio", "command": "npx", "args": [ "-y", "@pinecone-database/mcp" ], - "env": { - "PINECONE_API_KEY": "${PINECONE_API_KEY}" - } + "envFile": "${workspaceFolder}/.env" } } } diff --git a/skills/assistant/SKILL.md b/skills/assistant/SKILL.md index 8449ad9..7db3a6f 100644 --- a/skills/assistant/SKILL.md +++ b/skills/assistant/SKILL.md @@ -73,6 +73,6 @@ Handle chained requests naturally. Example: ## Prerequisites -- `PINECONE_API_KEY` must be available — terminal: `export PINECONE_API_KEY="your-key"`, or add to a `.env` file and run scripts with `uv run --env-file .env scripts/...` +- `PINECONE_API_KEY` must be available — add it to a `.env` file at your workspace root (the bundled MCP config loads it via Cursor's `envFile` field) and run scripts with `uv run --env-file .env scripts/...`. For terminal-only scripts, `export PINECONE_API_KEY="your-key"` also works. - `uv` must be installed — [install uv](https://docs.astral.sh/uv/getting-started/installation/) - Get a free API key at: https://app.pinecone.io/?sessionType=signup diff --git a/skills/help/SKILL.md b/skills/help/SKILL.md index a545893..f726b63 100644 --- a/skills/help/SKILL.md +++ b/skills/help/SKILL.md @@ -15,11 +15,11 @@ Here's everything you need to get started and a summary of all available skills. ### Required - **Pinecone account** — free to create at https://app.pinecone.io/?sessionType=signup -- **API key** — create one in the Pinecone console after signing up, then either export it in your terminal: - ```bash - export PINECONE_API_KEY="your-key" +- **API key** — create one in the Pinecone console after signing up, then add it to a `.env` file at your workspace root (the bundled MCP config loads it via Cursor's `envFile` field): ``` - Or add it to a `.env` file if your IDE doesn't inherit shell variables: `PINECONE_API_KEY=your-key` + PINECONE_API_KEY=your-key + ``` + For terminal scripts you can also `export PINECONE_API_KEY="your-key"`. ### Optional (unlock more capabilities) diff --git a/skills/query/SKILL.md b/skills/query/SKILL.md index d722839..612083a 100644 --- a/skills/query/SKILL.md +++ b/skills/query/SKILL.md @@ -60,9 +60,7 @@ Utilize Pinecone MCP's `search-records` tool to search for records within a spec **`PINECONE_API_KEY` is required.** Get a free key at https://app.pinecone.io/?sessionType=signup -If you get an access error, the key is likely missing. Ask the user to set it and restart their IDE or agent session: -- Terminal: `export PINECONE_API_KEY="your-key"` -- IDE without shell inheritance: add `PINECONE_API_KEY=your-key` to a `.env` file +If you get an access error, the key is likely missing. Ask the user to add `PINECONE_API_KEY=your-key` to a `.env` file at their workspace root — the bundled MCP config loads it via Cursor's `envFile` field — then restart their IDE or agent session. For terminal-only scripts, `export PINECONE_API_KEY="your-key"` also works. **IMPORTANT** At the moment, the /query command can only be used with integrated indexes, which use hosted Pinecone embedding models to embed and search for data. If a user attempts to query an index that uses a third party API model such as OpenAI, or HuggingFace embedding models, remind them that this capability is not available yet diff --git a/skills/quickstart/SKILL.md b/skills/quickstart/SKILL.md index 9d2426e..c3df901 100644 --- a/skills/quickstart/SKILL.md +++ b/skills/quickstart/SKILL.md @@ -10,10 +10,7 @@ you will learn how to do a simple form of semantic search over some example data ## Prerequisites -Before starting either path, verify the API key works by calling `list-indexes` via the Pinecone MCP. If it succeeds, proceed. If it fails, ask the user to set their key: - -- Terminal: `export PINECONE_API_KEY="your-key"` -- Or create a `.env` file in the project root: `PINECONE_API_KEY=your-key` +Before starting either path, verify the API key works by calling `list-indexes` via the Pinecone MCP. If it succeeds, proceed. If it fails, ask the user to add `PINECONE_API_KEY=your-key` to a `.env` file at their workspace root (the bundled MCP config loads it via Cursor's `envFile` field) and restart their IDE/agent session. For terminal-only scripts, `export PINECONE_API_KEY="your-key"` also works. Then retry `list-indexes` to confirm. @@ -201,19 +198,15 @@ Explain: Responses include citations with source file and page number. **`PINECONE_API_KEY` not set** -Terminal environments: -```bash -export PINECONE_API_KEY="your-key" -``` -IDEs that don't inherit shell variables: create a `.env` file in the project root: +Create a `.env` file at the workspace root: ``` PINECONE_API_KEY=your-key ``` -Then use `uv run --env-file .env` when running scripts. Restart your IDE/agent session after setting. +The bundled MCP config loads it via Cursor's `envFile` field. For running scripts directly, use `uv run --env-file .env scripts/...` (or `export PINECONE_API_KEY="your-key"` for terminal use). Restart your IDE/agent session after setting. **MCP tools not available** - Verify the Pinecone MCP server is configured in your IDE's MCP settings -- Check that `PINECONE_API_KEY` is set before the MCP server starts +- Check that `PINECONE_API_KEY` is present in your workspace `.env` (or process env) before the MCP server starts **Index already exists** - The upsert script is safe to re-run — it will upsert over existing records