Skip to main content

Documentation Index

Fetch the complete documentation index at: https://support.pexcard.com/llms.txt

Use this file to discover all available pages before exploring further.

This article walks through wiring the PEX MCP Server into a Microsoft Copilot Studio agent so the agent can read your PEX account data and call PEX tools on your behalf. By the end you will have an agent that can answer questions like “what is my business profile?” or “list all my PEX cards” directly from live PEX data.
Heads up — Beta feature.Authorized apps and the PEX MCP Server are currently labeled Beta in the PEX dashboard. Behavior and field names may change.About the screenshots. The example uses an internal sandbox tenant and a placeholder user account. Your screen will show your own org, environment, agent name, and account data in the same positions.

What you will need before you start

  • An admin account in the PEX dashboard. Production: https://dashboard.pexcard.com. Sandbox: https://sandbox-dashboard.pexcard.com (this is what the screenshots show).
  • Access to Microsoft Copilot Studio in the correct Power Platform environment for your org.
  • An existing or new agent in Copilot Studio that you want to extend with PEX tools.
  • A few minutes — the whole flow takes under five minutes once you know where everything lives.

Step 1. Create or open your Copilot Studio agent

In Copilot Studio, open the agent you want to extend. If the agent was just created, wait for the “Getting things ready…” spinner to finish — the agent must be fully provisioned before you can add tools. When provisioning completes you will see a green confirmation banner near the top of the page: “Your agent has been provisioned.”
Agent overview after provisioning, showing Instructions, Knowledge, Web Search, Tools, Work IQ, and Triggers sections
The agent overview screen has the sections you will be touching: Web Search and Tools.
If you want the agent to also be able to search public websites — useful for general questions that fall outside PEX data — flip the Web Search toggle to Enabled.
Web Search toggle switched to Enabled
This step is optional and unrelated to the MCP connection. Skip it if your agent should be PEX-data-only.

Step 3. Add the PEX MCP Server as a tool

In the Tools section, click + Add tool, then choose Model Context Protocol in the picker that appears. You will be taken to the Add a Model Context Protocol server form. Fill it in like this:
FieldValue
Server nameA name for this connection, e.g. My-PEX-MCP-Server. This is the label your agent will see.
Server descriptionPlain-English description, e.g. “This is the set of tools to manage the PEX account.”
Server URLThe PEX MCP endpoint. Production: https://marketplace.pexcard.com/mcp. Sandbox: https://sandbox-marketplace.pexcard.com/mcp.
AuthenticationSelect API key.
TypeHeader
Header nameX-Pex-Api-Token
The Add a Model Context Protocol server dialog with Server name, description, URL, Authentication = API key, Type = Header, and Header name = X-Pex-Api-Token
Common mistake.The header name is case-sensitive and must be exactly X-Pex-Api-Token. If the header name is wrong, the connection will fail silently when the agent tries to call a tool.
Leave the form open — you need to grab the token next.

Step 4. Generate an API token from the PEX dashboard

In a new browser tab, sign in to the PEX dashboard and open your user profile (click your avatar in the top-right and choose your name). Click the Authorized apps tab (marked Beta).
PEX dashboard Authorized apps tab showing the PEX MCP Server entry alongside other authorized applications
You should see PEX MCP Server listed as an available application along with its First authorized and Last authorized dates. Use the controls on this page to generate an API token for PEX MCP Server, then copy the token to your clipboard.
Treat this token like a password.Anyone with the token can call PEX tools as you. If you suspect it has been exposed, revoke it on this same page and generate a new one. PEX support contact for anything unusual: adminsupport@pexcard.com.

Step 5. Connect the MCP Server with your token

Switch back to the Copilot Studio tab. After clicking Continue on the form, Copilot Studio will open the Connect to <Server name> dialog. Paste the API token into the credential field and click Create.
Connect to your MCP server dialog with the API token field highlighted
If the token is valid, Copilot Studio adds the tool to the agent and shows a green confirmation: “Your tool was added to the agent.”
Tools tab showing the success banner Your tool was added to the agent

Step 6. Verify the connection in Manage Connections

This is the step that catches most people. Adding the tool registers the connection but does not always activate it. Open the Power Platform connections manager (Copilot Studio links to it directly when you try to use the tool the first time). If the connection shows Not Connected, click the Connect link in that row and follow the prompt. You only need to do this once per environment.
Manage your connections page showing the MCP server entry with Status = Not Connected and a Connect link
After connecting, refresh the page; the status should change to Connected.

Step 7. Test the agent

Open the Test your agent panel on the right side of Copilot Studio and try a prompt that exercises the new tool, for example:
can you see the My-PEX-MCP-Server tool?
If the connection has not been activated yet, the agent will respond with a prompt to open the connection manager and retry — finish Step 6 and click Retry.
Agent prompting the user to open connection manager before retrying
Once connected, the agent will enumerate the PEX tools it now has access to. The PEX MCP Server exposes a comprehensive PEX toolset, including:
  • Card tools — list cards, card orders, card spend rules, scheduled funding, load limits.
  • Transaction tools — cardholder transactions, network transactions, transaction details, attachments.
  • Business tools — business profile, admins, billing, linked accounts, one-time transfers.
  • Spending rulesets — list rulesets, ruleset cards.
  • Other — vendors, bills, payments, invoices, callback subscriptions, MCC categories, groups & cardholders.
Agent listing the categories of tools available from the PEX MCP Server
To confirm a real call works end-to-end, ask something specific:
what is my business?
The agent will call pex_get_business_profile and return your live business profile — Business Account ID, name, address, contact info, etc. The middle pane in Copilot Studio shows the raw tool output and the agent’s formatted response side-by-side.
pex_get_business_profile call completed, raw output on the left and formatted Business Profile card on the right
You can now ask the agent any of the supported questions, e.g. “list all my PEX cards”, “show transactions for card 1234 last week”, “what spending rulesets do I have?”

Bonus: Make the agent smarter with the PEX support site

The MCP server gives the agent live access to your account data (cards, transactions, business profile, etc.). It does not, by itself, teach the agent how PEX works — what features exist, what fields mean, or what the recommended way to do something is. For that, point the agent at https://support.pexcard.com as a Knowledge source. Once added, the agent can ground its answers in the same help articles a PEX customer would read, and questions like “how do I issue a virtual card?” or “what’s the difference between a vendor card and a cardholder card?” will get accurate, sourced answers.
Heads up — data flow.Adding a public website as a Knowledge source uses Microsoft Grounding with Bing Search / Bing Custom Search. That means search queries leave your Copilot Studio tenant and hit Microsoft’s Bing service. Confirm this is acceptable under your org’s compliance policy before enabling.

Step A. Open the Add knowledge picker

On your agent’s Overview page, find the Knowledge section and click + Add knowledge. You will see a picker with the available source types — file upload, OneDrive/SharePoint, Public websites, SharePoint, Azure AI Search, Dataverse, Dynamics 365, Salesforce, ServiceNow, Azure SQL. Click the Public websites tile.
Add knowledge dialog with the Public websites tile highlighted

Step B. Enter the PEX support site URL

In the Add public websites dialog, paste https://support.pexcard.com into the Public website link field, then click Add.
Add public websites dialog with https://support.pexcard.com typed into the Public website link field

Step C. Confirm the source and add it to the agent

Copilot Studio creates an entry with a default Name and Description. Both fields are editable — tweak them if you want the agent to refer to this source as something specific (for example, “PEX Help Center”). Click Add to agent to finish.
Add public websites dialog with the support.pexcard.com source added and the Add to agent button highlighted
The Knowledge section on the agent’s Overview will now list support.pexcard.com as a connected source. From this point on, the agent will consult those help articles whenever a question looks like a “how do I” or “what does X mean” question, and will cite the article in its response.
Tip — combine with the MCP tools.The most useful agent has both: the MCP server for “what is in my account right now” and the support site for “how does PEX work.” Asked something like “why was this transaction declined?”, the agent can look up the live transaction (MCP) and explain the relevant policy from the help center (Knowledge) in the same answer.

Troubleshooting

The agent says it cannot see the tool. The connection is most likely in Not Connected state. Open Manage Connections (Step 6), click Connect on the row, and retry the prompt. Tool calls return 401 / Unauthorized. The API token is invalid, expired, or was pasted with leading/trailing whitespace. Regenerate the token in Authorized apps and update the connection. Tool calls return data from the wrong account. Tokens are scoped to the user who generated them. If you generated the token under one PEX user, the agent will see that user’s account. Generate the token under the correct user. The header name field rejects what I typed. The required header name is exactly X-Pex-Api-Token (capital X, capital P, capital A, capital T). Other casings will not work. I don’t see the Authorized apps tab. The feature is in Beta. If your dashboard does not yet show the tab, contact PEX support to confirm your account is enabled for the beta.

Revoking access

To revoke an agent’s access to PEX:
  1. Open the Authorized apps tab in the PEX dashboard.
  2. Revoke the token associated with PEX MCP Server.
  3. (Optional) Remove the tool from the agent in Copilot Studio under Tools.
Revoking the token immediately disables all subsequent calls from any agent using it.

Need more help?

  • For PEX-side issues (tokens, account access, MCP server availability), email adminsupport@pexcard.com.
  • For Copilot Studio issues (agents, connections, environments), see Microsoft’s Copilot Studio documentation.
Last modified on May 4, 2026