MCP Server
Getting Started
Connect your AI agent to the PRIV data marketplace in 5 minutes
Getting Started with PRIV MCP
Connect your AI agent to the PRIV data marketplace using the Model Context Protocol.
Prerequisites
- A PRIV account with an API key (get one at app.privlabs.io)
- An MCP-compatible client (Claude Desktop, Claude Code, Cursor, VS Code, ChatGPT)
Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"priv": {
"command": "npx",
"args": ["-y", "@priv/mcp-server"],
"env": {
"PRIV_API_KEY": "pk_live_your_api_key",
"PRIV_API_URL": "https://api.privlabs.io"
}
}
}
}Claude Code
claude mcp add priv -- npx -y @priv/mcp-serverThen set your API key:
export PRIV_API_KEY=pk_live_your_api_keyCursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"priv": {
"command": "npx",
"args": ["-y", "@priv/mcp-server"],
"env": {
"PRIV_API_KEY": "pk_live_your_api_key"
}
}
}
}Programmatic (TypeScript)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "npx",
args: ["-y", "@priv/mcp-server"],
env: {
PRIV_API_KEY: "pk_live_your_api_key",
PRIV_API_URL: "https://api.privlabs.io",
},
});
const client = new Client({ name: "my-agent", version: "1.0.0" });
await client.connect(transport);
// List available tools
const tools = await client.listTools();
console.log(tools);First Queries
Once connected, try asking your AI agent:
- "Search the PRIV marketplace for browsing data"
- "What bounties are available on PRIV?"
- "Check my PRIV token balance"
- "Find documentation about staking"
Environment Variables
| Variable | Required | Description |
|---|---|---|
PRIV_API_KEY | Yes | Your PRIV API key (starts with pk_live_ or pk_test_) |
PRIV_API_URL | No | API base URL (default: https://api.privlabs.io) |
Keep your API key secure. Never commit it to version control. Use environment variables or a secrets manager.
Next Steps
- Tool Reference — See all available tools with input schemas
- Authentication — Rate limits and spending caps
- Security — How we protect against prompt injection