Overview

MCPs & connectors

What is MCP?

The Model Context Protocol (MCP) is an open standard that lets AI agents discover and use external tools, data sources, and services. Instead of hard-coding integrations, agents speak MCP to dynamically fetch schemas, call functions, and retrieve context from any MCP-compatible server.

In Emergent, the build agent uses MCP connectors to pull real-time data (APIs, databases, file systems) and invoke external actions during code generation, testing, and published app.

Note

MCP servers expose tools (callable functions), resources (readable data), and prompts (reusable templates). Emergent's agent discovers these capabilities automatically when you register a server.

Using an MCP connector

An MCP connector bridges Emergent's build agent to an external service. When you register a connector, the agent can:

  • Read resources - fetch schemas, documentation, or live data (e.g., rows from a Notion database, files from Google Drive).
  • Call tools - trigger actions like sending a Slack message, creating a Jira ticket, or querying a REST API.
  • Inject context - use prompts defined by the server to guide code generation.

Common use cases:

Connector typeExampleWhat it enables
DatabasePostgreSQL MCPRead schemas, run queries, validate migrations
SaaS APIStripe MCPFetch product catalog, create checkout sessions
File systemLocal filesystem MCPAccess project templates, reference documents
CommunicationSlack MCPSend notifications, read channel history

Tip

Third-party MCP servers are often published as npm packages or Docker images. Check modelcontextprotocol.io or GitHub for community-maintained servers.

Emergent as an MCP server

Emergent itself exposes an MCP interface on port

8013
(local) or via a public endpoint when published. This lets you use Emergent as a tool from other AI clients - Claude Desktop, Cursor, or custom agents.

Available tools (example):

  • emergent.create_app
    - start a new app from a prompt.
  • emergent.deploy
    - trigger published app of a workspace.
  • emergent.get_logs
    - retrieve build or runtime logs.

To connect from Claude Desktop or another MCP client, configure the server URL and any required API key in the client's MCP settings. Emergent will return its tool schemas, and the client can invoke them like any other MCP tool.

Info

Self-hosting users can customize the exposed tools by editing the MCP server configuration in

config/mcp.json
(see installation docs for details).

Registering a custom MCP server

To give the build agent access to a custom or third-party MCP server:

1

Prepare the server endpoint

Your MCP server must listen on a reachable address (localhost for local dev, or a public HTTPS URL for cloud). Ensure it implements the MCP specification (

initialize
,
tools/list
,
tools/call
, etc.).

2

Add the server to your workspace config

In the Emergent workspace, open Account Settings → Manage Agents → MCP tab and add the server using the JSON

mcpServers
config. Provide:

  • Name - a unique identifier (e.g.,
    my-postgres-db
    ).
  • Endpoint - the base URL or
    stdio
    command (e.g.,
    http://localhost:8012
    or
    npx -y @modelcontextprotocol/server-postgres
    ).
  • Auth (if required) - API key, bearer token, or environment variable reference.
  • Visibility -
    private
    (workspace-only). Note: public MCP servers are admin-created only and cannot be set by individual users.
3

Save and test connection

Click Verify and Save. Emergent will call the server's

initialize
method and cache the list of tools and resources. Check the Connection Status indicator - green means the agent can reach the server.

4

Use discovered tools in chat

Registered tools appear in the agent's tool palette. When you describe a task that matches a tool's schema, the agent will propose calling it. You can also reference the server explicitly:

"Use the

my-postgres-db
connector to read the users table schema and generate a GraphQL API."

Warning

Port 8012 is the default for stdio-launched MCP servers in Emergent's local environment. If your server binds to a different port, specify the full URL in the endpoint field.

Public vs. private servers

  • Private - only the current workspace can use this server. Config stored in workspace metadata.
  • Public - available across the platform; public MCP servers are admin-created only and cannot be configured by individual users.

Use private for project-specific databases or credentials; use public for shared services (company Slack, internal APIs).

Tool discovery and caching

Emergent caches tool schemas for 5 minutes after the first successful connection. If you update the server's tools (add a new function, change parameters), wait for the cache to expire or start a new job to ensure the agent sees the latest tool list.

Tip

For rapidly evolving servers, enable Auto-refresh on job start in the server settings. The agent will re-discover tools at the beginning of each build job, ensuring it always sees the latest API.


Next steps

Was this page helpful?

Related pages