Announcing CIMD support for MCP Client registration
Learn more

Replit MCP or API? A Decision Framework for Tool Calling Interface

Nishant Choudhary
Tech Evangelist

TL;DR

  • Replit is not the usual MCP-versus-API case. The Replit MCP server and the Replit Admin API do not cover the same ground: MCP drives the app build lifecycle (create, update, publish, inspect apps through Replit Agent), while the Admin API is an Enterprise account-governance surface that is read-mostly.
  • If your agent needs to create, change, or ship a Replit App, the MCP server is the only officially documented path. There is no public REST endpoint that builds an app; the internal GraphQL API is undocumented and unsupported for third-party use.
  • Replit MCP authenticates with OAuth through protected-resource metadata discovery over Streamable HTTP. The Admin API uses account-admin bearer keys (prefixed rpl_) available only to Enterprise account admins.
  • Replit MCP operations run as asynchronous Agent jobs. Your agent starts a build, then polls get_publish_status; it does not get a synchronous REST response.
  • Both credential models still need a vault, rotation, and revocation you have to run yourself. Scalekit's Replit MCP connector handles the OAuth flow, token storage, and per-user scoping so that infrastructure is not yours to build.

Your agent needs to build on Replit. Replit ships an official remote MCP server that turns prompts into deployed apps, and it also documents an Admin API. It is tempting to treat these as the familiar "high-level MCP wrapper over a full REST API" pairing and pick accordingly. For Replit, that instinct is wrong. The two surfaces solve different problems, and only one of them can actually build an app. Here is how to choose, and what your production auth looks like either way.

What Replit MCP and the Replit API actually are

These are two distinct objects with almost no capability overlap. Read this section as a definition of scope, not a feature list, because the scopes are the whole story for Replit.

The Replit MCP server

Replit's official MCP server documentation describes a hosted, remote server that lets any compatible client create, find, inspect, update, and publish Replit Apps. The direct endpoint is https://replit-mcp.com/server/mcp, the transport is Streamable HTTP, and authentication is OAuth using protected-resource metadata discovery.

The build work is done by Replit Agent behind the tools. The server exposes eight tools: create_app_from_prompt, update_app_using_prompt, publish_app, get_publish_status, list_apps, search_apps, resolve_app_by_name, and ask_question. Access is scoped to apps the authenticated user can edit, including apps shared with them.

The Replit Admin API

Replit's only officially documented HTTP API is the Enterprise Admin API, currently in beta. It gives Enterprise account admins scope-based access to account analytics and administration, authenticated with a bearer key that begins with rpl_.

Its scopes are governance-oriented and mostly read: usage and cost, workspaces, members, and projects are read scopes; the only write scope is budgets. The Projects scope lists and searches projects across Team Workspaces; it cannot create, change, or publish them. This is a reporting and operations API, not a build API.

Why this comparison is different from most tools

For GitHub or Notion, the MCP server is a convenience layer over a large REST API, so the decision is about ergonomics and auth. Replit inverts that. The MCP server is the primary programmatic interface for building apps, and no documented REST API mirrors it. The choice is less "which path to the same capability" and more "which capability domain you are in." For a broader look at how MCP and APIs fundamentally differ, the structural contrast is worth understanding before picking a path.

Comparing them where it matters for agents

The comparison below fixes on the questions a production agent forces you to answer: what it can do, how it authenticates, and what you own when it runs. Keep the domain split in mind as you read each dimension.

What your agent can actually do

The capability gap is not a matter of a few missing endpoints; the two surfaces barely intersect. The table uses plain values rather than symbols so the scope boundaries stay unambiguous.

Capability
Replit MCP server
Replit Admin API
Create an app from a prompt
Yes (create_app_from_prompt)
No
Update an existing app from a prompt
Yes (update_app_using_prompt)
No
Publish or republish an app
Yes (publish_app)
No
Check publish status and public URL
Yes (get_publish_status)
No
List apps the user can edit
Yes (list_apps)
Read only, account-wide (Projects scope)
Search or resolve an app by name
Yes (search_apps, resolve_app_by_name)
Limited, read only
Ask Agent about an app without changing it
Yes (ask_question)
No
Read account usage and cost
No
Yes, read
List workspaces and members
No
Yes, read
Update account budgets
No
Yes (write:budgets)
Read or write files inside a repl
No
No
Manage secrets or environment variables
No
No

The last two rows matter for expectation-setting. Community Replit MCP servers expose file and secret operations; the official server does not. Build the mental model from the official surface, not from a community fork.

The build lifecycle lives only on MCP

Every create, update, and publish action is an asynchronous Agent job. Your agent starts the work, gets an acknowledgement, and then checks back; it does not receive a finished result inline.

That changes your control flow. A create_app_from_prompt call requires an appDescription and an app_stack (for example react_website, mobile_app, or data_visualization), and returns while Agent keeps building. To know when an app is live, the agent calls get_publish_status and reads the public URL. Design the loop around polling and idempotent retries, not around a single blocking request.

The auth path each one puts you on

The two paths do not just use different tokens; they hold credentials at different granularities. That distinction drives everything downstream in a multi-tenant product. Understanding credential ownership across agent tool-calling patterns is essential before committing to either path.

Dimension
Replit MCP server
Replit Admin API
Method
OAuth via protected-resource discovery
Bearer key (rpl_)
Who holds the credential
Each end user
Enterprise account admin
Granularity
Per user, scoped to editable apps
One account-level key
Consent flow
Browser OAuth per user
Key created in Developer settings

Replit is explicit that clients should not run a custom OAuth server for MCP: the server publishes the protected-resource metadata the client needs. For a multi-tenant B2B agent, that yields one connected account per user, which is the correct model for acting on each user's behalf. The Admin API points the other way: a single high-privilege key represents the whole account, which is convenient and centralizes risk in one credential.

What you own in production

MCP being hosted removes real work; it does not remove the parts that break at scale. Be precise about the line between what Replit runs and what you run.

On the MCP path, Replit owns the server, the tool schemas, and the Agent runtime. You own the per-user OAuth tokens: encrypted at rest, isolated per tenant, refreshed before expiry, revocable on offboarding. You also absorb tool-schema drift when Replit updates the server, since MCP tool contracts are not versioned like a REST API.

On the Admin API path, you own custody of a powerful account key and the discipline to keep it read-only where possible. It has no build capability, so it is never the answer for shipping apps, only for governing them.

When to use MCP, when to use the API

The split is unusually clean here because the surfaces do different jobs. Match the path to the job rather than to a preference for MCP or REST.

Use the Replit MCP server when:

  • Your agent creates, updates, or publishes Replit Apps on behalf of a user, which is the core Replit agent use case.
  • You are building an interactive or chat-driven builder that turns a user's prompt into a live app and returns a preview URL.
  • You want per-user consent and per-user scope, so the agent only touches apps that user can edit.
  • You are orchestrating a background or scheduled builder that kicks off Agent jobs and polls for completion.

Use the Replit Admin API when:

  • You are building internal reporting on account usage, cost, workspaces, members, or projects for an Enterprise account.
  • You need to read or update budgets programmatically as part of an operations workflow.
  • You are governing or auditing Replit usage, not building apps.
  • You accept that this path is Enterprise-only and administered with an account key, not per-user OAuth.

The credential problem that exists on both paths

Neither path hands you production-grade credential management; they hand you a credential and a problem. The problem simply takes a different shape on each path, and both shapes are infrastructure, not application logic.

What per-user OAuth leaves you owning

The MCP path gives you a token per user. In a multi-tenant agent that is N tokens to store, isolate per tenant, refresh before they expire, and revoke on offboarding.

None of that is provided by the OAuth flow itself. A "redirect and store the token" approach works in demos and does not survive production scale, because refresh races and silent expiry surface only once real users are connected continuously. The operational burden of secure token management for AI agents at scale is real and compounds quickly as user count grows.

Where a single account key concentrates blast radius

The Admin API path has the opposite failure mode. One rpl_ key can represent the entire account, so a leak is not a single user's exposure; it is the account's.

Least privilege is the mitigation: mint read-only keys where you can, and never let a write-capable key sit in agent runtime. The credential management burden is still yours; it just concentrates instead of multiplying.

Where Scalekit fits

Scalekit's Replit MCP connector handles the OAuth flow, encrypted token storage, and automatic refresh for the per-user path, and it keeps credentials out of your agent runtime. The MCP-versus-API decision then stops dictating your auth architecture, because the connected-account model is the same regardless of which Replit surface you call.

Building a Replit agent with Scalekit

This section shows the per-user MCP path end to end in Python, using the Claude SDK for the agent loop. The sequence is always the same: connect the user's account, retrieve the tools that account is authorized to call, then execute. One prerequisite matters more than any other: the connection name in your code must match the connection configured in the Scalekit dashboard exactly.

Connect the user's Replit account

A connected account is the record that holds a user's Replit credentials. You create or fetch it, and if it is not yet ACTIVE, you send the user through authorization once.

import os import anthropic from google.protobuf.json_format import MessageToDict from scalekit import ScalekitClient scalekit = ScalekitClient( os.environ["SCALEKIT_ENV_URL"], os.environ["SCALEKIT_CLIENT_ID"], os.environ["SCALEKIT_CLIENT_SECRET"], ) actions = scalekit.actions # Must match the connection name in AgentKit > Connections exactly. REPLIT_CONNECTION = os.environ["REPLIT_CONNECTION_NAME"] USER_ID = "user_123" # your system's stable identifier for the signed-in user response = actions.get_or_create_connected_account( connection_name=REPLIT_CONNECTION, identifier=USER_ID, ) connected_account = response.connected_account if connected_account.status != "ACTIVE": link = actions.get_authorization_link( connection_name=REPLIT_CONNECTION, identifier=USER_ID, ) print("Authorize Replit here:", link.link) input("Press Enter after authorizing Replit...") response = actions.get_or_create_connected_account( connection_name=REPLIT_CONNECTION, identifier=USER_ID, ) connected_account = response.connected_account if connected_account.status != "ACTIVE": raise RuntimeError("Replit account is not ACTIVE. Finish authorization and retry.")

In production, redirect the user to the authorization link and resume after the OAuth callback rather than blocking on input().

Retrieve the tools scoped to that user

list_scoped_tools returns the tools this specific connected account is authorized to call, not a flat catalog. This is the list you pass to the model, and it is why the agent sees only what the user's Replit account permits.

scoped_response, _ = actions.tools.list_scoped_tools( identifier=USER_ID, filter={"connection_names": [REPLIT_CONNECTION]}, page_size=100, # fetch beyond the default page so no tools are missed ) llm_tools = [ { "name": MessageToDict(t.tool).get("definition", {}).get("name"), "description": MessageToDict(t.tool).get("definition", {}).get("description"), "input_schema": MessageToDict(t.tool).get("definition", {}).get("input_schema", {}), } for t in scoped_response.tools ]

Run the agent loop with the Claude SDK

The loop sends the scoped tools to the model, executes each requested tool through Scalekit, and feeds results back until the model stops asking for tools. Because Replit builds are asynchronous, a realistic agent will call get_publish_status (via replitmcp_get_publish_status) on a later turn to read the live URL.

client = anthropic.Anthropic() messages = [{ "role": "user", "content": "Create a React website that tracks my weekly running mileage, then give me its public URL.", }] while True: response = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, tools=llm_tools, messages=messages, ) messages.append({"role": "assistant", "content": response.content}) if response.stop_reason != "tool_use": print(response.content) break tool_results = [] for block in response.content: if block.type == "tool_use": result = actions.execute_tool( tool_name=block.name, identifier=USER_ID, connection_name=REPLIT_CONNECTION, tool_input=block.input, ) tool_results.append({ "type": "tool_result", "tool_use_id": block.id, "content": str(result.data), }) messages.append({"role": "user", "content": tool_results})

Prefer a framework adapter

If you already build with LangChain, Scalekit returns native tool objects with no schema reshaping. The scoping and execution semantics are identical; the connection name still has to match the dashboard. For a deeper look at how LangChain tool calling works and where it stops, the tradeoffs are worth reviewing before picking your integration pattern.

from langchain.agents import create_agent from langchain_anthropic import ChatAnthropic tools = actions.langchain.get_tools( identifier=USER_ID, connection_names=[REPLIT_CONNECTION], # must match the dashboard connection name page_size=100, ) llm = ChatAnthropic(model="claude-sonnet-4-6") agent = create_agent( model=llm, tools=tools, system_prompt="You build and publish Replit apps for the signed-in user.", ) result = agent.invoke({ "messages": [{"role": "user", "content": "List my most recently updated Replit apps."}] })

Full setup, connection configuration, and other frameworks are covered in the Scalekit tool calling docs and the AgentKit quickstart.

Why the Scalekit path pays off for Replit agents

Because the MCP server is the only real build surface for Replit, the production question is not "MCP or API"; it is "how do I run the MCP path safely for many users." That is exactly where Scalekit's connected-account model earns its place.

Per-user scoped tools, not a shared key

Handing an agent every tool a connector exposes degrades tool selection and burns tokens before any work happens. list_scoped_tools returns only the tools the current user's connected account is authorized to call, so the surface shrinks to what is relevant for this user and this task. Scope is a function of identity: what the user cannot do, the agent cannot do. Surface reduction is the lever here; a bigger model on a bloated tool surface still underperforms a correctly scoped one. This aligns directly with the access control principles for multi-tenant AI agents that prevent privilege creep across tenants.

Downstream tool-calling auth logs

When an agent creates or publishes an app on a user's behalf, you need a record of what ran and under whose credentials. Scalekit records each tool execution against a connected account, giving you a per-user audit trail rather than an opaque Agent action. That is the difference between answering a security review and guessing. The reasoning behind treating this as first-class is covered in agent tool observability and the auth logs overview.

Virtual MCP for multi-tool, multi-tenant agents

Most real Replit agents do more than build; they read a spec from another tool, build the app, then post the URL somewhere. A Virtual MCP server gives that agent one scoped endpoint that declares exactly which tools and connections it can see, with per-user isolation handled by short-lived session tokens. One server definition serves all users; each run receives a token scoped to that user's connected accounts. There is no MCP server for you to deploy, host, or maintain.

Which one to build against

If your agent builds, updates, or ships Replit Apps for a user, build against the Replit MCP server; it is the only officially documented surface that can. If your agent reports on or governs an Enterprise account, use the Admin API, and keep it read-only wherever you can. The two are not substitutes, so most teams that build with Replit will live on the MCP path and reach for the Admin API only for governance. Either way, the credential lifecycle is the part that decides whether it survives production, and that is infrastructure worth solving once. This is why understanding how tool calling auth changes when you move from single-tenant to multi-tenant matters before you scale.

Get started

Pick the surface that matches your agent's job, then let Scalekit own the auth.

Start with the Scalekit Replit MCP connector docs, browse the full connectors directory and the connectors overview, and compare plans on the pricing page. If you are shaping a broader build-and-ship workflow, the DevOps assistant agent and auto release notes agent templates are useful starting points.

Building a Replit agent and want a second set of eyes? Join the Scalekit Slack community, or use the Talk to us page for immediate help.

No items found.
Agent
Auth Quickstart
On this page
Share this article
Agent
Auth Quickstart

Acquire enterprise customers with
zero upfront cost.

Every feature unlocked. No hidden fees.