---
title: "Build with Replit"
description: "Connect Inttegro MCP to Replit Agent and keep live commerce calls in the Replit server."
canonical: "https://studio.inttegro.com/ai-builders/replit"
format: inttegro-machine-docs/v1
language: "PHP"
sdk_version: "v12.0.0"
reader_profile: optional
reader_manifest: "https://studio.inttegro.com/machine/php/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 636
model_token_report: "https://studio.inttegro.com/machine/token-report.json"
preamble_questions: 5
preamble_source: "general"
recommended_mcp_tools: ["design_integration","check_integration_readiness","get_integration_guide"]
estimated_tokens: 2127
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Connect Inttegro MCP to Replit Agent and keep live commerce calls in the Replit server. This PHP representation uses the selected SDK's native names wherever Studio has a verified mapping.

### Five questions

#### Q1. When should the reader use Build with Replit?

Use this builder guide when that AI app builder is responsible for generating or extending the application.

#### Q2. What is authoritative on this page?

Use this page for orientation; follow its canonical SDK, guide, API, or MCP links for exact contracts.

#### Q3. What page-specific constraint matters most?

Keep API keys and live commerce calls in the builder’s protected server environment, never generated browser code.

#### Q4. Can Inttegro MCP materially help with this task?

Yes, when the reader has an authenticated MCP connection and the task needs live context, guided planning, or a supported operation. The strongest matches are `design_integration`, `check_integration_readiness`, `get_integration_guide`; their exact roles and boundaries are listed below.

#### Q5. How should the reader verify the answer and continue?

Inspect the generated server boundary, confirm secrets are not client-visible, run the documented end-to-end test, and verify authoritative commerce state. Continue with [Inttegro TypeScript SDK](https://studio.inttegro.com/machine/php/sdks/typescript.md) when those concerns enter scope.

### Recommended MCP assistance

Use these through an authenticated Inttegro MCP connection. This document remains the contract source.

- [`design_integration`](https://studio.inttegro.com/machine/php/inttegro-mcp/tools.md#design_integration) — read-only integration guidance. Elicits the integration goal, AI app builder, server runtime, SDK preference, and checkout approach, then returns a platform-aware build and test plan without accepting credentials.
- [`check_integration_readiness`](https://studio.inttegro.com/machine/php/inttegro-mcp/tools.md#check_integration_readiness) — read-only integration guidance. Audits platform secret storage, server-runtime compatibility, idempotency, errors, state verification, checkout returns, and messaging consent without receiving source code or credentials.
- [`get_integration_guide`](https://studio.inttegro.com/machine/php/inttegro-mcp/tools.md#get_integration_guide) — read-only integration guidance. Returns a focused implementation sequence and canonical Studio links for authentication, checkout, orders, catalog, messaging, idempotency, or testing.

## Document content

# Build with Replit

[Replit](https://replit.com/) can keep the agent, application server, and
deployment in one workspace. Connect Inttegro MCP for planning, then let server
code perform the live API calls with a credential stored in Replit Secrets.

[Open Replit](https://replit.com/) · [Read the Replit documentation](https://docs.replit.com/)

## Connect Inttegro MCP

1. Open **Integrations** in your Replit workspace and add a custom MCP server.
2. Enter `https://mcp.inttegro.com` as the server URL.
3. Complete OAuth if Replit offers it for the connection. Otherwise, add a
   dedicated Inttegro API key through Replit's protected connection settings as
   an `Authorization` header with the value `Bearer YOUR_KEY`.
4. Connect the server and confirm that Inttegro tools appear.

Do not paste the key into Replit Agent chat, source code, `.replit`, or a
committed configuration file. Follow Replit's official
[custom MCP setup](https://docs.replit.com/build/connect-via-mcp) for the current
connection controls.

## Paste this into Replit Agent

Turn on [Plan mode](https://docs.replit.com/learn/plan-vs-build-mode) before you
paste the brief. It tells Agent to inspect the workspace and propose the
integration before changing files. After you approve the plan, Agent can build
against the same context. Replit's [Agent workflow](https://docs.replit.com/learn/build-with-agent)
keeps the plan, implementation, review, and test loop in the project.

### Prompt

> **Copyable prompt:**
>
> **Business outcome**Build \[describe what the customer or operator should be able to do] for
> \[describe the business and its users]. Preserve the app's current visual
> language and existing architecture.**Plan in Replit before editing**
>
> 1. Inspect this workspace, its runtime, routes, data model, authentication,
>    and `replit.md`.
> 2. Use the connected Inttegro MCP. Call `design_integration` with the business
>    outcome above, then inspect only the operation references its plan returns.
> 3. Ask me one concise round of questions for decisions that cannot be learned
>    from the project or MCP. Do not ask me for an API key in chat.
> 4. Show me the smallest end-to-end plan: the customer journey, Replit server
>    routes, Inttegro operations, data we own locally, failure states, and a
>    definition of done. Wait for my approval before changing files.
>
> **Build after approval**
>
> - Keep `INTTEGRO_API_KEY` in Replit Secrets. Read it only in server code; never
>   expose it through client environment variables, browser bundles, source,
>   logs, or error messages.
> - If this workspace runs Node.js 24 or later, use the official Inttegro
>   TypeScript SDK and its native request objects. Otherwise call the documented
>   Inttegro operation from the Replit server by HTTPS. Do not downgrade the
>   runtime or invent an API shape.
> - Reuse the app's backend. Add Replit Database only if the app genuinely needs
>   local state such as user-to-Inttegro ID mapping; do not duplicate Inttegro
>   resources as a second source of truth.
> - Validate every browser request, use stable idempotency keys for mutations,
>   and look up the authoritative result after a redirect or uncertain write.
> - Record the approved Inttegro boundary and commands in `replit.md` so later
>   Agent sessions preserve it.
>
> **Finish in Replit**Run the project's checks and `check_integration_readiness`. With App Testing
> enabled, exercise the complete happy path and one safe failure path in
> Preview. Fix regressions, then report the routes changed, the single secret I
> must add, the test evidence, and any remaining step before Publish.

## What Replit should create

- a server route or server action that owns each Inttegro request;
- a browser interface that sends only the fields needed by that route;
- one reusable Inttegro client with bounded timeouts and safe error handling;
- stable idempotency keys for mutations; and
- a lookup step after redirects or ambiguous network results.

For TypeScript, use Node.js 24 or later and install the
[Inttegro TypeScript SDK](https://studio.inttegro.com/machine/php/sdks/typescript.md):

```bash
npm install @inttegro/inttegro-sdk
```

If the workspace cannot run a supported SDK runtime, call the Inttegro API by
HTTPS from the Replit server and follow the linked operation reference exactly.

## Start from existing code

If your application already lives on GitHub, use Replit's
[provider import](https://docs.replit.com/build/import-from-providers), then connect
Inttegro MCP in the imported workspace. Importing code does not import secrets;
create `INTTEGRO_API_KEY` again in Replit Secrets.

## Before publishing

Replit's [Secrets tool](https://docs.replit.com/core-concepts/project-editor/app-setup/secrets)
stores the key as an encrypted environment variable. Turn on
[App Testing](https://docs.replit.com/replitai/assistant/) for a supported web
runtime, inspect every route that reads the secret, and exercise the happy path
and a failed payment or invalid request with disposable Inttegro data.
