Skip to content

Local Development

Connected projects expose two targets for running them on your machine: serve and dev. The difference is one of scope — how much of your application runs locally versus pointing at deployed AWS infrastructure.

Consider a workspace with the following connections: a website that calls a tRPC api, and also calls an agent which in turn calls an mcp server.

The serve target runs only the targeted project locally. Every other project it connects to is expected to be deployed, and is reached at its real AWS URL.

Terminal window
pnpm nx serve website

Because the targeted project talks to deployed resources, it needs to know where they are. For a website this is provided by its runtime-config.json (see Local Runtime Config), which you load from a deployed application. For server-side projects (APIs and agents) that read Runtime Configuration, set the RUNTIME_CONFIG_APP_ID environment variable to point at your deployed AppConfig application.

Diagram

Use serve when you want to iterate on a single project against the “real”, deployed versions of everything it depends on.

The dev target runs the targeted project and every project connected to it transitively, all on your machine. The connection generator wires this up automatically — running dev on the website also starts local servers for the api, the agent, and the mcp server it reaches through the agent.

Terminal window
pnpm nx dev website

When run this way, the website’s runtime-config.json is automatically overridden (via Vite’s MODE, set to local-dev) so that it points at your locally running servers instead of deployed URLs.

Diagram

Every project runs locally, so there are no deployed dependencies.

Use dev when you are working across several connected projects at once and want to iterate quickly without deploying your infrastructure.

Some project types can hold multiple components in a single project (for example a TypeScript or Python project containing several agents and MCP servers). For these:

  • The project-level dev target starts all of the project’s components together. Each component is added to dev as it is generated:
Terminal window
pnpm nx dev my-project
  • Each component also exposes a <component-name>-dev target, so you can run a single component on its own:
Terminal window
pnpm nx my-component-dev my-project

For more detail on each project type’s local development server, see the relevant guide — for example the React Website guide.