Skip to main content

Overview

Claude Code is a command-line tool for agentic coding that supports MCP (Model Context Protocol) for enhanced development capabilities. Through Portkeyโ€™s MCP Gateway, you can seamlessly connect any MCP server to Claude Code without managing infrastructure or authentication.

Key Benefits

  • Secure Authentication: Portkey handles OAuth flows and token management
  • Unified Authentication: Single OAuth token to rule them all
  • Team Collaboration: Share MCP server configurations, manage access permissions, and ensure everyone on your team has the tools they needโ€”configured correctly, every time
  • Complete Observability: See every request, track latency, monitor errors, and understand usage patterns

Prerequisites

Before you begin, ensure you have:
  1. Claude Code CLI installed
  2. Portkey account with workspace access
  3. MCP server registered in Portkeyโ€™s MCP Hub

Quick Setup

Step 1: Get Your MCP Server URL

  1. Log in to Portkey Dashboard
  2. Navigate to MCP Hub โ†’ Your Servers
  3. Copy your server URL:
    https://mcp.portkey.ai/:workspace-id/:server-id/mcp
    

Step 2: Add Remote Server

Add your Portkey MCP server using the HTTP transport:
claude mcp add --transport http portkey-mcp https://mcp.portkey.ai/:workspace-id/:server-id/mcp

Step 3: Verify Connection

List your configured MCP servers:
claude mcp list

Step 4: Authentication

Portkey handles all authentication flows automatically:
  1. First Connection: Run the authentication command in Claude Code:
    /mcp
    
  2. Browser Authentication:
    • Your browser will open for OAuth authorization (if required)
    • Complete the authentication flow
    • Tokens are stored securely and refreshed automatically
  3. Team Access: Workspace members share the same authentication scope based on your Portkey settings

Configuration Examples

Single Server Setup

# Add Linear integration
claude mcp add --transport http linear https://mcp.portkey.ai/ws-abc123/linear-def456/mcp

Multiple Servers Setup

# Add Linear
claude mcp add --transport http linear https://mcp.portkey.ai/ws-abc123/linear-def456/mcp

# Add GitHub
claude mcp add --transport http github https://mcp.portkey.ai/ws-abc123/github-ghi789/mcp

# Add Slack
claude mcp add --transport http slack https://mcp.portkey.ai/ws-abc123/slack-jkl012/mcp

With Custom Headers (if needed)

claude mcp add --transport http secure-api https://mcp.portkey.ai/ws-abc123/api-xyz789/mcp \
  --header "X-Custom-Header: value"

Managing Servers

List All Servers

claude mcp list

Remove a Server

claude mcp remove portkey-mcp

Clear Authentication

To revoke access and clear stored tokens:
/mcp
# Select "Clear authentication" from the menu

Tips

  • Authentication tokens are stored securely and refreshed automatically
  • If your browser doesnโ€™t open automatically during auth, copy the provided URL
  • OAuth authentication works with both SSE and HTTP transports
  • Use descriptive names when adding servers for easier management

Support

Need help? Weโ€™re here for you:
Last modified on April 22, 2026