promptforge-ai-mcp
v1.1.3
Published
PromptForge MCP Server — Expert prompt optimization tool for AI agents via promptforge.ai.amazon.dev
Maintainers
Readme
PromptForge MCP Server
An MCP tool that reengineer prompts using expert prompt engineering methodology via promptforge.ai.amazon.dev.
Prerequisites
- Node.js 20+ — download
- Midway authentication — run
mwinit(standard on all Amazon corp machines)
Install (one line)
No install required. Add this to your MCP client config and it auto-downloads on first run:
Kiro / Kiro CLI
Add to ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"promptforge": {
"command": "npx",
"args": ["--registry", "https://registry.npmjs.org", "-y", "promptforge-ai-mcp"]
}
}
}Amazon Q Developer
Add to ~/.aws/amazonq/mcp.json:
{
"mcpServers": {
"promptforge": {
"command": "npx",
"args": ["--registry", "https://registry.npmjs.org", "-y", "promptforge-ai-mcp"]
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"promptforge": {
"command": "npx",
"args": ["--registry", "https://registry.npmjs.org", "-y", "promptforge-ai-mcp"]
}
}
}Alternative: global install
npm install -g promptforge-ai-mcp --registry https://registry.npmjs.orgThen reference as:
{ "command": "promptforge-ai-mcp" }Tool: optimize_prompt
Input:
prompt(string, required) — The prompt to optimizemode(string, optional, default:"general") — Optimization mode:general— Balanced optimization across structure, clarity, and efficiencyconcise— Token reduction, remove fluff without losing qualitydetailed— Expand with examples, edge cases, and constraintscode_generation— Optimize for code output qualityagentic— Optimize for agent/tool-use (ReAct patterns, guardrails)system_prompt— Four-layer system prompt architecture
Output:
- Optimized prompt (ready to copy/paste)
- Changes summary (what was improved and why)
- Analysis (diagnosis of the original prompt)
- Token usage
How It Works
Your Agent → MCP Server (local) → promptforge.ai.amazon.dev/api/optimize → Claude Sonnet 4
↑
Midway cookie auth (~/.midway/cookie)The MCP server reads your Midway cookies (written by mwinit) and authenticates with the PromptForge API. No AWS credentials, no API keys — just mwinit.
Troubleshooting
| Error | Fix |
|-------|-----|
| FETCH_ERROR / invalid json response body from npmpm.corp.amazon.com | Your npm is configured to use the internal Amazon registry. This package is on public npm. See fix below. |
| Midway cookie file not found | Run mwinit in your terminal |
| Midway session expired | Run mwinit to refresh |
| 403 Forbidden | Run mwinit, ensure you have PromptForge bindle access |
| 429 Rate limit | Wait a moment and retry |
Corporate npm registry conflict
If npx fails with a redirect to midway-auth.amazon.com, your .npmrc points to the internal Amazon registry (npmpm.corp.amazon.com). Since this package is published on public npm, add --registry to bypass it:
npx --registry https://registry.npmjs.org -y promptforge-ai-mcp --setupOr for the MCP config (permanent fix — add the registry flag to args):
{
"mcpServers": {
"promptforge": {
"command": "npx",
"args": ["--registry", "https://registry.npmjs.org", "-y", "promptforge-ai-mcp"]
}
}
}Alternatively, install globally once and reference the binary directly:
npm install -g promptforge-ai-mcp --registry https://registry.npmjs.orgCross-Platform
Works identically on macOS and Windows:
- Pure JavaScript — no native compilation or OS-specific binaries
mwinitwrites~/.midway/cookieon both platforms- Node.js
os.homedir()resolves the correct path on each OS
Development
cd mcp
npm install
npm run build
node dist/index.js # runs the server locally via stdio