Skip to main content
Glama

Perplexity MCP Server

by Rohit-Seelam
config.py1.17 kB
"""Configuration management for Perplexity MCP.""" import os import sys from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() def get_api_key() -> str: """Get and validate the Perplexity API key.""" api_key = os.getenv("PERPLEXITY_API_KEY") if not api_key: print("Error: PERPLEXITY_API_KEY environment variable is required", file=sys.stderr) print("Please set your API key in a .env file or environment variable", file=sys.stderr) raise ValueError("PERPLEXITY_API_KEY is required") return api_key # Perplexity API configuration PERPLEXITY_BASE_URL = "https://api.perplexity.ai" PERPLEXITY_TIMEOUT = 300 # 5 minutes default timeout # Tool configurations TOOL_CONFIGS = { "small": { "model": "sonar-pro" }, "medium": { "model": "sonar-reasoning-pro", "reasoning_effort": "medium", "web_search_options": { "search_context_size": "medium" } }, "large": { "model": "sonar-deep-research", "reasoning_effort": "high", "web_search_options": { "search_context_size": "high" } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rohit-Seelam/Perplexity_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server