ExplainedShare

How to set up Perplexity in VS Code and on Linux: the official MCP server, extensions and community tools

Perplexity's official MCP server and a handful of VS Code extensions bring AI search right into your editor. All it takes is an API key and a few setup steps.

By MOBAEO Newsroom··3 min read

Follow
Distorted reflection in a blue structure
Photo: Declan Sun / Unsplash

Perplexity maintains an official MCP (Model Context Protocol) server that gives AI assistants real-time web search, reasoning and research inside editors such as VS Code and Cursor. The easiest way to get started is the remote server, hosted by Perplexity itself: you get the same tools with nothing to install or update. To connect, you need a Perplexity API key.

In the official repository on GitHub, the Cursor and VS Code buttons at the top of the page connect you to the remote server in one click. You generate the key in the API portal. If your MCP client doesn't support remote servers yet, you can run the server locally, and the repository also ships as an Agent Plugin, with the key set in the PERPLEXITY_API_KEY environment variable.

What MCP does inside VS Code

According to the Visual Studio Code documentation, MCP connects agents to tools and data sources that Copilot doesn't have out of the box, such as a database or a documentation service. You add a server either by the publisher's URL, for a remote server, or by a startup command, for a local process.

The guided setup starts with the MCP: Add Server command, which you open from the Command Palette (Ctrl+Shift+P on Windows and Linux). For a remote server, choose HTTP and enter the URL. For a local one, pick Command (stdio), with the runtime installed on the machine where the server runs.

The documentation includes two warnings. Local servers can run code on your machine and reach services with your permissions, so it pays to review the publisher, the command and the access being requested before you install. And credentials should never be pasted into the chat or stored in shared configuration.

The tools in the official server

  • Direct search through the Search API, with ranked results, a recency filter, domain restrictions and a faster, lower cost mode.
  • perplexity_ask: conversational answers backed by real-time search, for quick everyday questions.
  • perplexity_reason: advanced reasoning for complex analytical tasks.
  • Deep research, for detailed analysis and reports, which can take several minutes.

On corporate networks behind a firewall or proxy, the server accepts the PERPLEXITY_PROXY variable or the standard HTTPS_PROXY and HTTP_PROXY. For cloud or shared use, it runs in HTTP mode, reachable at http://localhost:8080/mcp. The default timeout is 5 minutes and can be extended with PERPLEXITY_TIMEOUT_MS.

Extensions and community alternatives

On the Visual Studio Marketplace, the Perplexity.ai extension brings the API into VS Code with real-time chat, streaming responses and citation tracking. You register the key with the Perplexity: Set API Token command, and it is kept in the editor's secret storage. The default model is sonar.

There is also a community project, again on GitHub, that is not affiliated with Perplexity and is still experimental. It uses your Perplexity account session (Free, Pro or Max) instead of an API key and automatically configures more than 20 IDEs. The project itself warns that it is not meant for production. On machines without a system keychain, it generates configuration snippets for bash, zsh and systemd, among others.

For brand teams, the practical upshot is that content and development teams can query Perplexity and see the sources it cites without leaving the editor. Search results from the official server include publication and last updated dates when available, and the domain filter lets you limit a search to specific sites.

Key questions

How do I use Perplexity in VS Code?

Through Perplexity's official MCP server, which has a one-click button to connect to VS Code, or through an extension such as Perplexity.ai. Either way, you need a Perplexity API key.

Is there a Perplexity extension for VS Code?

Yes. The Perplexity.ai extension on the Visual Studio Marketplace offers real-time chat, streaming responses and citation tracking, with sonar as the default model.

How do I set up my Perplexity API key in VS Code?

In the Perplexity.ai extension, use the Perplexity: Set API Token command in the Command Palette; the key is kept in VS Code's secret storage. For the MCP server, it goes in the PERPLEXITY_API_KEY variable in your client's settings.

How do I add the Perplexity MCP server to VS Code?

Use the MCP: Add Server command and choose HTTP for a remote server or Command (stdio) for a local one. Perplexity's remote server requires no installation.

How do I open the VS Code Command Palette on Linux?

With the Ctrl+Shift+P shortcut, the same as on Windows. That's where you add MCP servers and configure the Perplexity.ai extension.

How do I use the Perplexity MCP server behind a corporate proxy?

Set the PERPLEXITY_PROXY variable to the proxy's address and port, or use the standard HTTPS_PROXY and HTTP_PROXY. The address must include https://.

How do I use the Perplexity MCP server on Linux without a system keychain?

In the community project, the npx perplexity-user-mcp setup-vault command generates a strong password and configuration snippets for bash, zsh and systemd, among others. The project is not affiliated with Perplexity and is experimental.

Can I use Perplexity in VS Code without an API key?

A community project uses your Perplexity account session (Free, Pro or Max) instead of a key. It is not affiliated with Perplexity and warns that it is not meant for production.

Does Perplexity in VS Code show the sources behind its answers?

Yes. The Perplexity.ai extension tracks citations, and the official server includes publication and update dates in search results when they are available.

What should I do if the Perplexity MCP server fails to start?

Some stricter MCP clients fail because npx writes installation messages to the output. The official repository recommends using npx -yq instead of npx -y.

Sources: GitHub, Visual Studio Code, Visual Studio Marketplace, GitHub.