Skip to main content
This guide explains how DeployStack enforces team-level limits on MCP server installations. Understanding these limits is essential for new developers working on the backend, implementing features, or troubleshooting limit-related issues.

Overview

DeployStack implements three distinct limits to control MCP server installations at the team level:
  1. mcp_server_limit - Total MCP server installations
  2. non_http_mcp_limit - Catalog STDIO servers only
  3. github_mcp_limit - GitHub-deployed servers only
These limits work together to provide granular control over team resource usage while maintaining clear separation between curated catalog servers and self-deployed GitHub servers.

Limit Types Summary

1. Total Installations Limit (mcp_server_limit)

Definition

The maximum total number of MCP server installations a team can have, regardless of source or transport type.

Key Details

  • Default Value: 5
  • Database Field: teams.mcp_server_limit (integer)
  • What It Counts: ALL installations in mcpServerInstallations table for the team
  • Includes: Catalog STDIO, catalog HTTP/SSE, and GitHub-deployed servers

How to Calculate

Count all rows in the mcpServerInstallations table where team_id matches:

Where Enforced

  • GitHub Deployment: services/backend/src/routes/teams/deploy/deploy.ts:256-272
  • Installation Creation: services/backend/src/services/mcpInstallationService.ts

Example Scenario

2. Catalog STDIO Servers Limit (non_http_mcp_limit)

Definition

The maximum number of STDIO servers from the curated catalog that a team can install.

Key Details

  • Default Value: 1
  • Database Field: teams.non_http_mcp_limit (integer)
  • What It Counts: STDIO servers where source IN ('official_registry', 'manual')
  • Purpose: Limit resource-intensive STDIO processes from the global catalog
  • Excludes: HTTP/SSE servers, GitHub-deployed servers

How to Calculate

  1. Get all installations for the team
  2. Join to mcpServers table
  3. Filter by transport_type = 'stdio'
  4. Filter by source IN ('official_registry', 'manual')
  5. Count the results

Where Enforced

  • Installation Creation: services/backend/src/services/mcpInstallationService.ts:551-607
  • Not Checked In: GitHub deployment route (GitHub servers have their own limit)

Example Scenario

3. GitHub Deployments Limit (github_mcp_limit)

Definition

The maximum number of self-deployed GitHub MCP servers a team can have.

Key Details

  • Default Value: 1
  • Database Field: teams.github_mcp_limit (integer)
  • What It Counts: Servers where source = 'github'
  • Purpose: Limit self-serve deployments
  • Transport Type: Always STDIO (HTTP/SSE deployments not supported)
  • Excludes: Catalog servers (manual and official_registry)

How to Calculate

  1. Get all installations for the team
  2. Join to mcpServers table
  3. Filter by source = 'github'
  4. Count the results

Where Enforced

  • GitHub Deployment: services/backend/src/routes/teams/deploy/deploy.ts:289-297
  • Not Checked In: Installation creation route (can’t install GitHub servers from catalog)

Example Scenario

Why Limits Don’t Overlap

The three limits are independent because the source field creates mutually exclusive categories:

Source Field Values

Key Principle

  • Catalog servers (non_http_mcp_limit) have source IN ('official_registry', 'manual')
  • GitHub servers (github_mcp_limit) have source = 'github'
  • These are mutually exclusive - a server cannot have multiple source values

Limit Validation Logic

When updating team limits, DeployStack enforces a cross-field validation to ensure logical consistency:

Validation Rule

Why This Makes Sense

  1. A team could install non_http_mcp_limit catalog STDIO servers
  2. A team could deploy github_mcp_limit GitHub servers
  3. These don’t overlap (different source values)
  4. Total installations = non_http_mcp_limit + github_mcp_limit
  5. Therefore: mcp_server_limit >= non_http_mcp_limit + github_mcp_limit

Example

Complete Server Type Matrix

Database Schema Reference

Teams Table

File: services/backend/src/db/schema-tables/teams.ts

MCP Server Installations Table

File: services/backend/src/db/schema-tables/mcp-installations.ts

MCP Servers Table

File: services/backend/src/db/schema-tables/mcp-catalog.ts

For New Developers

Common Questions

Q: How do I calculate the total number of MCP servers for a team? A: Query the mcpServerInstallations table and count rows where team_id matches:

Q: How do I differentiate between catalog and GitHub servers? A: Check the source field in the mcpServers table:
  • 'official_registry' or 'manual' = Catalog server (curated by global admin)
  • 'github' = GitHub deployment (self-deployed by team)

Q: How do I count STDIO servers for a team? A: Join mcpServerInstallations to mcpServers and count where transport_type = 'stdio':

Q: Where are the limits enforced in the codebase? A:
  • Total installations: services/backend/src/routes/teams/deploy/deploy.ts:256-272
  • Catalog STDIO: services/backend/src/services/mcpInstallationService.ts:551-607
  • GitHub deployments: services/backend/src/routes/teams/deploy/deploy.ts:289-297

Q: Can GitHub deployments use HTTP or SSE transport? A: No. GitHub deployments always use transport_type = 'stdio'. HTTP and SSE transports are only supported for catalog servers with remote endpoints.
Q: What happens when a team reaches a limit? A: The backend throws an error with a descriptive message:
The frontend displays this error to the user, preventing the action from completing.

Code Examples

Calculate Total Installations

Calculate Catalog STDIO Servers

Calculate GitHub Deployments

Check All Limits Before Installation


This guide provides the technical foundation for understanding and working with team MCP server limits in DeployStack. For questions or clarifications, refer to the source code files mentioned throughout this document or reach out to the team via Discord.