一个从 Postman 集合和请求生成 AI 代理工具的 MCP 服务器。此服务器与 Postman API 集成,将 API 端点转换为类型安全的代码,可以与各种 AI 框架一起使用。
模型上下文协议 (MCP) 是一种用于管理大型语言模型 (LLMs) 和外部系统之间上下文的新标准化协议。在此仓库中,我们提供了一个安装程序以及一个针对 Postman 工具生成 API 的 MCP 服务器。
这使您可以使用 Claude Desktop,或任何像 Cline 这样的 MCP 客户端,通过自然语言在您的 Postman 账户上完成任务,例如:
为以下内容创建 AI 工具: collectionID: 12345-abcde requestID: 67890-fghij typescript openai
npm install
npm run build
cline_mcp_settings.json
) 添加以下内容来配置 MCP 设置:{
"mcpServers": {
"postman-ai-tools": {
"command": "node",
"args": [
"/path/to/postman-tool-generation-server/build/index.js"
],
"env": {
"POSTMAN_API_KEY": "your-postman-api-key"
},
"disabled": false,
"autoApprove": []
}
}
}

服务器提供了一个名为 generate_ai_tool
的工具,具有以下参数:
{
collectionId: string; // The Public API Network collection ID
requestId: string; // The public request ID
language: "javascript" | "typescript"; // Programming language to use
agentFramework: "openai" | "mistral" | "gemini" | "anthropic" | "langchain" | "autogen"; // AI framework
}

// Using the tool through MCP
const result = await use_mcp_tool({
server_name: "postman-ai-tools",
tool_name: "generate_ai_tool",
arguments: {
collectionId: "your-collection-id",
requestId: "your-request-id",
language: "typescript",
agentFramework: "openai"
}
});

该工具生成的类型安全代码包括:
npm install
对 src/index.ts
进行更改
构建服务器:
npm run build
POSTMAN_API_KEY
: 您的 Postman API 密钥(必需)服务器包括以下方面的全面错误处理:
错误响应包含详细的错误信息,以帮助诊断问题。
欢迎贡献!请随时提交 Pull Request。
MIT 许可证