# Maintaining CLI and MCP
Source: https://docs.lomi.africa/resources/contributing/maintaining-cli-mcp

Guide for lomi. contributors and operators who develop or deploy apps/cli and apps/mcp, not for merchant integrators.

***

title: 'Maintaining CLI and MCP'
description: 'Guide for lomi. contributors and operators who develop or deploy apps/cli and apps/mcp, not for merchant integrators.'
------------------------------------------------------------------------------------------------------------------------------------

The **lomi. CLI** and **MCP server** are **integrator tools**: they help developers build on the hosted merchant API. This page is for people who **maintain those packages** in the monorepo or deploy the hosted MCP server.

If you are integrating lomi. into your product, use [CLI](/build/cli) and [MCP](/build/mcp) instead.

## Who should read this

| Role                   | Use CLI/MCP to…                                   | Use this page for…                             |
| ---------------------- | ------------------------------------------------- | ---------------------------------------------- |
| **Merchant developer** | Integrate checkout, webhooks, SDK                 | No, use Build docs                             |
| **Contributor**        | Dogfood integration flows while building features | Yes, when changing `apps/cli` or `apps/mcp`    |
| **Operator**           | -                                                 | Yes, deploy MCP, regenerate tools, release CLI |

CLI/MCP are **not** for operating `apps/admin`, self-hosting payment processing, or general monorepo maintenance (migrations, API deploy, etc.).

## CLI (`apps/cli`)

Maintainer docs: [`apps/cli/CONTRIBUTING.md`](https://github.com/lomiafrica/lomi./blob/master/apps/cli/CONTRIBUTING.md)

| Task          | Command / location                                                        |
| ------------- | ------------------------------------------------------------------------- |
| Local dev     | `cd apps/cli && cargo build && cargo test`                                |
| Local API URL | `http://localhost:3000` is allowed. Remote URLs must be `https`.          |
| Docs checks   | `cd apps/docs && pnpm lint && pnpm docs:drift && pnpm screenshots:verify` |
| Agent rules   | `./apps/cli/scripts/generate/generate-rules.sh`                           |
| Release       | Tag `cli-v*`, see CONTRIBUTING.md                                         |

## MCP (`apps/mcp`)

Maintainer docs: [`apps/mcp/CONTRIBUTING.md`](https://github.com/lomiafrica/lomi./blob/master/apps/mcp/CONTRIBUTING.md)

| Task                      | Command / location                                                                                                                                                                                                |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Local HTTP server         | `cd apps/mcp && pnpm run start:http`                                                                                                                                                                              |
| Regenerate tools          | `pnpm run generate` → commit `src/generated/tools-manifest.json`                                                                                                                                                  |
| Drift CI                  | `pnpm docs:drift` (OpenAPI ↔ MDX, MCP manifest, agent contracts)                                                                                                                                                  |
| Agent OpenAPI             | `cd apps/api && pnpm run openapi:export:agent` → `apps/docs/agent-openapi.json` (agent, provisioning, partners)                                                                                                   |
| OAuth / agent connect env | API: `LOMI_OAUTH_ISSUER`, `LOMI_DASHBOARD_BASE_URL`. MCP: `LOMI_OAUTH_ISSUER`, `LOMI_MCP_RESOURCE_URL`                                                                                                            |
| OAuth introspection       | Hosted MCP: set `INTERNAL_API_KEY` to the API internal key used at `POST /oauth/introspect/mcp`. `CRON_SECRET` is not accepted. Localhost can omit it (`/ready` still reports `oauth_introspection` as optional). |
| Deploy                    | `railway.json`. Hosted `/ready` fails when OAuth URLs are non-localhost and `INTERNAL_API_KEY` is missing.                                                                                                        |
| Tests                     | `pnpm test`                                                                                                                                                                                                       |
| Agent plugin              | `node apps/tools/agent-plugin/scripts/validate.mjs`                                                                                                                                                               |

Integrators should use `https://mcp.lomi.africa` or `npx @lomi./mcp`, not a self-deployed instance unless they work on lomi. engineering. The [agent plugin](https://github.com/lomiafrica/agent-plugin) is marketplace packaging only.

<DocsNextSteps>
  <DocsNextStep href="/resources/contributing/overview" hint="How to open a PR">
    How to contribute
  </DocsNextStep>

  <DocsNextStep href="/resources/contributing/writing-for-lomi-docs" hint="Voice and structure">
    Writing for lomi. docs
  </DocsNextStep>

  <DocsNextStep href="/resources/open-source" hint="What is public">
    Open source
  </DocsNextStep>
</DocsNextSteps>
