Skip to content

Perplexity API key in the .env file instead of being in plain sight in the configuration #17

@chickymonkeys

Description

@chickymonkeys

Hi there,

I think I am bumping into a similar issue as #10. I am configuring the MCP server on Kiro AI and if I try with the following configuration:

{
  "mcpServers": {
    "perplexity-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "perplexity-mcp"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "${env:PERPLEXITY_API_KEY}"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

I get Error calling MCP tool: MCP error -32603: MCP error -32603: Perplexity API error: Request failed with status code 401. The API key is stored in a local .env file at the root of the project directory like the other API keys for MCP servers, which should be the correct behaviour for Kiro. However, if I put the API key directly in the mcp.json file, it works fine, but I would like to commit the mcp.json file with no API key in clear sight.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions