{
  "markdown": "[![smithery badge](https://smithery.ai/badge/onchaintel/pqs)](https://smithery.ai/servers/onchaintel/pqs)\n[![GitHub Marketplace](https://img.shields.io/badge/GitHub_Marketplace-PQS_Check-2ea44f?logo=github)](https://github.com/marketplace/actions/pqs-check)\n[![pqs-mcp-server MCP server](https://glama.ai/mcp/servers/OnChainAIIntel/pqs-mcp-server/badges/card.svg)](https://glama.ai/mcp/servers/OnChainAIIntel/pqs-mcp-server)\n# PQS MCP Server\n\nScore prompt quality before it reaches any AI model. An MCP server for PQS.\n\nScore and optimize LLM prompts before they hit any model. Built on PEEM, RAGAS, MT-Bench, G-Eval, and ROUGE.\n\n## Install\n\n### Claude Desktop (stdio)\n\nAdd to your config (`~/Library/Application Support/Claude/claude_desktop_config.json`):\n```json\n{\n  \"mcpServers\": {\n    \"pqs\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"pqs-mcp-server\"]\n    }\n  }\n}\n```\n\n### Remote (HTTP)\n\nUse this when your MCP client supports streamable-HTTP transport (no local npm install required):\n```json\n{\n  \"mcpServers\": {\n    \"pqs\": {\n      \"url\": \"https://promptqualityscore.com/api/mcp\"\n    }\n  }\n}\n```\n\n### Smithery\n```bash\nsmithery mcp add onchaintel/pqs\n```\n\n## Tools\n\n### score_prompt (Free, no API key required)\n\nReturns a 0-80 score, A-F grade, full 8-dimension breakdown (clarity, specificity, context, constraints, output_format, role_definition, examples, cot_structure), and the weakest dimension. Rate-limited per IP: 5/min, 10/day, 100/month.\n\nLow- and mid-band scores also include a structured `suggestion` field with a message, a `next_tool` pointer to `optimize_prompt`, and a subscribe URL the consuming LLM can paraphrase back to the user.\n\n**Example output (low-band score, suggestion attached):**\n```json\n{\n  \"pqs_version\": \"2.0\",\n  \"prompt\": \"analyze this wallet\",\n  \"score\": 9,\n  \"out_of\": 80,\n  \"grade\": \"F\",\n  \"dimensions\": {\n    \"clarity\": 2,\n    \"specificity\": 1,\n    \"context\": 1,\n    \"constraints\": 1,\n    \"output_format\": 1,\n    \"role_definition\": 1,\n    \"examples\": 1,\n    \"cot_structure\": 1\n  },\n  \"weakest_dimension\": \"specificity\",\n  \"powered_by\": \"PQS — promptqualityscore.com\",\n  \"suggestion\": {\n    \"message\": \"This prompt scored 9/80 (F) — significant room to improve. The optimize_prompt tool rewrites it and shows side-by-side outputs from a frontier model, so you can see the impact. optimize_prompt is part of PQS Pro ($19.99/mo, 1,000 calls/mo). Subscribe at https://promptqualityscore.com/pricing?utm_source=mcp&utm_medium=suggestion_v140&utm_campaign=2026-05-mcp-tools-v140.\",\n    \"next_tool\": \"optimize_prompt\",\n    \"subscribe_url\": \"https://promptqualityscore.com/pricing?utm_source=mcp&utm_medium=suggestion_v140&utm_campaign=2026-05-mcp-tools-v140\"\n  }\n}\n```\n\nIf the per-IP rate limit is hit, the response is a structured `rate_limit_exceeded` payload with subscribe and account URLs.\n\n### optimize_prompt (Pro subscription required)\n\nRewrites a prompt to score higher and runs both versions through a frontier model so the user can see the before/after output. Returns the optimized prompt, before/after dimension scores (with totals), `improvement_pct`, and side-by-side sample outputs.\n\n**Pro subscription required ($19.99/mo, 1,000 calls/mo, includes batch + A/B comparison).** Subscribe at [promptqualityscore.com/pricing](https://promptqualityscore.com/pricing?utm_source=mcp&utm_medium=readme_v140&utm_campaign=2026-05-mcp-readme-v140).\n\nIf the API key is missing, invalid, or on the Free tier, the tool returns a structured error pointing the user at the right URL. No silent failures, no inventing keys. Errors emitted:\n\n- `api_key_required`: no `api_key` argument was sent\n- `api_key_invalid`: key not recognized\n- `subscription_required`: key is valid but Free tier (subscribe to upgrade)\n- `rate_limited`: per-minute burst limit reached (Pro is rate-limited per minute, not per month) or temporary upstream capacity issue\n- `service_unavailable`: upstream 5xx\n\n## Quality Gate Pattern\n\nUse PQS as a pre-inference quality gate:\n```javascript\nconst score = await fetch(\"https://promptqualityscore.com/api/score/free\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ prompt: userPrompt })\n});\nconst { score: pqsScore } = await score.json();\nif (pqsScore < 56) throw new Error(\"Prompt quality too low. Improve and retry.\");\n```\n\nGrade D or below (under 56/80) means the prompt will waste inference spend.\n\n## x402 (legacy pay-per-call)\n\nThe MCP tools in this package use the SaaS API-key model. A separate x402-native pay-per-call path is available via the canonical PQS HTTP API (no API key, caller settles USDC on Base on-chain). For x402 integration, see the canonical pricing and discovery artifacts at [promptqualityscore.com](https://promptqualityscore.com?utm_source=mcp&utm_medium=readme_v140&utm_campaign=2026-05-mcp-readme-v140).\n\n## Self-hosting\n\nOverride the PQS backend URL with the `PQS_BASE` environment variable:\n```bash\nPQS_BASE=https://your-pqs-host.example.com npx pqs-mcp-server\n```\n\nDefaults to `https://promptqualityscore.com`.\n\n## Built by\n\nOnChainIntel, [@OnChainAIIntel](https://twitter.com/OnChainAIIntel)\n[promptqualityscore.com](https://promptqualityscore.com?utm_source=mcp&utm_medium=readme_v140&utm_campaign=2026-05-mcp-readme-v140)\n",
  "bytes": 5271,
  "sha": "76e049e48bc818cc22e98ea7084f8f452632296efb9a404ee4cd0ea01fc314ce",
  "repo_slug": "onchainaiintel/pqs-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_onchainaiintel_pqs_mcp_server_72c21bd8/readme"
}