A package or a URL

Both carry the same protocol. A package people install runs over stdio on their machine; a URL such as GitLab's /mcp runs on your infrastructure over Streamable HTTP. The choice is about where code runs and who holds the keys.

By the end of this lesson you can

  • compare a local package and a remote URL on seven dimensions;
  • say which one an enterprise should default to, and when the other is the right call;
  • describe the thin local proxy and the one-factory pattern.

Copies everywhere, or one place

Where the code runs

Package (stdio) URL (Streamable HTTP) Laptop 1 Laptop 2 Laptop 3 server v1.0server v1.0server v1.0 server v1.4server v1.2server v1.0 ๐Ÿ”‘ token in env๐Ÿ”‘ token in env๐Ÿ”‘ token in env runs with each user's permissions;reaches their files, IDE, localhost /mcp Claude IDE Agent v1.0 v2.0 for all OAuth ยท auditrevoke in one place stdio-only host โ†’ thin local proxyโ†’ forwards to the URL
  1. As a package, a copy of your server runs on every user's laptop.
  2. You release v1.4. Some users upgrade, some do not: versions drift, and you support all of them.
  3. Each copy holds its own secret in an env var or config file, and runs with that user's permissions. In return it can reach their files, their IDE, localhost and a local browser.
  4. As a URL, one deployment serves every host that dials in.
  5. Deploy v2.0 once and everyone has it.
  6. Each user signs in with OAuth; tokens are short-lived, every call is audited, and access is revoked in one place.
  7. For a host that only speaks stdio, a thin local proxy can forward to the remote server.

Side by side

Local package (stdio)Remote URL (HTTP)
Code runsOn every user's laptopOn your servers
UpdatesEach user upgrades; versions driftDeploy once; everyone has it
CredentialsSecrets in env or config files on each machineOAuth per user, short-lived tokens, central revocation
Audit and kill switchHardOne place
Supply chainYour code runs with each user's permissionsYour code runs with your service's permissions
Can reachLocal files, the IDE, localhost, a local browserOnly what your network can reach
Latency and offlineIn-process, works offlineNetwork round trip

Recommendation

For an enterprise, default to the URL. Anything touching company data or a SaaS API belongs behind central auth, audit and rollout. Ship a stdio package only when the server must reach the user's own machine. For hosts that only speak stdio, a thin local proxy can forward to the remote server. With the SDK, both entry points come from one server factory (lesson 16).

Where should this server run?

For each server, choose a local package or a remote URL.

  • Reads and edits files in the project folder the user has open. It must reach the user's own disk, so it runs where they are.
  • Lets a 300-person sales team query the company CRM. Company data, many users: central OAuth, audit and one deployment.
  • Drives the user's local browser for end-to-end tests. A local browser is only reachable from the user's machine.
  • Creates Jira tickets with each user's own permissions, with an audit log. Per-user authorization and audit are what the remote, OAuth-protected server gives you.
  • Your SaaS product's server, which customers add to Claude. Deploy once, update for everyone, revoke centrally; nothing of yours runs on customers' laptops.
  • Talks to a database running on localhost during development. localhost is the developer's machine; a remote server cannot reach it.

Quick check

Why is a stdio package harder to govern in a company?

  • stdio is slower than HTTP
  • Every laptop holds its own secret and its own version, with no central audit or kill switch
  • stdio cannot carry tools
Same protocol, different operations: secrets on each machine, drifting versions, and code running with each user's permissions.

Your remote server must also work in a host that only supports stdio. What do you ship?

  • A full second implementation that runs locally
  • A thin local proxy that forwards stdio to the remote URL
  • Nothing: such hosts cannot use remote servers at all
The proxy keeps the logic, the data and the credentials central; it only translates the transport.

Recap