Skip to main content
The @tangogroup/forge-mcp package is a Model Context Protocol (MCP) server that wraps the Forge Platform API. It exposes Forge capabilities as tools (for actions and queries) and resources (for reading state), letting AI agents interact with the platform through their native tool-use interface.

🤔 What is MCP?

The Model Context Protocol is an open standard for connecting AI agents to external tools and data sources. An MCP server declares the tools and resources it offers. An MCP client (typically an AI agent runtime) discovers those capabilities and invokes them as needed. The protocol handles parameter validation, error formatting, and result delivery. For Forge, this means an AI agent can list agents, query events, check health, deploy agents, and read budget status — all through the same interface it uses for any other tool.

📦 Installation

npm install @tangogroup/forge-mcp

⚙️ Configuration

The MCP server requires two environment variables:
VariableRequiredDescription
FORGE_API_URLYesBase URL of your Forge deployment (e.g., https://forge.gloo.ai)
FORGE_API_KEYYesAPI key with scopes matching the tools you want to expose

Claude Desktop

Add the server to your Claude Desktop configuration file (claude_desktop_config.json):
{
  "mcpServers": {
    "forge": {
      "command": "npx",
      "args": ["@tangogroup/forge-mcp"],
      "env": {
        "FORGE_API_URL": "https://forge.gloo.ai",
        "FORGE_API_KEY": "forge_sk_abc123..."
      }
    }
  }
}

Claude Code

Add the server to your project’s .claude/settings.json or user-level ~/.claude/settings.json:
{
  "mcpServers": {
    "forge": {
      "command": "npx",
      "args": ["@tangogroup/forge-mcp"],
      "env": {
        "FORGE_API_URL": "https://forge.gloo.ai",
        "FORGE_API_KEY": "forge_sk_abc123..."
      }
    }
  }
}

Direct Execution

Run the MCP server directly via the CLI binary:
export FORGE_API_URL="https://forge.gloo.ai"
export FORGE_API_KEY="forge_sk_abc123..."

npx @tangogroup/forge-mcp
The server communicates over stdio using the MCP standard transport.
The API key you provide determines which tools are functional. If the key lacks agents:write scope, deployment tools will return authorization errors. Grant the minimum scopes required for your use case.

💻 Programmatic Usage

You can also create the MCP server programmatically in your own application:
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { ForgePlatformClient, createForgeServer } from "@tangogroup/forge-mcp";

const client = new ForgePlatformClient(
  "https://forge.gloo.ai",
  process.env.FORGE_API_KEY!,
);

const server = createForgeServer(client);
const transport = new StdioServerTransport();

await server.connect(transport);

🔧 Tools

Tools are invocable actions that agents call to query or mutate Forge state. The server registers 17 tools across 9 domains.

Agents

ToolDescriptionParameters
forge_list_agentsList all agents registered on the platformgatewayId?: filter by gateway
forge_get_agentGet detailed information about a specific agentagentId: the agent’s document ID
forge_transition_agent_stageTransition an agent’s lifecycle stage (draft, active, suspended, archived)agentId, to: target stage, reason?
forge_get_agent_lifecycle_historyGet lifecycle transition history for an agentagentId, limit?: max transitions (1-100)

Deployment

ToolDescriptionParameters
forge_deploy_agentDeploy an agent to a specific gatewayagentId, gatewayId, overrides?: config overrides
forge_undeploy_agentRemove an agent deployment from a gatewayagentId, gatewayId

Runs

ToolDescriptionParameters
forge_list_runsList workflow runs with optional filtersrunType?, limit?: 1-100 (default 25)
forge_get_runGet run detail including all stepsrunId

Health

ToolDescriptionParameters
forge_get_healthGet platform and gateway health status(none)

Events

ToolDescriptionParameters
forge_query_eventsQuery events with compound filters and paginationsince (ISO 8601 or Unix ms), until?, category?, source?, severity?, agentId?, gatewayId?, runId?, interfaceId?, resourceType?, resourceId?, limit?, cursor?
forge_get_event_summaryGet aggregated event counts by category, severity, and sourcesince, until?, agentId?, gatewayId?, interfaceId?

Models

ToolDescriptionParameters
forge_list_modelsList all models in the model catalog(none)
forge_get_modelGet details for a specific modelmodelId (e.g., anthropic/claude-sonnet-4-20250514)

Skills

ToolDescriptionParameters
forge_list_skillsList all skills in the skill catalog(none)
forge_get_skillGet details for a specific skillskillId

Workflows

ToolDescriptionParameters
forge_list_workflowsList all workflow definitions(none)
forge_get_workflowGet details for a specific workflowworkflowId: ID or name

Budgets

ToolDescriptionParameters
forge_get_budget_statusGet budget usage and remaining amounts across all scopes(none)

📦 Resources

Resources are read-only data endpoints that agents can access to understand current platform state. They are simpler than tools — no parameters, just a URI that returns JSON.
ResourceURIDescription
forge-agentsforge://agentsAll registered agents
forge-agentforge://agents/{agentId}A specific agent by ID (parameterized)
forge-healthforge://healthCurrent platform health status
forge-events-recentforge://events/recentEvents from the last hour (up to 100)
forge-events-summaryforge://events/summaryEvent summary for the last 24 hours
forge-modelsforge://modelsAll models in the catalog
forge-skillsforge://skillsAll skills in the catalog
forge-budgetsforge://budgetsBudget status across all scopes
Resources are useful for giving agents background context about the platform state without requiring explicit tool calls. MCP clients can preload resources when starting a conversation.

🤖 How Agents Use the MCP Server

When an MCP client connects to the Forge server, it receives the full list of available tools and resources. The agent then invokes them as needed during its reasoning loop.

Example: Agent Checks Health Before Deploying

An agent tasked with deploying a new agent version might:
1

Check platform health

The agent calls forge_get_health to verify all gateways are operational before attempting a deployment.
2

Review the agent definition

The agent calls forge_get_agent with the target agent ID to confirm the current lifecycle stage and configuration.
3

Check budget status

The agent calls forge_get_budget_status to ensure there is remaining budget for the deployment.
4

Deploy the agent

The agent calls forge_deploy_agent with the agent ID, target gateway, and any configuration overrides.
5

Verify deployment

The agent calls forge_list_agents filtered by gateway to confirm the deployment is live.

Example: Agent Investigates an Error

An agent tasked with diagnosing a workflow failure might:
1

Query recent errors

The agent calls forge_query_events with severity: ["error", "critical"] and a recent since timestamp.
2

Get the failed run

The agent calls forge_get_run with the run ID from the error event to inspect step-level detail.
3

Check the agent's state

The agent calls forge_get_agent and forge_get_agent_lifecycle_history to determine if the agent was recently transitioned or has known issues.
4

Get event summary

The agent calls forge_get_event_summary to understand if this is an isolated failure or part of a broader pattern.

🔑 Required Scopes by Tool

The API key provided to the MCP server must have the scopes required by the tools you want to use.
ToolsRequired Scope
forge_list_agents, forge_get_agent, forge_get_agent_lifecycle_historyagents:read
forge_transition_agent_stage, forge_deploy_agent, forge_undeploy_agentagents:write
forge_list_runs, forge_get_runruns:read
forge_query_events, forge_get_event_summaryevents:read
forge_get_healthagents:read
forge_list_models, forge_get_modelmodels:read
forge_list_skills, forge_get_skillskills:read
forge_list_workflows, forge_get_workflowworkflows:read
forge_get_budget_statusbudgets:read
For a read-only agent that monitors platform state, use a key with: agents:read, runs:read, events:read, models:read, skills:read, workflows:read, budgets:read.

❌ Error Handling

When a tool call fails (invalid parameters, authorization errors, network issues), the MCP server returns the error as a text content block with isError: true. The error message includes the HTTP status, error code, and description from the Platform API.
Forge API error (403 forbidden): API key lacks required scope 'agents:write'
Agents receive this as a tool-use error and can adjust their approach accordingly — for example, by informing the user that they lack permission to perform the requested action.

🚀 Next Steps

TypeScript SDK

Use the typed client directly when building backend services.

API Reference

Full endpoint documentation, authentication, and response format.