Skip to main content
Glama
shannonlal

Postman MCP Server

by shannonlal

run-collection

Execute Postman Collections with Newman to conduct API tests, analyze results, and integrate testing workflows via a standardized interface.

Instructions

Run a Postman Collection using Newman

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesPath or URL to the Postman collection
environmentNoOptional path or URL to environment file
globalsNoOptional path or URL to globals file
iterationCountNoOptional number of iterations to run

Implementation Reference

  • MCP tool handler for 'run-collection': validates input, executes via NewmanRunner, formats result or error response.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => { if (request.params.name !== "run-collection") { throw new Error(`Unknown tool: ${request.params.name}`); } // Validate input const args = RunCollectionSchema.parse(request.params.arguments); try { // Run the collection const result = await this.runner.runCollection(args); // Format the response return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: JSON.stringify({ error: errorMessage, success: false }, null, 2) }], isError: true }; } });
  • Zod schema for validating 'run-collection' tool input parameters.
    const RunCollectionSchema = z.object({ collection: z.string(), environment: z.string().optional(), globals: z.string().optional(), iterationCount: z.number().min(1).optional() });
  • Registers the 'run-collection' tool in the MCP server's listTools handler, including schema and description.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: "run-collection", description: "Run a Postman Collection using Newman", inputSchema: { type: "object", properties: { collection: { type: "string", description: "Path or URL to the Postman collection" }, environment: { type: "string", description: "Optional path or URL to environment file" }, globals: { type: "string", description: "Optional path or URL to globals file" }, iterationCount: { type: "number", description: "Optional number of iterations to run" } }, required: ["collection"] } } ] }));

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shannonlal/mcp-postman'

If you have feedback or need assistance with the MCP directory API, please join our Discord server