Package Exports
- @rarefriend-ai/mcp
- @rarefriend-ai/mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rarefriend-ai/mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@rarefriend-ai/mcp
Stdio MCP proxy for Rarefriend CRM. Bridges any stdio MCP client (Claude Desktop, Cursor, Claude Code CLI, any agent framework) to the Rarefriend HTTP MCP server using OAuth client_credentials — no browser needed.
Install
No install step. Use directly via npx:
npx -y @rarefriend-ai/mcpGet credentials
Go to Rarefriend → Settings → Integrations → MCP / AI Agent, click Manage → Generate OAuth Client. Copy the client ID and secret (shown once).
Configure your client
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"rarefriend": {
"command": "npx",
"args": ["-y", "@rarefriend-ai/mcp"],
"env": {
"RAREFRIEND_CLIENT_ID": "your-client-id",
"RAREFRIEND_CLIENT_SECRET": "your-client-secret"
}
}
}
}Cursor
Edit .cursor/mcp.json in your project or ~/.cursor/mcp.json globally:
{
"mcpServers": {
"rarefriend": {
"command": "npx",
"args": ["-y", "@rarefriend-ai/mcp"],
"env": {
"RAREFRIEND_CLIENT_ID": "your-client-id",
"RAREFRIEND_CLIENT_SECRET": "your-client-secret"
}
}
}
}Claude Code CLI
claude mcp add rarefriend npx -- -y @rarefriend-ai/mcp \
-e RAREFRIEND_CLIENT_ID=your-client-id \
-e RAREFRIEND_CLIENT_SECRET=your-client-secretEnvironment variables
| Variable | Required | Default | Description |
|---|---|---|---|
RAREFRIEND_CLIENT_ID |
yes | — | OAuth client ID from Rarefriend settings |
RAREFRIEND_CLIENT_SECRET |
yes | — | OAuth client secret from Rarefriend settings |
RAREFRIEND_SERVER_URL |
no | https://app.rarefriend.com |
Override the server URL (staging/self-hosted) |
How it works
- On start, requests an OAuth access token via
client_credentialsgrant at/api/auth/oauth2/tokenwith RFC 8707resourceindicator. - Connects to the remote HTTP MCP server at
/api/mcpwith the token as a Bearer header. - Spawns a local stdio MCP server that proxies
tools/listandtools/callto the remote server. - Refreshes the token automatically 60 seconds before expiry (reconnects the remote transport with the fresh token).
Security
- Credentials are read from environment variables only. Never stored in files.
- Tokens are held in process memory only and expire on process exit.
- Scoped to
workspace:readby default; write scopes are enabled server-side based on the client's configured permissions. - No outbound network calls beyond
RAREFRIEND_SERVER_URL.
License
MIT