CONNECT APP
Build with Clerk
Developer Tools
- API key
MCP
Give your agent Clerk tools
Every Clerk action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Clerk account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "clerk",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Create User:
const result = await mcp.callTool({
name: "clerk-create-user",
arguments: {
externalId: "External Id",
firstName: "First Name",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "clerk",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Create User:
result = await session.call_tool("clerk-create-user", {
"externalId": "External Id",
"firstName": "First Name",
})API PROXY
Call the Clerk API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Clerk API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.clerk.com/v1/users",
})
// Any allowed Clerk endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.clerk.com/v1/users
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuY2xlcmsuY29tL3YxL3VzZXJz?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Clerk actions from your backend
Connect a user's Clerk account once, then run Create User on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "clerk-create-user",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
clerk: { authProvisionId: "apn_xxxxxxx" },
externalId: "External Id",
firstName: "First Name",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="clerk-create-user",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"clerk": {"authProvisionId": "apn_xxxxxxx"},
"externalId": "External Id",
"firstName": "First Name",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "clerk-create-user",
"configured_props": {
"clerk": { "authProvisionId": "apn_xxxxxxx" },
"externalId": "External Id",
"firstName": "First Name"
}
}'TOOLS
Clerk actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Create User
actionCreates a new user. Your user management settings determine how you should setup your user model. See the documentationWritev0.0.3 -
Create User Invitation
actionCreates a new invitation for the given email address and sends the invitation email. Keep in mind that you cannot create an invitation if there is already one for the given email address. Also, trying to create an invitation for an email address that already exists in your application will result to an error. See the documentationWritev0.0.3 -
Delete User
actionDelete the specified user. See the documentationWritev0.0.2 -
Get User
actionRetrieve the details of a specific user. See the documentationRead-onlyv0.0.2 -
Get User Memberships
actionRetrieve a list of the user's organization memberships. See the documentationRead-onlyv0.0.2 -
List User Id Options
actionRetrieves available options for the User Id field.Read-onlyv0.0.1 -
Update User
actionUpdate a user's attributes. You can set the user's primary contact identifiers (email address and phone numbers) by updating thePrimary Email Address IdandPrimary Phone Number Idattributes respectively. Both IDs should correspond to verified identifications that belong to the user. See the documentationWritev0.0.3
No Clerk triggers are available yet.
MULTI-APP
Use Clerk with other popular apps
Most products don't stop at one integration. Pair Clerk with the other apps your users rely on, and ship use cases that span both.
- App slug
- clerk
- Authentication
- API key
- Categories
- Developer Tools
- Actions
- 7
- Triggers
- 0
- API proxy
- Available