Skip to content

Commit 77bdc9e

Browse files
committed
chore(dependencies): API Key additional handling + update project dependencies and configuration
- Added API Key handling with command-line arguments - Remove better-sqlite3 dependency - Add dotenv and minimist for improved configuration handling - Update TypeScript and Node.js type definitions - Update Node.js engine requirement to >=18.0.0 - Update README with additional configuration options for API key handling
1 parent c46ef44 commit 77bdc9e

5 files changed

Lines changed: 198 additions & 463 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
22
build/
33
*.log
4-
.env*
4+
.env*
5+
.kiro

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,49 @@ Or use NPX to not have to install it locally (recommended for macos):
122122
}
123123
}
124124
```
125+
In case the MCP Client is not able to parse the Perplexity API Key from the
126+
environment using methods like `"${env:PERPLEXITY_API_KEY}"` common in modern
127+
AI Coding Agents (e.g. Kiro), there are two fallback solutions:
128+
129+
**Command-Line Argument**: Pass the API key directly as a command-line argument, and you can even try to see whether "${env:PERPLEXITY_API_KEY}" works in there.
130+
131+
```json
132+
{
133+
"mcpServers": {
134+
"perplexity": {
135+
"command": "node",
136+
"args": [
137+
"/path/to/perplexity-server/build/index.js",
138+
"--api-key",
139+
"your_api_key_here"
140+
],
141+
"disabled": false,
142+
"autoApprove": []
143+
}
144+
}
145+
}
146+
```
147+
148+
**Read an explicit `.env` File**: specify the location of the project `.env` file with the environment variables and API keys for your current project with the `--cwd` command-line argument, and the MCP Server will read the `.env` file from the directory finding the Perplexity API Key from there.
149+
150+
```json
151+
{
152+
"mcpServers": {
153+
"perplexity": {
154+
"command": "node",
155+
"args": [
156+
"/path/to/perplexity-server/build/index.js",
157+
"--cwd",
158+
"/path/to/your/project"
159+
],
160+
"disabled": false,
161+
"autoApprove": []
162+
}
163+
}
164+
}
165+
```
166+
**Priority Order**: Command-line argument > Environment variable > .env file with `--cwd` (path needed)
167+
125168
## Star History
126169

127170
[![Star History Chart](https://api.star-history.com/svg?repos=DaInfernalCoder/perplexity-mcp&type=Timeline)](https://www.star-history.com/#DaInfernalCoder/perplexity-mcp&Timeline)

0 commit comments

Comments
 (0)