# LXI MCP

Remote endpoint: **https://lxi.be/mcp** (Streamable HTTP).
Guide: **https://lxi.be/developers/mcp**.
Credentials and revocation: **https://lxi.be/account/developer#mcp**.

LXI exposes its authenticated public API as MCP tools, resources and prompts.
The official MCP Python SDK handles transport, protocol versions, discovery,
initialization for older clients, JSON-RPC validation and cancellation. Supported
protocols include the modern 2026-07-28 revision and legacy 2025-11-25.

## Remote connection

Add `https://lxi.be/mcp` as a remote Streamable HTTP server in your client.
OAuth-capable clients discover the authorization server, register a public client,
open LXI's consent page, and exchange a PKCE S256 authorization code. Review the
requested scopes; you may deselect permissions. No password is shared with the
external application.

Clients with custom header support can instead use a personal API token:

```json
{"mcpServers":{"lxi":{"url":"https://lxi.be/mcp","headers":{"Authorization":"Bearer YOUR_LXI_API_TOKEN"}}}}
```

Configuration field names vary by client. Keep credentials in its protected
configuration or secret store. Tokens never belong in endpoint URLs.

## Local stdio

Python 3.11 or newer:

```sh
python -m pip install https://lxi.be/downloads/lxi_mcp-1.0.0-py3-none-any.whl
```

```json
{"mcpServers":{"lxi":{"command":"lxi-mcp","env":{"LXI_API_TOKEN":"YOUR_LXI_API_TOKEN"}}}}
```

Use the absolute executable path when it is installed inside a virtual environment.
The adapter runs no local shell tools. It calls the LXI API with the supplied token
and revalidates that credential. It writes protocol messages only to stdout and
logs to stderr. `LXI_API_BASE_URL` is an operator/testing override; ordinary users
should keep the production default.

## Tools

The tool catalogue is generated from the versioned LXI OpenAPI description:
https://lxi.be/downloads/lxi-mcp-tools.json

Every authenticated API operation is exposed except API discovery/device login.
Tools cover account/usage, domains/quotes/orders, DNS, hosting/jobs/mailboxes,
webhooks, AI chat/translation and Maker projects, follow-ups, approvals, retries
and explicitly approved Git operations. Tool names match OpenAPI operation IDs.
Lists are scoped to the token. Undisclosed tools cannot be called by guessing a
name. Path/query parameters are top-level arguments and JSON payloads use `body`.

```json
{"name":"messageMakerProject","arguments":{"project_id":"YOUR-PROJECT-UUID","body":{"content":"Use blue colours and add a contact page."}}}
```

Tool results contain `status` and `data` in structured content and text. API
failures set `isError`. Invalid schemas are rejected before the API call. Tool
annotations distinguish read operations from changes; client approval remains
important. Existing checkout and Maker Git consent requirements still apply.
No write is automatically retried after a timeout or uncertain result.

## Resources and prompts

Static JSON resources: `lxi://account`, `lxi://usage`, `lxi://services`,
`lxi://domains`, `lxi://hosting/sites`, `lxi://orders`, `lxi://maker/projects`,
`lxi://docs/openapi`.

URI templates expose individual domain DNS/mailboxes, hosting jobs and Maker
projects. Resource permissions and ownership are enforced by the same API.
Templates are advertised through `resources/templates/list`. No resource change
subscriptions are advertised; reread the relevant resource to refresh it.

Prompts:

- `website_start(goal)` plans and develops a Maker project.
- `hosting_audit()` reviews hosting without making changes.
- `translation_review(text, language)` translates and reviews a text.

Fetching a prompt does not itself start AI work. Actual AI/Maker tools use the
existing plan credits. MCP has no separate credit allowance. Chat results are
returned as complete JSON; use REST for token-by-token chat streaming.

## Permissions and OAuth

Scopes: `read`, `domains`, `hosting`, `billing`, `ai`, `maker`, `maker_git`,
`webhooks`. Git operations require both Maker scopes. Read-only tokens cannot
change data. All account identifiers are validated by LXI API ownership checks.

Discovery:

- `/.well-known/oauth-protected-resource/mcp`
- `/.well-known/oauth-authorization-server`
- `/oauth/register`, `/oauth/authorize`, `/oauth/token`, `/oauth/revoke`

OAuth accepts registered exact-match HTTPS callbacks and local loopback HTTP
callbacks. PKCE S256 and resource `https://lxi.be/mcp` are mandatory. Codes are
single-use and expire after five minutes. Access tokens expire after one hour.
Refresh tokens rotate; replay revokes their grant family. The refresh grant
expires after 30 days. Scopes can be narrowed, never expanded by refreshing.
Codes, API tokens and refresh credentials are hashed in storage. No global
platform credential is handed to the MCP process.

API-token revocation in the customer centre prevents future calls and refreshes.
Revocation cannot undo an already dispatched action. Listing tools and reading
resources do not create projects or initiate purchases.

## Operations

The production MCP process listens on loopback only and Apache exposes `/mcp`.
Origin/Host allowlists are enabled. Protocol POSTs are stateless; authorization is
checked on every request and scoped to that request. JSON responses are private
and not cached. Request limits follow the SDK and the existing API per-operation
limits; pagination bounds a page and always offers a continuation when needed.
The packaged OpenAPI snapshot and downloadable catalogue must be regenerated when
API operations change. Tests cover both protocol eras with the official client,
OAuth/PKCE/replay/revocation, resource templates, invalid arguments and account
isolation.

Primary protocol/SDK documentation:
https://modelcontextprotocol.io/specification/latest
https://py.sdk.modelcontextprotocol.io/
