General Stdio Integration with OAuth allows any MCP client that supports stdio servers to connect to MetaMCP’s remote endpoints using OAuth authentication. Since MetaMCP endpoints are remote-only (SSE, Streamable HTTP), you’ll need a local proxy to bridge the connection.

Prerequisites

Before starting, ensure you have:
  • MCP client that supports stdio servers (Claude Desktop, Cursor, etc.)
  • MetaMCP running locally or deployed with OAuth enabled
  • Active endpoint configured in MetaMCP
  • OAuth application registered in MetaMCP
  • mcp-remote available via npx (npx -y mcp-remote)

Basic Configuration

Using mcp-remote (Required)

Since MetaMCP endpoints are remote only, you need mcp-remote to convert between stdio and HTTP/SSE protocols with OAuth authentication.
{
  "mcpServers": {
    "MetaMCP": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:12008/metamcp/your-endpoint-name/mcp"
      ]
    }
  }
}

OAuth Flow

When you first connect, mcp-remote will:
  1. Open your browser to the OAuth authorization URL
  2. Prompt you to authorize the application
  3. Redirect back to the local callback server
  4. Store the tokens locally for future use
  5. Establish the MCP connection with authenticated access

Token Management

  • Tokens are stored locally by mcp-remote
  • Refresh tokens are automatically used when access tokens expire
  • Clear tokens by deleting the mcp-remote cache directory if needed

Important Notes

  • Use http://localhost:12008/metamcp/your-endpoint-name/mcp for OAuth authentication
  • Replace your-endpoint-name with your actual endpoint name for public endpoints
  • mcp-remote handles the protocol conversion between stdio and HTTP/SSE
  • OAuth flow requires browser interaction on first connection
  • No manual OAuth setup required - MetaMCP handles it automatically