Skip to content
Client integrations

Python

Connect and discover tools with the Python MCP SDK.

Configure this client in Quick Start.

Before you start

Prepare a Python environment and a DINQ API Key. Install the dependencies, create search.py, then run the script; the example calls capabilities to discover tools.

See Authentication and API Keys for credential options. Merge only the peoplerouter entry into an existing configuration; do not overwrite other settings.

Set up the connection

Developer settings · API Key (optional)

Stored in this browser. It is only inserted into copied examples when you enable the checkbox above.

Terminal
pip install "mcp>=1.26,<2" httpx
search.py
import asyncio
import httpx
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client

URL = "https://mcp.peoplerouter.ai"
HEADERS = {"Authorization": "Bearer <DINQ_API_KEY>"}

async def main():
    async with httpx.AsyncClient(headers=HEADERS) as http:
        async with streamable_http_client(URL, http_client=http) as (read, write, _):
            async with ClientSession(read, write) as session:
                await session.initialize()
                result = await session.call_tool("capabilities", {})
                print(result.content)

asyncio.run(main())
Or send this to your agent

Copy these instructions into your agent to help with setup.

paste to your agent
Connect PeopleRouter in Python. Check the installed version first and use this setup:

search.py
import asyncio
import httpx
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client

URL = "https://mcp.peoplerouter.ai"
HEADERS = {"Authorization": "Bearer <DINQ_API_KEY>"}

async def main():
    async with httpx.AsyncClient(headers=HEADERS) as http:
        async with streamable_http_client(URL, http_client=http) as (read, write, _):
            async with ClientSession(read, write) as session:
                await session.initialize()
                result = await session.call_tool("capabilities", {})
                print(result.content)

asyncio.run(main())



If an API key is needed, guide me to configure it locally rather than paste it into chat. If sandbox restrictions block configuration or authorization through file, network or browser callback access, request the necessary permissions through the current agent's approval mechanism. Where outside-sandbox execution is supported, run the operation only after approval. I will complete browser authorization. Do not repeatedly retry in the same restricted environment, disable the sandbox or bypass approvals. If the environment cannot request permission, give me the exact steps to perform in my local terminal or app UI. Back up existing configuration and merge only peoplerouter, preserving other servers and settings. Check an existing entry instead of adding a duplicate. Web apps require adding the connector in their UI; guide me if you cannot do that directly. Confirm success only after tools load and capabilities succeeds; otherwise report the actual error.

This example needs an API Key. Create one in the console and enable it in developer settings. Authentication and API Keys

Official setup guide

Check the connection

The SDK / HTTP examples use the capabilities response to check the connection. The API examples may continue with a people search: review the input and tool prices before running them. An HTTP success status alone does not establish a successful tool result.

After connecting, continue to Using tools. For authentication or tool errors, read Troubleshooting and inspect the client's actual error message.