# Use BuildBase in Replit

Add BuildBase's MCP server in Replit's MCP Servers pane, sign in as yourself, and let Replit Agent read and set up your organization.

This page is part of **BuildBase in your AI tools**: it connects Replit to BuildBase's own MCP server so that, while Replit Agent builds your app, it can read and set up your BuildBase organization. Replit signs in as you and never sees your organization's secrets.

> **Note:**
  Want your own app to be agent-ready? See [Connect an agent to your
  app](/agents/connect-an-agent), in **Agent-ready apps**.

## What it is for

Connected to BuildBase, Replit Agent can look things up and set your organization up while it writes the code:

- `get_env_template` gives the environment variables your app needs, with your organization's id filled in and every secret left for you.
- `search_docs` and `fetch_doc` read the BuildBase docs, so the agent uses the SDK the way it is documented.
- With your approval of the scope, it can create a feature flag or a form, or plan a blueprint for the organization the app needs.

The app itself uses @buildbase/sdk with its own keys, as the [Replit guides](/ai-builders/replit-import) set it up.

## What you need

- A Replit account. Replit's docs name no plan for MCP servers.
- A BuildBase console account, and an organization whose **AI agents** setting is not **Off** ([choose what agents may do](/console/ai-agents#choose-what-agents-may-do)).

## Add the server

1. Open the **MCP Servers** pane and choose **+ Add MCP server**.
2. Enter a display name, such as `BuildBase`, and the URL:

   ```text
   https://api.console.buildbase.app/mcp
   ```

3. Leave the custom headers under **Advanced settings** empty, and choose **Test & save**.

## Sign in

**Test & save** walks you through BuildBase's sign-in. Sign in with your console account and your usual second step, then approve Replit on the consent screen. It asks for `console:read` and `console:write` to start; an export or a delete asks again for just that scope ([what an agent asks for](/console/ai-agents#what-an-agent-asks-for-at-sign-in)).

## What you see when you connect

Once you have signed in, BuildBase shows the consent screen in your browser. It names the tool, lists the scopes it asks for and the server the access is for, and changes nothing until you choose **Allow access**. Here it is for a tool that registered itself:

![BuildBase's consent screen for a tool that registered itself, here Example Agent: a warning that the app gave itself its name and nobody has checked it, what it may do as you, console:read and offline_access, the access to use at https://api.console.buildbase.app/mcp, and Allow access and Deny ringed](/images/console/ai-agents/hosted-consent.webp)

## Use it

Ask, for example:

- "Add BuildBase sign-in to this React and Express app. Get the environment variables for my Acme organization from BuildBase."
- "Read the BuildBase docs on teams and add workspace switching to the header."
- "Create a BuildBase feature flag `beta-reports`, off, and hide the reports page behind it."

## What differs in Replit

- **Every project.** A server you add is available in all your projects, not one Repl.
- **Confirmations.** Tools that need it ask for confirmation before they run. Read each one before you accept it.
- **Approvals of a change.** When BuildBase needs your approval for a change, the agent states it and confirms it with a one-time code unless Replit can ask you itself ([what stays with you](/console/ai-agents#what-stays-with-you)).
- **Secrets stay out of the chat.** Set your sign-in client's secret in the app's environment yourself, never in the prompt.

## If something goes wrong

| What you see                                        | Why                                                                     | What to do                                                          |
| --------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------- |
| **Test & save** fails                               | The URL is wrong, or the sign-in was not finished                       | Check the URL ends in `/mcp` and run **Test & save** again          |
| Replit acts as an API key, not as you               | A key was set as a custom header                                        | Remove the header and sign in again                                 |
| Replit says the organization does not let agents in | Its **AI agents** setting is **Off**, or your agent is blocked          | An owner or admin changes it under **Security**, **AI agents**      |
| Every change is refused                             | The organization is **Read only**, or you did not grant `console:write` | An owner or admin sets **Read and change**; approve `console:write` |

To disconnect, remove the server in Replit and [disconnect the agent](/console/ai-agents#disconnect-an-agent) in BuildBase.

## Related

- [BuildBase in your AI tools](/console/ai-agents): the server, its tools, and what stays with you.
- [Use BuildBase in Bolt](/console/ai-agents/bolt) and [Use BuildBase in Lovable](/console/ai-agents/lovable).
- [Add BuildBase to Replit as a skill](/ai-builders/replit-import) and [add paid plans to a Replit app](/ai-builders/replit-paid-plans): the paste-prompt guides.
- Replit's own guide: [connect via MCP](https://docs.replit.com/build/connect-via-mcp).

## Frequently asked questions

### Where do I add BuildBase in Replit?

In the MCP Servers pane, with Add MCP server. Enter a name and BuildBase's server URL, then Test & save, which runs the sign-in.

### Is BuildBase available in every Repl?

Yes. Replit's docs say the tools of a server you add are available across all your projects.

### Should I add an API key under Advanced settings?

Not for yourself. Custom headers are there for keys, but with an organization API key Replit acts as that key. Leave them empty and sign in as yourself.
