Skip to main content

Python SDK for Passport MCP

Project description

PassportMCP Python SDK

PassportMCP (ppmcp) lets you build MCP servers for any given website with automatic browser auth syncing. Every website is fair game. It wraps FastMCP and automatically adds necessary auth headers and cookies from the browser to outbound requests. As long as you log in through the browser, it's ready to be used. Often easier than paying for developer APIs (ex: twitter/X), avoiding rate limits, waiting for approval, or great for sites that don't have one.

Features

  • 🔐 Automatic browser auth syncing
  • 🛠️ Normal MCP tool creation
  • 🌐 Works with any website
  • 🔄 Always uses latest auth state
  • 🍪 Handles cookies and headers
  • 🔒 All credentials stay on your machine

Quick Start

  1. Install the Package
pip install ppmcp
  1. Set Up Native Messaging and Auth Syncing
ppmcp setup  # Sets up with Chrome Web Store extension
  1. Enable Request Monitoring

    • Click the PassportMCP extension icon in Chrome
    • Toggle "Monitor Requests" on
    • Visit and log into your target website
  2. Create Your First MCP Tool

from passportmcp import PassportMCP

# Create an MCP instance
mcp = PassportMCP("example", "example.com")

# Define a tool
@mcp.tool()
async def get_data():
    response = mcp.client.get("https://example.com/api/data")
    return response.json()

Installation Options

Option 1: Chrome Web Store Extension (Recommended)

pip install ppmcp
ppmcp setup

Option 2: Local Development

  1. Build the Extension
git clone https://github.com/joshmayerr/passport-mcp.git
cd extension
npm install
npm run build  # or npm run dev for watch mode
  1. Load in Chrome

    • Open Chrome and go to chrome://extensions
    • Enable "Developer mode" in the top right
    • Click "Load unpacked" and select the extension/dist directory
    • Note the extension ID from Chrome (shown under the extension name)
  2. Set Up Native Messaging

ppmcp setup --local --extension-id=your_extension_id
# OR
ppmcp setup --local  # You'll be prompted for the ID

CLI Commands

  • ppmcp setup - Set up native messaging
  • ppmcp doctor - Check installation status
  • ppmcp uninstall - Remove PassportMCP

How It Works

PassportMCP consists of three main components:

  1. Chrome Extension

    • Monitors web requests
    • Captures authentication state
    • Sends to native host
  2. Native Host

    • Receives data from extension
    • Stores authentication state
    • Provides data to SDK
  3. SDK

    • PassportMCP: High-level MCP tool creation
    • BrowserPassport: Low-level auth handling

Advanced Example: LinkedIn API

from passportmcp import PassportMCP

mcp = PassportMCP("linkedin", "linkedin.com")

@mcp.tool()
async def search_linkedin(query: str):
    response = mcp.client.get(
        "https://www.linkedin.com/voyager/api/graphql",
        params={
            "includeWebMetadata": "true",
            "variables": "()",
            "queryId": "voyagerDashMySettings.7ea6de345b41dfb57b660a9a4bebe1b8"
        }
    )
    return response.json()

Troubleshooting

  1. Extension Not Working

    • Check if "Monitor Requests" is enabled
    • Run ppmcp doctor to verify installation
    • Make sure you're logged into the target website
  2. Authentication Errors

    • Visit the website in Chrome and log in again
    • Check if cookies are being properly synced
    • Run ppmcp uninstall and then ppmcp setup to reset
  3. Native Host Issues

    • Check Chrome's extension logs for errors
    • Verify the manifest is correctly installed
    • Try rebuilding and reloading the extension

Security

  • ✅ Credentials never leave your machine
  • ✅ No cloud storage or transmission
  • ✅ Limited to authorized domains
  • ✅ LLMs never see your credentials

Unlike services like Anon and Rabbit that automate accounts in the cloud, PassportMCP keeps everything local and secure.

Development

For SDK development:

cd sdks/python
pip install -e .

Roadmap

  • TypeScript SDK
  • Firefox extension
  • Safari extension
  • Auth state sharing
  • Enterprise features
  • More language SDKs

License

MIT License - see LICENSE for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppmcp-0.1.3.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ppmcp-0.1.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ppmcp-0.1.3.tar.gz.

File metadata

  • Download URL: ppmcp-0.1.3.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for ppmcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d76a2ffbf941ad602a348f82f2b0fe28311dccaa9c96ada00defa2e9e7bdb713
MD5 2820739aea9bafa9ff3d0be0f3ba6b28
BLAKE2b-256 907232547ac4905e20730805efff2eeebcd2a00f13297f868e620f1823b29827

See more details on using hashes here.

File details

Details for the file ppmcp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ppmcp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for ppmcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e6087eec3adf9234bb55b5b67689559684f714a593fc6dad031f3b14340535c4
MD5 10fe62dc8704aa0c5cf5f2b87e2f678f
BLAKE2b-256 06102de40fed768ecfb9bdc83a2795045fea04c8470de6c085002c9132ce977e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page