Run the agent and tools in the cloud quickly using the steps below.

Required Environment Variables

Step-by-step Instructions

  1. Install Meshagent

    pip install "meshagent[all]"
    
  2. Sign Up & Authenticate

  3. Start the MCP Perplexity Server in a Meshagent Room

    meshagent service test \
      --room=test \
      --role=agent \
      --image=meshagent/mcp-perplexity-ask:latest \
      --env MESHAGENT_PORT=8001 \
      --env PERPLEXITY_API_KEY=YOUR_PERPLEXITY_API_KEY \
      --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
      --name=mcp-perplexity-ask-service
    
    • This command starts a Meshagent room (test) running the MCP server instance.
    • Note: Rooms automatically close if inactive.
  4. Join the Room With a Chatbot & Toolkit

    meshagent chatbot join \
      --room=test \
      --agent-name=sample \
      --name=sample \
      --toolkit=mcp-perplexity-ask
    
    • This starts a chatbot in the room using the mcp-perplexity-ask toolkit.
    • Multiple toolkits and agents can be run in the same room for richer interactions.
    • After running, a link to interact with the agent and tools will be provided in the command output.

Tools Available

Tools Summary

ToolShort Description
perplexity_askEngages in a conversation using the Sonar API.
perplexity_reasonPerforms reasoning tasks using the Perplexity API.
perplexity_researchPerforms deep research using the Perplexity API.

Tools Details

perplexity_ask

Engages in a conversation using the Sonar API. Accepts an array of messages (each with a role and content) and returns a ask completion response from the Perplexity model.

ParametersTypeDescription
messagesarrayArray of conversation messages

perplexity_reason

Performs reasoning tasks using the Perplexity API. Accepts an array of messages (each with a role and content) and returns a well-reasoned response using the sonar-reasoning-pro model.

ParametersTypeDescription
messagesarrayArray of conversation messages

perplexity_research

Performs deep research using the Perplexity API. Accepts an array of messages (each with a role and content) and returns a comprehensive research response with citations.

ParametersTypeDescription
messagesarrayArray of conversation messages

Resources