Skip to main content
Version: v1.0.0

Connect Your Agent

The MCP endpoint is your Pharus API host plus /mcp:

https://stg.api.pharus.ai/mcp

It speaks Streamable HTTP (the current MCP remote transport), stateless — no sessions to manage. There are two ways to authenticate: connector-style clients (Claude Desktop, claude.ai) connect by URL and sign in through OAuth, while header-based clients (Claude Code, the API, anything else) send a personal access token (pharus_pat_...) as a Bearer token.

Claude Code

claude mcp add --transport http pharus https://stg.api.pharus.ai/mcp \
--header "Authorization: Bearer pharus_pat_YOUR_TOKEN"

Then just ask: "using pharus, how much raw cotton do we have in stock?"

Claude Desktop / claude.ai

Add a custom connector (Settings → Connectors → Add custom connector), give it a name and the MCP URL:

https://stg.api.pharus.ai/mcp

That's it — no token to paste. Claude authenticates over OAuth: it discovers the Pharus authorization server from the URL, opens the Pharus consent page where you sign in and choose the organization to connect, and from then on holds its own access token. The connection is bound to the organization you pick, exactly like an org-scoped PAT.

Claude API (MCP connector)

Pass the server directly in a Messages API call:

{
"model": "claude-opus-4-8",
"max_tokens": 2048,
"mcp_servers": [
{
"type": "url",
"url": "https://stg.api.pharus.ai/mcp",
"name": "pharus",
"authorization_token": "pharus_pat_YOUR_TOKEN"
}
],
"messages": [{ "role": "user", "content": "List our open purchase orders" }]
}

Any other MCP client

Standard Streamable HTTP configuration:

  • URL: https://stg.api.pharus.ai/mcp
  • Header: Authorization: Bearer pharus_pat_YOUR_TOKEN
  • Transport: Streamable HTTP (POST only; the server is stateless and returns JSON responses)

First contact

Your token is bound to a single organization and every call is scoped to it automatically — there is no identity or "who am I" step. Jump straight into the data plane: the Tool Reference is the menu.

Troubleshooting

SymptomCause
401 UnauthorizedMissing, invalid, expired, or revoked credentials — either a PAT (pharus_pat_*) or an OAuth access token. For an OAuth connector, remove and re-add it to re-authenticate.
403 forbidden on a tool callYour role in the organization doesn't allow that operation (e.g. member trying an admin-only delete).
405 Method Not AllowedThe client tried GET/SSE on /mcp — the server is stateless; use a Streamable-HTTP client.
Tool error validation_failedThe arguments don't match the tool's input schema — the error details name the offending fields.