Using Postman MCP Server with Google Antigravity
Managing API collections and generating code from specifications shouldn’t require constant context-switching between your IDE and Postman. When you’re deep in a coding session, breaking flow to manually export collections, copy endpoints, or set up test scaffolding kills momentum.
In this post, I’ll walk through how to connect the Postman MCP Server to Google Antigravity, then demonstrate two workflows I use regularly: generating a React app from an existing Postman collection, and creating a fully-tested collection from existing API code.
What You’ll Need
Before we start:
Google Antigravity installed (Mac, Windows, or Linux)
A Postman account (free tier works)
A Postman API key — navigate to your account settings and select API Keys from the left menu, then click Generate API Key
Note for EU-based developers: If your Postman account is hosted on the EU data center, you’ll need to add
POSTMAN_API_HOSTto your environment configuration. Set it tohttps://api.eu.postman.com
in your MCP server config or shell profile.
Node.js v18+ (for the MCP server)
An existing Postman workspace with at least one collection (I’ll use “Quintons Playzone” with the Fleet Logistics API)
Understanding Postman MCP Server Modes
The Postman MCP Server comes in three flavors, and picking the right one matters:
ModeToolsBest ForMinimal37Basic workspace/collection management, running collectionsFull100+Enterprise features, advanced collaborationCodeCode-focusedClient code generation from API specs
For this tutorial, we’re using the Minimal server configuration. Many IDEs, including Antigravity, have limits on the number of MCP tools they support—Antigravity recommends keeping your total under 50 for optimal performance. The Full mode exposes 100+ tools, which can cause issues with tool discovery and selection in these environments.
The --code flag is a great option if you’re primarily generating code based on Collections but don’t need write access back to Postman. It focuses the toolset on code generation without the overhead of collection management tools.
Installing the Postman MCP Server in Antigravity
Antigravity makes MCP server setup straightforward through its built-in MCP Store, but for custom configurations like ours, we’ll edit the config directly.
Step 1: Open MCP Configuration
In Antigravity, click the ... (more options) menu in the Agent pane
Select MCP Servers
Click Manage MCP Servers at the top
Select View raw config
This opens your mcp_config.json file.
Step 2: Add the Postman MCP Server
Add the following configuration to your mcpServers object:
{
"mcpServers": {
"postman": {
"command": "npx",
"args": ["@postman/postman-mcp-server@latest", "--minimal"],
"env": {
"POSTMAN_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Replace YOUR_API_KEY_HERE with your actual Postman API key.
Step 3: Verify the Connection
Save the config file, then return to Manage MCP Servers and refresh. You should see “postman” listed with its available tools.
Worth noting: If you’re security-conscious about storing API keys in config files (you should be), you can export POSTMAN_API_KEY in your shell profile (~/.zshrc or ~/.bashrc) and reference it as ${POSTMAN_API_KEY} in the config.
Workflow 1: From Collection to Code
Let’s start with a common scenario—you have an existing API collection in Postman and want to generate a React app that consumes it.
The Setup
I have a workspace called “Quintons Playzone” with a collection for the Fleet Logistics API—a FastAPI backend that manages vehicles, drivers, routes, and deliveries. The collection already has all the endpoints documented. Now I want a React frontend.
Step 1: List Your Workspaces
In Antigravity’s Agent mode, start with:
List my Postman workspaces
The agent will call listWorkspaces and return something like:
Found 5 workspaces:
- Quintons Playzone (personal)
- Team API Projects (team)
- Public Examples (public)
...
Step 2: Select Your Workspace
Select the workspace "Quintons Playzone"
This sets the context for subsequent operations. The agent now knows where to look for collections.
Step 3: List Collections
List the collections in this workspace
You’ll see your collections:
Collections in "Quintons Playzone":
- Fleet Logistics API
- Weather Service
- Auth Examples
...
Step 4: Run the Collection to Verify Tests
Before generating code, let’s verify the collection’s tests pass. Ask the agent:
Run the "Fleet Logistics API" collection and show me the test results
The agent will execute the collection using the runCollection tool, which runs all requests and their associated test scripts. You’ll see output like:
Collection run completed:
- Total requests: 56
- Passed tests: 47
- Failed tests: 9
- Average response time: 125ms
This step is crucial—it confirms your API is responding correctly and the collection’s test scripts are valid before you generate code that depends on those endpoints.
Step 5: Generate a React App from the Collection
Here’s where it gets interesting. Ask the agent:
Select the "Fleet Logistics API" collection and create a React application
that consumes this API. Generate service files for each endpoint category
and create example components that demonstrate CRUD operations for vehicles
and drivers.
The agent will:
Fetch the collection structure
Analyze the endpoints, request/response schemas
Generate TypeScript service files with proper typing
Create React components with hooks for data fetching
Here’s what the generated vehicle service might look like:
// src/services/vehicleService.ts
import { apiClient } from './apiClient';
import { Vehicle, VehicleCreate, VehicleUpdate } from '../types/fleet';
const BASE_PATH = '/vehicles';
export const vehicleService = {
async list(params?: { status?: string; type?: string; organizationId?: string }) {
const response = await apiClient.get<Vehicle[]>(BASE_PATH, { params });
return response.data;
},
async getById(id: string) {
const response = await apiClient.get<Vehicle>(`${BASE_PATH}/${id}`);
return response.data;
},
async create(vehicle: VehicleCreate) {
const response = await apiClient.post<Vehicle>(BASE_PATH, vehicle);
return response.data;
},
async update(id: string, vehicle: VehicleUpdate) {
const response = await apiClient.put<Vehicle>(`${BASE_PATH}/${id}`, vehicle);
return response.data;
},
async delete(id: string) {
await apiClient.delete(`${BASE_PATH}/${id}`);
}
};
And a corresponding component:
// src/components/VehicleList.tsx
import { useState, useEffect } from 'react';
import { vehicleService } from '../services/vehicleService';
import { Vehicle } from '../types/fleet';
export function VehicleList() {
const [vehicles, setVehicles] = useState<Vehicle[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
loadVehicles();
}, []);
async function loadVehicles() {
try {
setLoading(true);
const data = await vehicleService.list();
setVehicles(data);
} catch (err) {
setError('Failed to load vehicles');
console.error(err);
} finally {
setLoading(false);
}
}
if (loading) return <div>Loading vehicles...</div>;
if (error) return <div className="error">{error}</div>;
return (
<div className="vehicle-list">
<h2>Fleet Vehicles ({vehicles.length})</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>Type</th>
<th>Status</th>
<th>License Plate</th>
</tr>
</thead>
<tbody>
{vehicles.map(vehicle => (
<tr key={vehicle.id}>
<td>{vehicle.id}</td>
<td>{vehicle.type}</td>
<td>{vehicle.status}</td>
<td>{vehicle.licensePlate}</td>
</tr>
))}
</tbody>
</table>
</div>
);
}
The key here is that the generated code matches your actual API structure—types align with your Postman schemas, endpoints match your collection, and the component patterns follow React best practices.

Workflow 2: From Code to Collection
Now let’s flip it. You have existing API code and want to create a Postman collection from it. To make it easy, we will use the Fleet API app we just generated. Bear with me. I know this Collection already exists within Postman, but I’ll demonstrate a typical use case where you want to better manage your APIs for a custom app. And, where better than Postman to do that.
The Setup
The Fleet Logistics API is a FastAPI backend with 10 routers covering organizations, vehicles, drivers, locations, routes, deliveries, maintenance, fuel logs, incidents, and GPS tracking. It’s time to start collaborating with team members. I want to generate a Postman collection from this code.
Step 1: Select the Workspace
List my Postman workspaces and select "Quintons Playzone"
Step 2: Create Collection from Code
Point the agent at your codebase:
Analyze the fleet-logistics-app directory and create a
Postman collection in my workspace. Call the collection "Fleet Logistics API - Generated", and add API endpoints based on the routes defined.
The agent will:
Parse your router files to extract endpoints
Generate a collection with proper folder organization
Add example values that match your schema types
Once the collection is created, you can add test scripts and set up monitoring directly in Postman. If your IDE supports a larger number of tools, you can install the --full MCP server to enable programmatic test generation and monitor creation directly from your agent—just be aware of potential tool limit issues in some environments.
Patterns I’ve Found Useful
Be Explicit About Mode Selection
When you install the MCP server, the mode you choose shapes what tools are available. Check your config to ensure you’re using the right mode for your needs:
// Minimal mode - recommended for most IDEs (37 tools):
"args": ["@postman/postman-mcp-server@latest", "--minimal"]
// Code mode - for code generation without write access:
"args": ["@postman/postman-mcp-server@latest", "--code"]
// Full mode - all features, but may exceed IDE tool limits:
"args": ["@postman/postman-mcp-server@latest"]
Chain Your Prompts Deliberately
Rather than one massive prompt, I break workflows into steps:
Select workspace
List collections
Select collection
Perform action
This gives you checkpoints to verify the agent is working with the right resources before making changes.
Use Environment Variables for Request Chaining
When running collections, use Postman environment variables to chain requests together. For example, save IDs from POST responses to use in subsequent GET or DELETE requests. This enables running full CRUD workflows in sequence.
Review Before Committing
The agent generates good code, but always review before committing. I’ve found it occasionally:
Uses slightly different naming conventions than my codebase
Misses edge cases in test coverage
Generates more boilerplate than necessary
A quick review catches these. The time saved still far exceeds manual work.
Wrapping Up
This setup gives you three key capabilities:
Bidirectional sync between your code and Postman collections
Collection validation by running tests directly from your IDE
Code generation from your API specifications
What I like about this workflow is it keeps Postman as the source of truth for API documentation while letting me work entirely in Antigravity. The same collection that documents my API for teammates becomes the spec that generates my frontend code.
Clone the Fleet Logistics API repo, set up the MCP server, and try both workflows. Start by generating code from an existing collection—it’s the quickest way to see the value.



