# Globle customer context for AI assistants

Globle keeps one decision context for a person across WhatsApp, Instagram, the Globle dashboard and approved AI assistants. Connect through the remote Model Context Protocol server:

`https://globle.me/mcp`

- Transport: MCP over Streamable HTTP.
- Authentication: OAuth 2.1 authorization code flow with S256 PKCE.
- Client registration: RFC 7591 dynamic client registration.
- Protected-resource metadata: `https://globle.me/.well-known/oauth-protected-resource/mcp`.
- Authorization-server metadata: `https://globle.me/.well-known/oauth-authorization-server`.
- Tokens and grants are bound to the one Globle account that approves them.

Agents that cannot use remote MCP can call the equivalent REST API at `https://globle.me/api/v1`. Its live OpenAPI 3.1 document is `https://globle.me/api/v1/openapi.json`. Both APIs use the same OAuth tokens or scoped Globle access keys, account binding, permission checks and operation handlers.

## Identity and shared context invariant

Every messaging identity and assistant connection resolves through the same server-owned chain: `verified touchpoint → account_id → canonical_customer`. An MCP request cannot provide a phone number, Instagram subject, account ID or customer key to select another person. OAuth stores the account that approved the grant; an access key is created inside that same signed-in account. Every tool then derives the canonical customer record from the credential and attributes activity to the individual connection. As a result, context contributed from Instagram, WhatsApp, ChatGPT, Claude, Codex, Cursor or Instinct is read back from the same customer record rather than creating a new user.

## Message to send an assistant

> I use Globle for my decision context. Please connect to its remote MCP server at https://globle.me/mcp. Follow the OAuth discovery response, open the Globle sign-in and approval page for me, and use only the permissions I approve. The connection details are at https://globle.me/developers.md.

## Connection methods

### A client with a remote MCP screen

Add `https://globle.me/mcp` as a remote Streamable HTTP server. Do not add headers, a fixed client ID or a client secret. The client should call the endpoint, follow the OAuth metadata in the `401` response, dynamically register itself and open the authorization link.

### A command-line MCP client

Add the same endpoint and run the client's OAuth login command. Globle accepts HTTPS callbacks and loopback HTTP callbacks on localhost. A loopback callback may use any available port when its host and path match the registered URI.

### An agent with web requests but no connector screen

An assistant such as Instinct can connect without installing anything:

1. POST to `https://globle.me/mcp` without a token. The `401` response names `https://globle.me/.well-known/oauth-protected-resource/mcp`.
2. Read that resource document, then the authorization-server metadata it names.
3. POST dynamic client metadata to `https://globle.me/oauth/register`. Register as a public client with `token_endpoint_auth_method` set to `none` and a loopback return URI such as `http://127.0.0.1:8585/callback`.
4. Generate a PKCE verifier and its S256 challenge. Open `https://globle.me/oauth/authorize` with `response_type=code`, the returned `client_id`, exact `redirect_uri`, challenge, requested scopes, state and `resource=https://globle.me/mcp`.
5. The person signs in to Globle and approves. Globle attempts the callback while keeping a connected page available. If the cloud agent cannot receive the loopback request, the person copies the complete callback URL and returns it to the agent.
6. Within five minutes, POST the code, verifier, client ID, redirect URI and `grant_type=authorization_code` to `https://globle.me/oauth/token`.
7. Call `https://globle.me/mcp` with `Authorization: Bearer <access_token>`. The access token lasts one hour. Rotate the refresh token through the token endpoint before or after expiry.

## Verified client setup

These are setup presets over the same connector, not separate Globle accounts or APIs.

- **ChatGPT:** enable Developer mode under Security and login, then under Plugins add a custom MCP server named Globle. Use `https://globle.me/mcp`, keep OAuth enabled, and approve in Globle.
- **Claude:** open Customize → Connectors → Add custom connector. Name it Globle, use `https://globle.me/mcp`, leave sign-in enabled, then connect and approve.
- **Codex:** run `codex mcp add globle --url https://globle.me/mcp`, followed by `codex mcp login globle`.
- **Cursor:** add `{ "mcpServers": { "globle": { "url": "https://globle.me/mcp" } } }` to the user or project `mcp.json`, then complete OAuth when Cursor asks.
- **Instinct:** use the conversational OAuth flow below because Instinct does not currently expose a general custom-MCP settings screen.

## Instinct

Instinct does not currently expose a general custom-MCP connector screen. Whether it can connect depends on the Instinct environment's ability to make external web requests and retain a refresh token.

Send Instinct this message:

> Please connect to my Globle decision context at https://globle.me/mcp. You do not need a connector screen: follow its OAuth discovery, dynamically register “Instinct” as a public client with a loopback callback, use S256 PKCE, and give me the Globle approval link. After I approve, if the callback page does not load, ask me to paste its full URL back so you can exchange the code. Request only the scopes you need. Full instructions: https://globle.me/developers.md

If an Instinct environment cannot use custom MCP or retain OAuth, create a separately revocable, scoped access key under Dashboard → Connections. Send Instinct: `Use Globle's REST API at https://globle.me/api/v1 with this as the bearer token; read https://globle.me/api/v1/openapi.json and https://globle.me/developers.md.` Then provide the one-time key only in that private, trusted assistant conversation. Revoke it from Globle when no longer needed.

## OAuth behavior

- Approval requests last ten minutes.
- Authorization codes last five minutes, are bound to the client, redirect URI, resource and PKCE challenge, and can be used once.
- Access tokens last one hour.
- Refresh tokens rotate on every use and expire after 30 days.
- Reusing an already rotated refresh token revokes the whole connection.
- Revoking an assistant in the Globle dashboard invalidates its access and refresh immediately.
- The customer approval page requires a recent Globle sign-in.

## Scoped access-key fallback

Use this only when an agent cannot complete or retain OAuth. The customer creates one key per agent under Dashboard → Connections, chooses exact scopes, and copies the raw `glb_customer_…` value once. Send it as `Authorization: Bearer <access_key>` to `https://globle.me/mcp` or `https://globle.me/api/v1`.

Globle stores only the SHA-256 hash and a non-secret display prefix. Each key is bound through its own connection record to exactly one customer account. It uses the same scope checks, account lookup and write fences as OAuth. Revoking the key immediately blocks future calls. Never place the key in a public chat, source file, log or issue.

## REST API

The REST API maps Globle's MCP tools to ordinary JSON operations. It is intended for assistants such as Instinct when their environment cannot install a remote MCP server, and for trusted scripts and workflow tools.

Base URL: `https://globle.me/api/v1`

- `GET /context?history=false` → `get_context`
- `GET /journeys?history=false` → `get_journeys`
- `GET /search?q=...&limit=10` → `search_context`
- `GET /decisions/{id}` → `get_decision`
- `GET /sources/{id}` → `get_source`
- `POST /context/contributions` → `contribute_context`
- `POST /decisions/{id}` → `propose_decision_update`
- `POST /context/corrections` → `correct_context`

Send JSON request bodies and `Authorization: Bearer <OAuth access token or Globle access key>`. The response is the same structured operation result used by MCP, without a JSON-RPC envelope. The limit is 60 requests per minute per credential; a `429` includes `Retry-After`. Errors use `{ "error": "one sentence", "code": "invalid|notFound|unauthorized|rateLimited|toolError" }`. IDs owned by another account are indistinguishable from missing IDs and return `404`.

```bash
curl "https://globle.me/api/v1/context" \
  -H "Authorization: Bearer glb_customer_…"
```

The REST API never accepts an account ID, phone number, Instagram subject or canonical customer key. It derives the account and canonical customer exclusively from the bearer credential.

## Permissions

- `context:read`: read compact current context.
- `context:search`: search permitted context by keyword.
- `decisions:read`: read a decision, its evidence and current version.
- `sources:read`: read a saved source and its evidence.
- `context:contribute`: submit bounded context and correction proposals.
- `decisions:propose`: propose version-checked decision updates.

When no scope is requested, Globle defaults to the four read permissions. A user must explicitly approve write permissions.

## Tools

- `get_context` (`context:read`): compact current context and decisions with stable IDs and provenance.
- `get_journeys` (`context:read`): ordered journeys with step reasons, progress, resources, evidence completeness and correction counts.
- `search_context` (`context:search`): find permitted things and claims without returning unrelated private records.
- `get_decision` (`decisions:read`): read a decision's criteria, options, evidence, history and version.
- `get_source` (`sources:read`): read one saved source and its available evidence.
- `contribute_context` (`context:contribute`): submit one bounded statement as an AI-backed proposal.
- `correct_context` (`context:contribute`): propose a correction without rewriting user-backed context.
- `propose_decision_update` (`decisions:propose`): submit a typed update against a decision's current version.

## Rules for assistants

1. Call `get_context` once to orient. Use `get_journeys` when the task concerns an ordered path. Read only the minimum relevant context.
2. Use `search_context` before creating anything. Do not duplicate a stable ID.
3. A saved item is not automatically a preference or a decision.
4. A choice is not a purchase, booking, visit or outcome.
5. Only contribute information the person explicitly asked you to keep.
6. External contributions remain AI-backed proposals. Never describe them as user-confirmed.
7. Use the current version from `get_decision` for every decision proposal. On conflict, read again rather than overwriting.
8. Tell the person the returned disposition: `proposed`, `needs_clarification`, `rejected`, `conflict` or `failed`.

## Account isolation

The signed-in browser session selects the Globle account during authorization. The account ID is stored on the connection and embedded indirectly in server-side token records. MCP requests never accept an account ID, phone number, Instagram ID, canonical customer key or other customer selector from the caller.

Every authenticated request:

1. Resolves the access token to one connection.
2. Rechecks that the connection is active.
3. Rechecks that its account is active.
4. Loads the canonical customer record from that account.
5. Filters decision and source records by the approved scopes.
6. Rechecks the grant immediately before every write.

## Troubleshooting

- **No browser opens:** the assistant did not follow the `401` into OAuth discovery, or it cannot make the required web requests. Send it the Instinct message above.
- **The loopback callback cannot be reached:** copy the complete callback URL from the browser and return it to the cloud assistant within five minutes.
- **The approval page asks for sign-in:** complete Globle phone verification. A valid pending authorization resumes after sign-in.
- **MCP calls return `401`:** refresh the access token. If refresh fails, the connection was revoked, expired or detected a refresh replay; connect again.
- **A write returns `conflict`:** read the decision again and retry with its current version.
- **A tool is missing:** start a new assistant conversation so it reloads the MCP tool list.

Human-readable version: `https://globle.me/developers`
