# Maplith auth.md

How an AI agent connects to Maplith. Maplith serves a company's data map to
AI agents over the Model Context Protocol (MCP) at `https://app.maplith.com/api/mcp`
(streamable HTTP). Every connection belongs to one person in one workspace
and sees no more than that person does.

## Who this is for

Any MCP client: Claude, ChatGPT, Codex, Claude Code, or an agent you built.

## Connect with OAuth

Point the client at `https://app.maplith.com/api/mcp`. Without a credential the endpoint
answers 401 with a `WWW-Authenticate` header whose `resource_metadata`
names the discovery document below; the client follows it, and a person
signs in to Maplith in the browser to allow the connection. Nothing is pasted.

- Protected resource metadata (RFC 9728): `https://app.maplith.com/.well-known/oauth-protected-resource/api/mcp`,
  also at `https://app.maplith.com/.well-known/oauth-protected-resource`. Resource: `https://app.maplith.com/api/mcp`.
- Authorization server metadata (RFC 8414): `https://app.maplith.com/.well-known/oauth-authorization-server`. Issuer: `https://app.maplith.com`.
- Dynamic client registration (RFC 7591): `https://app.maplith.com/api/oauth/register`. Clients are public: no client secret (`token_endpoint_auth_methods_supported: none`).
- Authorization: `https://app.maplith.com/oauth/authorize`, grant `authorization_code` with PKCE (`S256`).
- Token: `https://app.maplith.com/api/oauth/token`. Scope: `mcp`.

The access token the flow issues is a Maplith agent key, sent as
`Authorization: Bearer <token>` (bearer in the header only).

## What a connection may do

A manually created key starts read-only. Personal OAuth connections start with approval-based work and uploads selected for admins and builders; viewers start with Report and propose, which stays read-only and only reports and proposes for a person to decide. Acting directly is an explicit admin choice.

On the consent page, **May upload** and **Act with approval** start selected for admins and builders. Turn uploads off to keep file submission in your hands, or choose **Read only** for a connection that submits nothing, including no feedback, observations, work reports or actions. Viewers start with **Report and propose**: their assistant records the work they report, suggests improvements and proposes rules, a person with the right role decides each proposal, and it changes nothing and acts on nothing; one click on **Read only** connects without it. Only admins can choose **Act directly**; it is never a default. Check the named workspace and organisation before you allow access. A connection sees no more than the person connecting it. Existing keys keep their separate permissions. Change access under Sources › Agents and reconnect in your assistant.

An agent that wants to act in the company's own systems asks first
(`request_action`): the answer is allowed, pending a person, or denied.
Maplith never performs the action and never holds the credentials the agent
acts with.

## Connect with an agent key instead

A person can make an agent key in Maplith under Sources › Agents and give it to the agent, which sends it on every request:

```
Authorization: Bearer <agent key>
```

Keys are stored as hashes, shown once, scoped to what the person chose, and
revocable at once.

## Try it without an account

A public sandbox key reads the map of a fictional company, read-only and
rate-limited: `mlk_demo_acme-ltyWYChCrYzO8KOec-8BX-yO`.

## More

- MCP reference: https://maplith.com/docs/mcp (markdown: https://maplith.com/docs/md/mcp)
- Agent keys and policies: https://maplith.com/docs/agent-keys
- MCP server card: https://app.maplith.com/api/mcp/server-card
- API catalog: https://maplith.com/.well-known/api-catalog
- llms.txt: https://maplith.com/llms.txt
