# Refresh Connections

> Checks and refreshes MCP and service connections for Google Workspace (gws), Slack, The Source, Dataverse, Atlan, Sanity, and Playwright. Use when the user asks to refresh connections, check MCP auth, fix expired tokens, verify gws/Slack access, or reconnect integrations before running other skills.

- Skill: `cgray-redhat/refresh-connections` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add cgray-redhat/refresh-connections`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cgray-redhat/refresh-connections/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: cgray-redhat (https://skillmd.com/u/cgray-redhat)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/cgray-redhat/refresh-connections

---


# Refresh Connections

Run a health check on Chris's integrations, refresh anything broken, and report a concise status table.

## Quick start

1. **Check everything** (always run this first):

```bash
python3 ~/.cursor/skills/refresh-connections/scripts/check_connections.py \
  --project-mcp .cursor/mcp.json
```

Exit code **0** = all critical services OK. Exit code **1** = one or more need refresh.

2. **Refresh failed services** using the workflows below (only for checks that failed).

3. **Re-run the check script** to confirm.

4. **Tell the user** what was OK, what was refreshed, and whether they must reload MCP servers in Cursor.

## Status report format

Present results like this:

| Service | Status | Action taken |
|---|---|---|
| Google Workspace (gws) | OK / Expired | `gws auth login` if needed |
| The Source | OK / Stale / Expired | Refreshed via Playwright SSO |
| Slack MCP | OK / Expired | Refreshed tokens in MCP config |
| Dataverse MCP | OK / Needs auth | Called `mcp_auth` |
| Atlan MCP | Reachable / Needs auth | Called `mcp_auth` |
| Sanity MCP | Reachable / Needs auth | Re-auth in Cursor MCP settings |
| Playwright MCP | Configured | No action unless browser tools fail |

Do **not** print tokens, cookies, or full MCP env values in chat.

## Refresh workflows

### Google Workspace (`gws`)

**Symptom:** `gws auth status` fails, or Gmail/Calendar API calls fail.

**Fix:**

```bash
gws auth login
gws auth status
gws gmail users getProfile --params '{"userId":"me"}' --format json
```

Required scopes for existing skills: `calendar`, `gmail.modify`, and related Workspace scopes from the [AI Skills gws install](https://redhat-ai-analysis.pages.redhat.com/ai-skills-workshop/install/gws/).

### The Source

**Symptom:** Missing `~/.config/thesource-mcp/cookies.txt`, file older than 10 hours, or API returns authorization denied.

**Fix:** Follow the **thesource** skill authentication flow using **Playwright MCP**:

1. `browser_navigate` → `https://source.redhat.com`
2. If SSO is shown, ask the user: **"Please complete Red Hat SSO login in the browser window."**
3. `browser_wait_for` text `"The Source"` (120s timeout)
4. Save session with `browser_run_code_unsafe` (do **not** return cookie values to chat):

```javascript
async (page) => {
  const { mkdirSync, writeFileSync } = await import('node:fs');
  const { join } = await import('node:path');
  const path = join(process.env.HOME, '.config/thesource-mcp/storage-state.json');
  mkdirSync(join(process.env.HOME, '.config/thesource-mcp'), { recursive: true });
  await page.context().storageState({ path });
  return { saved: true };
}
```

5. Convert storage state to cookies (run locally; do not echo secrets):

```bash
python3 ~/.cursor/skills/refresh-connections/scripts/sync_thesource_cookies.py
```

6. `browser_close`

### Slack MCP

**Symptom:** `auth.test` fails, MCP server errors, or tokens missing from MCP config.

**Fix:** Follow the **slack-login** skill:

```bash
python3 ~/.cursor/skills/slack-login/scripts/slack-login.py \
  --workspace https://redhat.enterprise.slack.com \
  --json --output ~/.slack_tokens.env --timeout 300
```

Update **both** MCP configs if present:

- `~/.cursor/mcp.json` (global)
- `.cursor/mcp.json` (project)

Use the extracted `xoxc_token` and `xoxd_token` in the `slack` server's `env` block. Tell the user to **reload MCP servers** or restart Cursor.

### Dataverse MCP

**Symptom:** Dataverse tools unavailable; project MCP folder shows auth required.

**Fix:**

1. Call MCP tool `mcp_auth` on server `user-Dataverse` with `{}`.
2. User completes SSO in browser if prompted.
3. Verify with a lightweight **dataverse-people-lookup** query (`Who am I?`).

### Atlan MCP

**Symptom:** Atlan tools unavailable; MCP folder shows auth required.

**Fix:**

1. Call MCP tool `mcp_auth` on server `user-Atlan` with `{}`.
2. User completes Atlan OAuth in browser if prompted (Red Hat SSO via `redhat.atlan.com`).
3. Verify with a lightweight metadata query (e.g. search for a known table or glossary term).

Hosted endpoint: `https://redhat.atlan.com/mcp` (OAuth; tokens persist in Cursor after first login).

### Sanity MCP

**Symptom:** Sanity tools fail or HTTP MCP needs re-auth.

**Fix:** Re-authenticate in **Cursor Settings → MCP** for the Sanity server. Sanity uses hosted OAuth at `https://mcp.sanity.io` — there is no local token file to refresh from the CLI.

### Playwright MCP

**Symptom:** Browser tools fail; SSO refresh for The Source or Slack depends on this.

**Fix:** Confirm `npx @playwright/mcp@latest` is configured in project `.cursor/mcp.json`. If browser launch fails, run `npx playwright install chromium`.

## MCP config locations

| Scope | Path |
|---|---|
| Global (Cursor user) | `~/.cursor/mcp.json` |
| Project | `.cursor/mcp.json` |

When refreshing Slack tokens, update every config file that defines a `slack` server.

## When the user says "refresh all connections"

```
Progress:
- [ ] Run check_connections.py
- [ ] Refresh Google (gws) if needed
- [ ] Refresh The Source if needed
- [ ] Refresh Slack if needed
- [ ] Dataverse mcp_auth if needed
- [ ] Atlan mcp_auth if needed
- [ ] Note Sanity / Playwright status
- [ ] Re-run check_connections.py
- [ ] Summarize for user
```

Only refresh services that failed the check — do not re-auth healthy sessions.

## Related skills

- **slack-login** — extract Slack XOXC/XOXD tokens
- **thesource** — The Source search API and SSO details
- **dataverse-people-lookup** — verify Dataverse after auth

## Additional resources

- Service details and troubleshooting: [reference.md](reference.md)

