foundry-mcp 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. foundry_mcp-0.3.2/.github/workflows/publish.yml +28 -0
  2. foundry_mcp-0.3.2/.gitignore +64 -0
  3. foundry_mcp-0.3.2/AGENTS.md +49 -0
  4. foundry_mcp-0.3.2/CHANGELOG.md +55 -0
  5. foundry_mcp-0.3.2/CLAUDE.md +35 -0
  6. foundry_mcp-0.3.2/LICENSE +21 -0
  7. foundry_mcp-0.3.2/PKG-INFO +337 -0
  8. foundry_mcp-0.3.2/README.md +294 -0
  9. foundry_mcp-0.3.2/bin/foundry-mcp +35 -0
  10. foundry_mcp-0.3.2/docs/architecture/adr-001-cli-architecture.md +419 -0
  11. foundry_mcp-0.3.2/docs/cli_best_practices/01-cli-runtime.md +31 -0
  12. foundry_mcp-0.3.2/docs/cli_best_practices/02-command-shaping.md +26 -0
  13. foundry_mcp-0.3.2/docs/cli_best_practices/03-shared-services.md +28 -0
  14. foundry_mcp-0.3.2/docs/cli_best_practices/04-testing-parity.md +23 -0
  15. foundry_mcp-0.3.2/docs/cli_best_practices/README.md +21 -0
  16. foundry_mcp-0.3.2/docs/codebase_standards/cli-output.md +24 -0
  17. foundry_mcp-0.3.2/docs/codebase_standards/mcp_response_schema.md +234 -0
  18. foundry_mcp-0.3.2/docs/codebase_standards/naming-conventions.md +96 -0
  19. foundry_mcp-0.3.2/docs/concepts/sdd-philosophy.md +146 -0
  20. foundry_mcp-0.3.2/docs/dashboards/README.md +89 -0
  21. foundry_mcp-0.3.2/docs/dashboards/foundry-mcp-errors.json +533 -0
  22. foundry_mcp-0.3.2/docs/dashboards/foundry-mcp-overview.json +534 -0
  23. foundry_mcp-0.3.2/docs/dashboards/foundry-mcp-slo.json +1243 -0
  24. foundry_mcp-0.3.2/docs/dashboards/foundry-mcp-tools.json +416 -0
  25. foundry_mcp-0.3.2/docs/dashboards/prometheus-rules/README.md +244 -0
  26. foundry_mcp-0.3.2/docs/dashboards/prometheus-rules/foundry-mcp-alerting-rules.yaml +341 -0
  27. foundry_mcp-0.3.2/docs/dashboards/prometheus-rules/foundry-mcp-recording-rules.yaml +312 -0
  28. foundry_mcp-0.3.2/docs/guides/ai-consultation.md +247 -0
  29. foundry_mcp-0.3.2/docs/guides/development-guide.md +734 -0
  30. foundry_mcp-0.3.2/docs/guides/llm-configuration.md +687 -0
  31. foundry_mcp-0.3.2/docs/guides/observability.md +217 -0
  32. foundry_mcp-0.3.2/docs/guides/testing.md +480 -0
  33. foundry_mcp-0.3.2/docs/mcp_best_practices/01-versioned-contracts.md +180 -0
  34. foundry_mcp-0.3.2/docs/mcp_best_practices/02-envelopes-metadata.md +295 -0
  35. foundry_mcp-0.3.2/docs/mcp_best_practices/03-serialization-helpers.md +343 -0
  36. foundry_mcp-0.3.2/docs/mcp_best_practices/04-validation-input-hygiene.md +433 -0
  37. foundry_mcp-0.3.2/docs/mcp_best_practices/05-observability-telemetry.md +377 -0
  38. foundry_mcp-0.3.2/docs/mcp_best_practices/06-pagination-streaming.md +523 -0
  39. foundry_mcp-0.3.2/docs/mcp_best_practices/07-error-semantics.md +367 -0
  40. foundry_mcp-0.3.2/docs/mcp_best_practices/08-security-trust-boundaries.md +640 -0
  41. foundry_mcp-0.3.2/docs/mcp_best_practices/09-spec-driven-development.md +415 -0
  42. foundry_mcp-0.3.2/docs/mcp_best_practices/10-testing-fixtures.md +774 -0
  43. foundry_mcp-0.3.2/docs/mcp_best_practices/11-ai-llm-integration.md +459 -0
  44. foundry_mcp-0.3.2/docs/mcp_best_practices/12-timeout-resilience.md +552 -0
  45. foundry_mcp-0.3.2/docs/mcp_best_practices/13-tool-discovery.md +582 -0
  46. foundry_mcp-0.3.2/docs/mcp_best_practices/14-feature-flags.md +463 -0
  47. foundry_mcp-0.3.2/docs/mcp_best_practices/15-concurrency-patterns.md +751 -0
  48. foundry_mcp-0.3.2/docs/mcp_best_practices/README.md +152 -0
  49. foundry_mcp-0.3.2/foundry-mcp.toml +84 -0
  50. foundry_mcp-0.3.2/mcp/capabilities_manifest.json +1133 -0
  51. foundry_mcp-0.3.2/pyproject.toml +65 -0
  52. foundry_mcp-0.3.2/pytest.ini +30 -0
  53. foundry_mcp-0.3.2/samples/foundry-mcp.toml +386 -0
  54. foundry_mcp-0.3.2/specs/completed/ai-consultation-layer-2025-12-03-001.json +1308 -0
  55. foundry_mcp-0.3.2/specs/completed/cli-provider-abstraction-2025-11-30-001.json +2845 -0
  56. foundry_mcp-0.3.2/specs/completed/foundry-cli-gap-remediation-2025-12-02-001.json +1760 -0
  57. foundry_mcp-0.3.2/specs/completed/foundry-mcp-2025-01-25-001.json +2949 -0
  58. foundry_mcp-0.3.2/specs/completed/internal-cli-elimination-2025-12-01-001.json +1437 -0
  59. foundry_mcp-0.3.2/specs/completed/mcp-best-practices-remediation-2025-11-26-001.json +5090 -0
  60. foundry_mcp-0.3.2/specs/completed/mcp-tool-consolidation-2025-12-10-001.json +2515 -0
  61. foundry_mcp-0.3.2/specs/completed/multi-model-consensus-2025-12-05-001.json +854 -0
  62. foundry_mcp-0.3.2/specs/completed/observability-stack-2025-12-05-001.json +1136 -0
  63. foundry_mcp-0.3.2/specs/completed/parity-testing-framework-2025-01-26-001.json +976 -0
  64. foundry_mcp-0.3.2/specs/completed/phase-remove-tool-2025-12-05-001.json +448 -0
  65. foundry_mcp-0.3.2/specs/completed/remove-docquery-rendering-docgen-2025-12-09-001.json +1406 -0
  66. foundry_mcp-0.3.2/specs/completed/response-schema-standardization-2025-11-26-001.json +1761 -0
  67. foundry_mcp-0.3.2/specs/completed/sdd-cli-native-parity-2025-11-27-001.json +2083 -0
  68. foundry_mcp-0.3.2/specs/completed/sdd-core-operations-2025-11-27-001.json +3774 -0
  69. foundry_mcp-0.3.2/specs/completed/sdd-llm-features-2025-11-27-001.json +1844 -0
  70. foundry_mcp-0.3.2/src/foundry_mcp/__init__.py +7 -0
  71. foundry_mcp-0.3.2/src/foundry_mcp/cli/__init__.py +80 -0
  72. foundry_mcp-0.3.2/src/foundry_mcp/cli/__main__.py +9 -0
  73. foundry_mcp-0.3.2/src/foundry_mcp/cli/agent.py +96 -0
  74. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/__init__.py +37 -0
  75. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/cache.py +137 -0
  76. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/dashboard.py +148 -0
  77. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/dev.py +446 -0
  78. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/journal.py +377 -0
  79. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/lifecycle.py +274 -0
  80. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/modify.py +824 -0
  81. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/plan.py +633 -0
  82. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/pr.py +393 -0
  83. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/review.py +652 -0
  84. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/session.py +479 -0
  85. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/specs.py +856 -0
  86. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/tasks.py +807 -0
  87. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/testing.py +676 -0
  88. foundry_mcp-0.3.2/src/foundry_mcp/cli/commands/validate.py +982 -0
  89. foundry_mcp-0.3.2/src/foundry_mcp/cli/config.py +98 -0
  90. foundry_mcp-0.3.2/src/foundry_mcp/cli/context.py +259 -0
  91. foundry_mcp-0.3.2/src/foundry_mcp/cli/flags.py +266 -0
  92. foundry_mcp-0.3.2/src/foundry_mcp/cli/logging.py +212 -0
  93. foundry_mcp-0.3.2/src/foundry_mcp/cli/main.py +44 -0
  94. foundry_mcp-0.3.2/src/foundry_mcp/cli/output.py +122 -0
  95. foundry_mcp-0.3.2/src/foundry_mcp/cli/registry.py +110 -0
  96. foundry_mcp-0.3.2/src/foundry_mcp/cli/resilience.py +178 -0
  97. foundry_mcp-0.3.2/src/foundry_mcp/cli/transcript.py +217 -0
  98. foundry_mcp-0.3.2/src/foundry_mcp/config.py +850 -0
  99. foundry_mcp-0.3.2/src/foundry_mcp/core/__init__.py +144 -0
  100. foundry_mcp-0.3.2/src/foundry_mcp/core/ai_consultation.py +1636 -0
  101. foundry_mcp-0.3.2/src/foundry_mcp/core/cache.py +195 -0
  102. foundry_mcp-0.3.2/src/foundry_mcp/core/capabilities.py +446 -0
  103. foundry_mcp-0.3.2/src/foundry_mcp/core/concurrency.py +898 -0
  104. foundry_mcp-0.3.2/src/foundry_mcp/core/context.py +540 -0
  105. foundry_mcp-0.3.2/src/foundry_mcp/core/discovery.py +1603 -0
  106. foundry_mcp-0.3.2/src/foundry_mcp/core/error_collection.py +728 -0
  107. foundry_mcp-0.3.2/src/foundry_mcp/core/error_store.py +587 -0
  108. foundry_mcp-0.3.2/src/foundry_mcp/core/feature_flags.py +592 -0
  109. foundry_mcp-0.3.2/src/foundry_mcp/core/health.py +749 -0
  110. foundry_mcp-0.3.2/src/foundry_mcp/core/journal.py +694 -0
  111. foundry_mcp-0.3.2/src/foundry_mcp/core/lifecycle.py +412 -0
  112. foundry_mcp-0.3.2/src/foundry_mcp/core/llm_config.py +1348 -0
  113. foundry_mcp-0.3.2/src/foundry_mcp/core/llm_patterns.py +510 -0
  114. foundry_mcp-0.3.2/src/foundry_mcp/core/llm_provider.py +1569 -0
  115. foundry_mcp-0.3.2/src/foundry_mcp/core/logging_config.py +374 -0
  116. foundry_mcp-0.3.2/src/foundry_mcp/core/metrics_persistence.py +584 -0
  117. foundry_mcp-0.3.2/src/foundry_mcp/core/metrics_registry.py +327 -0
  118. foundry_mcp-0.3.2/src/foundry_mcp/core/metrics_store.py +626 -0
  119. foundry_mcp-0.3.2/src/foundry_mcp/core/modifications.py +224 -0
  120. foundry_mcp-0.3.2/src/foundry_mcp/core/naming.py +123 -0
  121. foundry_mcp-0.3.2/src/foundry_mcp/core/observability.py +1200 -0
  122. foundry_mcp-0.3.2/src/foundry_mcp/core/otel.py +452 -0
  123. foundry_mcp-0.3.2/src/foundry_mcp/core/otel_stubs.py +264 -0
  124. foundry_mcp-0.3.2/src/foundry_mcp/core/pagination.py +255 -0
  125. foundry_mcp-0.3.2/src/foundry_mcp/core/progress.py +317 -0
  126. foundry_mcp-0.3.2/src/foundry_mcp/core/prometheus.py +577 -0
  127. foundry_mcp-0.3.2/src/foundry_mcp/core/prompts/__init__.py +464 -0
  128. foundry_mcp-0.3.2/src/foundry_mcp/core/prompts/fidelity_review.py +546 -0
  129. foundry_mcp-0.3.2/src/foundry_mcp/core/prompts/markdown_plan_review.py +511 -0
  130. foundry_mcp-0.3.2/src/foundry_mcp/core/prompts/plan_review.py +623 -0
  131. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/__init__.py +225 -0
  132. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/base.py +476 -0
  133. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/claude.py +459 -0
  134. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/codex.py +594 -0
  135. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/cursor_agent.py +642 -0
  136. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/detectors.py +488 -0
  137. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/gemini.py +404 -0
  138. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/opencode.py +616 -0
  139. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/registry.py +607 -0
  140. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/test_provider.py +171 -0
  141. foundry_mcp-0.3.2/src/foundry_mcp/core/providers/validation.py +729 -0
  142. foundry_mcp-0.3.2/src/foundry_mcp/core/rate_limit.py +427 -0
  143. foundry_mcp-0.3.2/src/foundry_mcp/core/resilience.py +600 -0
  144. foundry_mcp-0.3.2/src/foundry_mcp/core/responses.py +934 -0
  145. foundry_mcp-0.3.2/src/foundry_mcp/core/review.py +366 -0
  146. foundry_mcp-0.3.2/src/foundry_mcp/core/security.py +438 -0
  147. foundry_mcp-0.3.2/src/foundry_mcp/core/spec.py +1650 -0
  148. foundry_mcp-0.3.2/src/foundry_mcp/core/task.py +1289 -0
  149. foundry_mcp-0.3.2/src/foundry_mcp/core/testing.py +450 -0
  150. foundry_mcp-0.3.2/src/foundry_mcp/core/validation.py +2081 -0
  151. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/__init__.py +32 -0
  152. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/app.py +120 -0
  153. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/components/__init__.py +17 -0
  154. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/components/cards.py +88 -0
  155. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/components/charts.py +234 -0
  156. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/components/filters.py +136 -0
  157. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/components/tables.py +195 -0
  158. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/data/__init__.py +11 -0
  159. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/data/stores.py +371 -0
  160. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/launcher.py +189 -0
  161. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/pages/__init__.py +20 -0
  162. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/pages/errors.py +217 -0
  163. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/pages/metrics.py +128 -0
  164. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/pages/overview.py +128 -0
  165. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/pages/providers.py +83 -0
  166. foundry_mcp-0.3.2/src/foundry_mcp/dashboard/pages/sdd_workflow.py +255 -0
  167. foundry_mcp-0.3.2/src/foundry_mcp/prompts/__init__.py +9 -0
  168. foundry_mcp-0.3.2/src/foundry_mcp/prompts/workflows.py +525 -0
  169. foundry_mcp-0.3.2/src/foundry_mcp/resources/__init__.py +9 -0
  170. foundry_mcp-0.3.2/src/foundry_mcp/resources/specs.py +591 -0
  171. foundry_mcp-0.3.2/src/foundry_mcp/schemas/__init__.py +38 -0
  172. foundry_mcp-0.3.2/src/foundry_mcp/schemas/sdd-spec-schema.json +386 -0
  173. foundry_mcp-0.3.2/src/foundry_mcp/server.py +164 -0
  174. foundry_mcp-0.3.2/src/foundry_mcp/tools/__init__.py +10 -0
  175. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/__init__.py +71 -0
  176. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/authoring.py +1487 -0
  177. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/context_helpers.py +98 -0
  178. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/documentation_helpers.py +198 -0
  179. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/environment.py +939 -0
  180. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/error.py +462 -0
  181. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/health.py +225 -0
  182. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/journal.py +841 -0
  183. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/lifecycle.py +632 -0
  184. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/metrics.py +777 -0
  185. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/plan.py +745 -0
  186. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/pr.py +294 -0
  187. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/provider.py +629 -0
  188. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/review.py +685 -0
  189. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/review_helpers.py +299 -0
  190. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/router.py +102 -0
  191. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/server.py +580 -0
  192. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/spec.py +808 -0
  193. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/task.py +2202 -0
  194. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/test.py +370 -0
  195. foundry_mcp-0.3.2/src/foundry_mcp/tools/unified/verification.py +520 -0
  196. foundry_mcp-0.3.2/tests/__init__.py +1 -0
  197. foundry_mcp-0.3.2/tests/conftest.py +260 -0
  198. foundry_mcp-0.3.2/tests/contract/__init__.py +1 -0
  199. foundry_mcp-0.3.2/tests/contract/response_schema.json +202 -0
  200. foundry_mcp-0.3.2/tests/contract/test_response_schema.py +510 -0
  201. foundry_mcp-0.3.2/tests/fixtures/ai_responses/fidelity_review_response.json +15 -0
  202. foundry_mcp-0.3.2/tests/fixtures/ai_responses/plan_review_response.json +15 -0
  203. foundry_mcp-0.3.2/tests/fixtures/context_tracker/transcript.jsonl +1 -0
  204. foundry_mcp-0.3.2/tests/fixtures/golden/README.md +44 -0
  205. foundry_mcp-0.3.2/tests/fixtures/golden/error_not_found.json +13 -0
  206. foundry_mcp-0.3.2/tests/fixtures/golden/error_validation_failure.json +31 -0
  207. foundry_mcp-0.3.2/tests/fixtures/golden/provider_execute_missing_prompt.json +12 -0
  208. foundry_mcp-0.3.2/tests/fixtures/golden/provider_execute_success.json +19 -0
  209. foundry_mcp-0.3.2/tests/fixtures/golden/provider_execute_timeout.json +14 -0
  210. foundry_mcp-0.3.2/tests/fixtures/golden/provider_execute_unavailable.json +12 -0
  211. foundry_mcp-0.3.2/tests/fixtures/golden/provider_list_success.json +28 -0
  212. foundry_mcp-0.3.2/tests/fixtures/golden/provider_list_with_unavailable.json +35 -0
  213. foundry_mcp-0.3.2/tests/fixtures/golden/provider_status_missing_id.json +12 -0
  214. foundry_mcp-0.3.2/tests/fixtures/golden/provider_status_not_found.json +12 -0
  215. foundry_mcp-0.3.2/tests/fixtures/golden/provider_status_success.json +38 -0
  216. foundry_mcp-0.3.2/tests/fixtures/golden/success_specs_list.json +24 -0
  217. foundry_mcp-0.3.2/tests/fixtures/golden/success_task_progress.json +25 -0
  218. foundry_mcp-0.3.2/tests/fixtures/golden/success_test_presets.json +45 -0
  219. foundry_mcp-0.3.2/tests/fixtures/golden/success_validation.json +18 -0
  220. foundry_mcp-0.3.2/tests/integration/test_authoring_tools.py +876 -0
  221. foundry_mcp-0.3.2/tests/integration/test_environment_tools.py +368 -0
  222. foundry_mcp-0.3.2/tests/integration/test_fallback_integration.py +72 -0
  223. foundry_mcp-0.3.2/tests/integration/test_mcp_smoke.py +76 -0
  224. foundry_mcp-0.3.2/tests/integration/test_mcp_tools.py +182 -0
  225. foundry_mcp-0.3.2/tests/integration/test_notifications_sampling.py +708 -0
  226. foundry_mcp-0.3.2/tests/integration/test_prepare_task_cli.py +397 -0
  227. foundry_mcp-0.3.2/tests/integration/test_provider_tools.py +79 -0
  228. foundry_mcp-0.3.2/tests/integration/test_sdd_cli_advanced.py +212 -0
  229. foundry_mcp-0.3.2/tests/integration/test_sdd_cli_parity.py +405 -0
  230. foundry_mcp-0.3.2/tests/property/__init__.py +1 -0
  231. foundry_mcp-0.3.2/tests/property/test_input_validation.py +773 -0
  232. foundry_mcp-0.3.2/tests/test_responses.py +628 -0
  233. foundry_mcp-0.3.2/tests/unit/__init__.py +1 -0
  234. foundry_mcp-0.3.2/tests/unit/core/test_review.py +351 -0
  235. foundry_mcp-0.3.2/tests/unit/test_ai_consultation.py +892 -0
  236. foundry_mcp-0.3.2/tests/unit/test_cli_review_helpers.py +87 -0
  237. foundry_mcp-0.3.2/tests/unit/test_core/__init__.py +1 -0
  238. foundry_mcp-0.3.2/tests/unit/test_core/test_concurrency.py +478 -0
  239. foundry_mcp-0.3.2/tests/unit/test_core/test_discovery.py +466 -0
  240. foundry_mcp-0.3.2/tests/unit/test_core/test_feature_flags.py +874 -0
  241. foundry_mcp-0.3.2/tests/unit/test_core/test_journal.py +627 -0
  242. foundry_mcp-0.3.2/tests/unit/test_core/test_lifecycle.py +561 -0
  243. foundry_mcp-0.3.2/tests/unit/test_core/test_llm_patterns.py +431 -0
  244. foundry_mcp-0.3.2/tests/unit/test_core/test_pagination.py +446 -0
  245. foundry_mcp-0.3.2/tests/unit/test_core/test_provider_spec.py +295 -0
  246. foundry_mcp-0.3.2/tests/unit/test_core/test_resilience.py +803 -0
  247. foundry_mcp-0.3.2/tests/unit/test_core/test_security.py +958 -0
  248. foundry_mcp-0.3.2/tests/unit/test_core/test_spec.py +1097 -0
  249. foundry_mcp-0.3.2/tests/unit/test_core/test_task.py +613 -0
  250. foundry_mcp-0.3.2/tests/unit/test_core/test_validation.py +806 -0
  251. foundry_mcp-0.3.2/tests/unit/test_environment.py +636 -0
  252. foundry_mcp-0.3.2/tests/unit/test_error_collection.py +643 -0
  253. foundry_mcp-0.3.2/tests/unit/test_golden_fixtures.py +241 -0
  254. foundry_mcp-0.3.2/tests/unit/test_llm_provider.py +867 -0
  255. foundry_mcp-0.3.2/tests/unit/test_metrics_persistence.py +840 -0
  256. foundry_mcp-0.3.2/tests/unit/test_observability_graceful.py +237 -0
  257. foundry_mcp-0.3.2/tests/unit/test_providers_base.py +525 -0
  258. foundry_mcp-0.3.2/tests/unit/test_providers_detectors.py +624 -0
  259. foundry_mcp-0.3.2/tests/unit/test_providers_implementations.py +946 -0
  260. foundry_mcp-0.3.2/tests/unit/test_providers_registry.py +461 -0
  261. foundry_mcp-0.3.2/tests/unit/test_review.py +59 -0
  262. foundry_mcp-0.3.2/tests/unit/test_sdd_cli_core.py +991 -0
  263. foundry_mcp-0.3.2/tests/unit/test_sdd_cli_runtime.py +501 -0
  264. foundry_mcp-0.3.2/tests/unit/test_transcript.py +296 -0
@@ -0,0 +1,28 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.11"
20
+
21
+ - name: Install build dependencies
22
+ run: pip install hatch
23
+
24
+ - name: Build package
25
+ run: hatch build
26
+
27
+ - name: Publish to PyPI
28
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,64 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Testing
24
+ .pytest_cache/
25
+ .coverage
26
+ htmlcov/
27
+
28
+ # IDE
29
+ .vscode/
30
+ .idea/
31
+ *.swp
32
+ *.swo
33
+ *~
34
+
35
+ # OS
36
+ .DS_Store
37
+ Thumbs.db
38
+
39
+ # Claude Code
40
+ settings.local.json
41
+ !src/claude_skills/claude_skills/common/templates/setup/settings.local.json
42
+ settings.json
43
+ .cache/
44
+ .claude/
45
+ .doc-cache/
46
+ .agents/
47
+ *.cache/
48
+
49
+ # SDD Toolkit
50
+ .specs/
51
+
52
+ # Ignore all dotfolders under specs/ (reports, reviews, etc.)
53
+ specs/.*/
54
+
55
+ # ModelChorus configuration
56
+ .model-chorusrc
57
+
58
+ .doc-cache/
59
+ .agents/
60
+ .mcp.json
61
+ uv.lock
62
+ .venv
63
+ .hypothesis/
64
+ .ruff_cache/
@@ -0,0 +1,49 @@
1
+ # Agent Operating Guide
2
+
3
+ This repository follows the MCP Tool Industry Best Practices located under [docs/mcp_best_practices](docs/mcp_best_practices). Treat this file as the root-level contract for how to work inside `foundry-mcp`.
4
+
5
+ ## Session Kickoff
6
+
7
+ 1. **Always skim [docs/mcp_best_practices/README.md#L24-L77](docs/mcp_best_practices/README.md#L24-L77)** when starting a session. This provides the index of authoritative guidance and the code-review checklist you must use before any PR.
8
+ 2. Map your planned edits to the decision matrix below and re-open the referenced documents _before_ modifying code, specs, or tests.
9
+
10
+ ## Best-Practice Decision Matrix
11
+
12
+ | Workstream | Required Reads | Non-Negotiable Actions |
13
+ |------------|----------------|------------------------|
14
+ | New tools, features, or contract tweaks | [docs/codebase_standards/mcp_response_schema.md](docs/codebase_standards/mcp_response_schema.md) (canonical response contract), [docs/mcp_best_practices/01-versioned-contracts.md#L9-L127](docs/mcp_best_practices/01-versioned-contracts.md#L9-L127), [docs/mcp_best_practices/02-envelopes-metadata.md#L30-L285](docs/mcp_best_practices/02-envelopes-metadata.md#L30-L285), [docs/mcp_best_practices/03-serialization-helpers.md#L29-L220](docs/mcp_best_practices/03-serialization-helpers.md#L29-L220), [docs/mcp_best_practices/04-validation-input-hygiene.md#L10-L223](docs/mcp_best_practices/04-validation-input-hygiene.md#L10-L223), [docs/mcp_best_practices/08-security-trust-boundaries.md#L10-L345](docs/mcp_best_practices/08-security-trust-boundaries.md#L10-L345) | Tag every response with schema versions, build envelopes via helpers, validate inputs up front, and enforce security/rate limits before business logic. Document any contract change in specs and PR notes. |
15
+ | Pagination, streaming, batching, or bulk results | [docs/mcp_best_practices/06-pagination-streaming.md#L32-L332](docs/mcp_best_practices/06-pagination-streaming.md#L32-L332) and [docs/mcp_best_practices/07-error-semantics.md#L11-L274](docs/mcp_best_practices/07-error-semantics.md#L11-L274) | Use cursor-based pagination, mark partial results, expose `meta.pagination`, and emit actionable errors/warnings following the standard structure. |
16
+ | Observability, telemetry, resilience, or timeout logic | [docs/mcp_best_practices/05-observability-telemetry.md#L12-L333](docs/mcp_best_practices/05-observability-telemetry.md#L12-L333) and [docs/mcp_best_practices/12-timeout-resilience.md#L12-L398](docs/mcp_best_practices/12-timeout-resilience.md#L12-L398) | Prefer structured logging, propagate correlation IDs, add metrics/tracing hooks, document timeout budgets, and justify retries/circuit breakers. |
17
+ | Feature flags, staged rollouts, or gated experiments | [docs/mcp_best_practices/14-feature-flags.md#L10-L330](docs/mcp_best_practices/14-feature-flags.md#L10-L330) | Document flag lifecycle phases, expose flag status via capabilities, keep override controls ready for rollback, and test both enabled/disabled paths before shipping. |
18
+ | Concurrency, async orchestration, or parallel workloads | [docs/mcp_best_practices/15-concurrency-patterns.md#L10-L420](docs/mcp_best_practices/15-concurrency-patterns.md#L10-L420) and [docs/mcp_best_practices/12-timeout-resilience.md#L12-L398](docs/mcp_best_practices/12-timeout-resilience.md#L12-L398) | Declare sync vs async execution in tool docs, enforce concurrency/rate limits, propagate cancellation, and avoid blocking the event loopโ€”fall back to thread/process pools for CPU work. |
19
+ | AI-/LLM-facing ergonomics, tool metadata, or discovery flows | [docs/mcp_best_practices/11-ai-llm-integration.md#L11-L352](docs/mcp_best_practices/11-ai-llm-integration.md#L11-L352), [docs/mcp_best_practices/13-tool-discovery.md#L12-L505](docs/mcp_best_practices/13-tool-discovery.md#L12-L505), and [docs/codebase_standards/naming-conventions.md](docs/codebase_standards/naming-conventions.md) | Keep responses concise and structured, design for tool chaining, keep tool descriptions/schemas updated with usage examples, tags, and rate limits, and enforce the canonical prefixes from the naming conventions guide. |
20
+ | CLI runtime, naming, or output changes | [docs/cli_best_practices/README.md](docs/cli_best_practices/README.md), [docs/codebase_standards/cli-output.md](docs/codebase_standards/cli-output.md) | Follow JSON-first output, reuse shared runtime helpers, and document namespace/prefix decisions alongside MCP counterparts. |
21
+
22
+ > **Rule:** If more than one workstream applies, read every referenced section in full before touching files.
23
+
24
+ ## Specs, Docs, and Tests Must Move Together
25
+
26
+ - Follow [docs/mcp_best_practices/09-spec-driven-development.md#L11-L214](docs/mcp_best_practices/09-spec-driven-development.md#L11-L214): specs are the source of truth. Update specs, implementation, and documentation in the *same* PR, including changelog entries.
27
+ - Align fixtures/tests with [docs/mcp_best_practices/10-testing-fixtures.md#L10-L335](docs/mcp_best_practices/10-testing-fixtures.md#L10-L335). Regenerate fixtures whenever schema versions or helpers change, and re-run the freshness checks described there.
28
+ - For running tests, debugging failures, and understanding the test suite structure, see [docs/guides/testing.md](docs/guides/testing.md).
29
+
30
+ ## Mandatory Review Checklist
31
+
32
+ Before opening a PR or merging:
33
+ 1. Walk through the checklist in [docs/mcp_best_practices/README.md#L64-L70](docs/mcp_best_practices/README.md#L64-L70).
34
+ 2. Verify every modified tool:
35
+ - Uses standardized envelopes/helpers ([docs/codebase_standards/mcp_response_schema.md](docs/codebase_standards/mcp_response_schema.md), [docs/mcp_best_practices/02-envelopes-metadata.md](docs/mcp_best_practices/02-envelopes-metadata.md), [docs/mcp_best_practices/03-serialization-helpers.md](docs/mcp_best_practices/03-serialization-helpers.md)).
36
+ - Performs validation and sanitation ([docs/mcp_best_practices/04-validation-input-hygiene.md](docs/mcp_best_practices/04-validation-input-hygiene.md), [docs/mcp_best_practices/08-security-trust-boundaries.md](docs/mcp_best_practices/08-security-trust-boundaries.md)).
37
+ - Emits graceful errors/warnings ([docs/mcp_best_practices/07-error-semantics.md](docs/mcp_best_practices/07-error-semantics.md)).
38
+ - Includes observability/resilience hooks if applicable ([docs/mcp_best_practices/05-observability-telemetry.md](docs/mcp_best_practices/05-observability-telemetry.md), [docs/mcp_best_practices/12-timeout-resilience.md](docs/mcp_best_practices/12-timeout-resilience.md)).
39
+ - Documents feature-flag status, capability exposure, and cleanup plans when relevant ([docs/mcp_best_practices/14-feature-flags.md](docs/mcp_best_practices/14-feature-flags.md)).
40
+ - Declares execution model, enforces concurrency/rate limits, and propagates cancellation ([docs/mcp_best_practices/15-concurrency-patterns.md](docs/mcp_best_practices/15-concurrency-patterns.md)).
41
+ - Keeps specs, docs, and fixtures in sync ([docs/mcp_best_practices/09-spec-driven-development.md](docs/mcp_best_practices/09-spec-driven-development.md), [docs/mcp_best_practices/10-testing-fixtures.md](docs/mcp_best_practices/10-testing-fixtures.md)).
42
+ 3. Mention in the PR description which best-practices sections you consulted.
43
+
44
+ ## When in Doubt
45
+
46
+ - If code touches security, privacy, or external boundaries, re-read [docs/mcp_best_practices/04-validation-input-hygiene.md](docs/mcp_best_practices/04-validation-input-hygiene.md), [docs/mcp_best_practices/07-error-semantics.md](docs/mcp_best_practices/07-error-semantics.md), [docs/mcp_best_practices/08-security-trust-boundaries.md](docs/mcp_best_practices/08-security-trust-boundaries.md), and [docs/mcp_best_practices/11-ai-llm-integration.md](docs/mcp_best_practices/11-ai-llm-integration.md) entirely and document the applied guidance in commit/PR notes.
47
+ - If you are gating behavior behind feature flags or changing concurrency/async behavior, re-read [docs/mcp_best_practices/14-feature-flags.md](docs/mcp_best_practices/14-feature-flags.md) and [docs/mcp_best_practices/15-concurrency-patterns.md](docs/mcp_best_practices/15-concurrency-patterns.md) along with [docs/mcp_best_practices/12-timeout-resilience.md](docs/mcp_best_practices/12-timeout-resilience.md) for resilience, and call out the safeguards you applied.
48
+ - When ambiguity exists, default to re-reading the full relevant document(s) instead of relying on summaries.
49
+ - Record consulted sections in your plan or worklog so reviewers know which guidance informed the change.
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.2] - 2025-12-16
11
+
12
+ ### Added
13
+ - Launcher script (`bin/foundry-mcp`) for configurable Python interpreter selection
14
+ - `FOUNDRY_MCP_PYTHON` environment variable to override the default Python interpreter
15
+
16
+ ### Fixed
17
+ - Removed duplicate `spec_id` and `node_id` fields from task progress response
18
+
19
+ ## [0.3.1] - 2025-12-16
20
+
21
+ ### Removed
22
+ - Removed `code` unified tool (find-class, find-function, callers, callees, trace, impact actions) from MCP surface. Unified manifest reduced from 17 to 16 tools.
23
+
24
+ ## [0.3.0] - 2025-12-15
25
+
26
+ ### Changed
27
+ - Consolidated the MCP tool surface into 17 unified routers (tool + `action`) and aligned CLI/MCP naming.
28
+ - Updated documentation and manifests to reflect the unified router contract.
29
+
30
+ ### Added
31
+ - New completed specs documenting MCP tool consolidation and removal of docquery/rendering/docgen.
32
+ - Unified-manifest budget telemetry (Prometheus metrics, recording rules, alerting rules, and dashboard panels).
33
+
34
+ ### Removed
35
+ - Legacy per-tool MCP modules and legacy CLI command surfaces in favor of unified routers.
36
+ - Docquery/rendering/docgen modules and generated docs previously under `docs/generated/`.
37
+
38
+ ## [0.2.1] - 2025-12-08
39
+
40
+ ### Changed
41
+ - **Dashboard**: Replaced aiohttp+vanilla JS dashboard with Streamlit for better visualizations and interactivity
42
+ - Dashboard dependencies changed from `aiohttp` to `streamlit`, `plotly`, `pandas`
43
+ - Default dashboard port changed from 8080 to 8501 (Streamlit default)
44
+
45
+ ### Added
46
+ - New Streamlit dashboard with 5 pages: Overview, Errors, Metrics, Providers, SDD Workflow
47
+ - Interactive Plotly charts with zoom, pan, and hover tooltips
48
+ - Data export functionality (CSV/JSON download buttons)
49
+ - Cached data access via `@st.cache_data` for performance
50
+ - CLI commands: `dashboard start`, `dashboard stop`, `dashboard status`
51
+ - New SDD Workflow page for spec progress tracking, phase burndown, task status
52
+ - Plan review tool (`plan-review`) for AI-assisted specification review
53
+
54
+ ### Removed
55
+ - Old aiohttp-based dashboard server and static JS/CSS files
@@ -0,0 +1,35 @@
1
+ # CLAUDE Agent Triage Playbook
2
+
3
+ You are operating inside the `foundry-mcp` repository, which adheres to the MCP Tool Industry Best Practices under [docs/mcp_best_practices](docs/mcp_best_practices). Use this playbook at the start of every session and whenever scope changes.
4
+
5
+ ## 1. Session Auto-Triage
6
+
7
+ 1. **Kickoff scan** โ€“ Skim [docs/mcp_best_practices/README.md#L24-L77](docs/mcp_best_practices/README.md#L24-L77) to refresh the document index and review checklist.
8
+ 2. **Scope-to-doc mapping** โ€“ For each planned change, map the work to the decision matrix below and re-open the referenced docs _before_ editing:
9
+ - **Contracts / new tools / helper updates** โ†’ Re-read [docs/codebase_standards/mcp_response_schema.md](docs/codebase_standards/mcp_response_schema.md) (canonical response contract), [docs/mcp_best_practices/01-versioned-contracts.md#L9-L127](docs/mcp_best_practices/01-versioned-contracts.md#L9-L127), [docs/mcp_best_practices/02-envelopes-metadata.md#L30-L285](docs/mcp_best_practices/02-envelopes-metadata.md#L30-L285), [docs/mcp_best_practices/03-serialization-helpers.md#L29-L220](docs/mcp_best_practices/03-serialization-helpers.md#L29-L220), [docs/mcp_best_practices/04-validation-input-hygiene.md#L10-L223](docs/mcp_best_practices/04-validation-input-hygiene.md#L10-L223), and [docs/mcp_best_practices/08-security-trust-boundaries.md#L10-L345](docs/mcp_best_practices/08-security-trust-boundaries.md#L10-L345).
10
+ - **Pagination / batching / error semantics** โ†’ Re-read [docs/mcp_best_practices/06-pagination-streaming.md#L32-L332](docs/mcp_best_practices/06-pagination-streaming.md#L32-L332) and [docs/mcp_best_practices/07-error-semantics.md#L11-L274](docs/mcp_best_practices/07-error-semantics.md#L11-L274).
11
+ - **Observability / resiliency / timeout work** โ†’ Re-read [docs/mcp_best_practices/05-observability-telemetry.md#L12-L333](docs/mcp_best_practices/05-observability-telemetry.md#L12-L333) and [docs/mcp_best_practices/12-timeout-resilience.md#L12-L398](docs/mcp_best_practices/12-timeout-resilience.md#L12-L398).
12
+ - **Feature flags / gated rollouts** โ†’ Re-read [docs/mcp_best_practices/14-feature-flags.md#L10-L330](docs/mcp_best_practices/14-feature-flags.md#L10-L330) (plus [docs/mcp_best_practices/12-timeout-resilience.md](docs/mcp_best_practices/12-timeout-resilience.md) for rollback mechanics).
13
+ - **Concurrency / async orchestration / parallelism** โ†’ Re-read [docs/mcp_best_practices/15-concurrency-patterns.md#L10-L420](docs/mcp_best_practices/15-concurrency-patterns.md#L10-L420) (and [docs/mcp_best_practices/12-timeout-resilience.md](docs/mcp_best_practices/12-timeout-resilience.md) for cancellation strategy).
14
+ - **LLM ergonomics / tool metadata** โ†’ Re-read [docs/mcp_best_practices/11-ai-llm-integration.md#L11-L352](docs/mcp_best_practices/11-ai-llm-integration.md#L11-L352) and [docs/mcp_best_practices/13-tool-discovery.md#L12-L505](docs/mcp_best_practices/13-tool-discovery.md#L12-L505), and consult [docs/codebase_standards/naming-conventions.md](docs/codebase_standards/naming-conventions.md) to keep tool prefixes canonical.
15
+ 3. **Ambiguity rule** โ€“ When uncertainty exists, re-read the full relevant section(s) instead of relying on summaries.
16
+ 4. **Log references** โ€“ Note the consulted sections in your task plan or worklog so reviewers know which guidance informed the change.
17
+
18
+ ## 2. Development & Testing Flow
19
+
20
+ - **Specs + docs + tests together** โ€“ Any contract-impacting change MUST update specs ([docs/mcp_best_practices/09-spec-driven-development.md#L11-L214](docs/mcp_best_practices/09-spec-driven-development.md#L11-L214)), documentation, and fixtures/tests ([docs/mcp_best_practices/10-testing-fixtures.md#L10-L335](docs/mcp_best_practices/10-testing-fixtures.md#L10-L335)) in the same change set.
21
+ - **Testing guidance** โ€“ Before adjusting or regenerating fixtures/tests, reopen [docs/mcp_best_practices/10-testing-fixtures.md](docs/mcp_best_practices/10-testing-fixtures.md) to confirm freshness checks, schema alignment, and helper coverage expectations.
22
+ - **Running tests** โ€“ For test commands, presets, debugging strategies, and test suite structure, see [docs/guides/testing.md](docs/guides/testing.md).
23
+ - **Security-sensitive work** โ€“ If touching trust boundaries, re-read [docs/mcp_best_practices/04-validation-input-hygiene.md](docs/mcp_best_practices/04-validation-input-hygiene.md), [docs/mcp_best_practices/07-error-semantics.md](docs/mcp_best_practices/07-error-semantics.md), [docs/mcp_best_practices/08-security-trust-boundaries.md](docs/mcp_best_practices/08-security-trust-boundaries.md), and [docs/mcp_best_practices/11-ai-llm-integration.md](docs/mcp_best_practices/11-ai-llm-integration.md) in full and document the applied mitigations in commit/PR notes.
24
+
25
+ ## 3. Code Review Checklist Alignment
26
+
27
+ - Prior to submitting or reviewing a PR, walk through the checklist in [docs/mcp_best_practices/README.md#L64-L70](docs/mcp_best_practices/README.md#L64-L70).
28
+ - Confirm every modified surface adheres to envelopes/helpers ([docs/mcp_best_practices/02-envelopes-metadata.md](docs/mcp_best_practices/02-envelopes-metadata.md), [docs/mcp_best_practices/03-serialization-helpers.md](docs/mcp_best_practices/03-serialization-helpers.md)), validation/sanitization ([docs/mcp_best_practices/04-validation-input-hygiene.md](docs/mcp_best_practices/04-validation-input-hygiene.md), [docs/mcp_best_practices/08-security-trust-boundaries.md](docs/mcp_best_practices/08-security-trust-boundaries.md)), pagination/error semantics ([docs/mcp_best_practices/06-pagination-streaming.md](docs/mcp_best_practices/06-pagination-streaming.md), [docs/mcp_best_practices/07-error-semantics.md](docs/mcp_best_practices/07-error-semantics.md)), observability/resilience ([docs/mcp_best_practices/05-observability-telemetry.md](docs/mcp_best_practices/05-observability-telemetry.md), [docs/mcp_best_practices/12-timeout-resilience.md](docs/mcp_best_practices/12-timeout-resilience.md)), feature-flag lifecycle controls ([docs/mcp_best_practices/14-feature-flags.md](docs/mcp_best_practices/14-feature-flags.md)), concurrency/cancellation guidance ([docs/mcp_best_practices/15-concurrency-patterns.md](docs/mcp_best_practices/15-concurrency-patterns.md)), and testing/spec sync ([docs/mcp_best_practices/09-spec-driven-development.md](docs/mcp_best_practices/09-spec-driven-development.md), [docs/mcp_best_practices/10-testing-fixtures.md](docs/mcp_best_practices/10-testing-fixtures.md)).
29
+ - Reference the consulted sections explicitly in the PR description or review comments for traceability.
30
+
31
+ ## 4. Operational Reminders
32
+
33
+ - Keep responses concise and structured for LLM consumption per [docs/mcp_best_practices/11-ai-llm-integration.md](docs/mcp_best_practices/11-ai-llm-integration.md); use progressive disclosure and tool-chaining-friendly outputs.
34
+ - When documenting or exposing tools, update discovery metadata per [docs/mcp_best_practices/13-tool-discovery.md](docs/mcp_best_practices/13-tool-discovery.md) (usage examples, tags, rate limits, capability negotiation).
35
+ - Default to schema-tagged envelopes via the helpers in `src/foundry_mcp/core/responses.py`; never hand-roll response objects. See [docs/codebase_standards/mcp_response_schema.md](docs/codebase_standards/mcp_response_schema.md) for the full response contract and usage examples.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tyler Burleigh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,337 @@
1
+ Metadata-Version: 2.4
2
+ Name: foundry-mcp
3
+ Version: 0.3.2
4
+ Summary: MCP server for SDD toolkit spec management
5
+ Project-URL: Homepage, https://github.com/tylerburleigh/foundry-mcp
6
+ Project-URL: Repository, https://github.com/tylerburleigh/foundry-mcp
7
+ Author: Tyler Burleigh
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: mcp,sdd,spec-driven-development,specification
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.10
19
+ Requires-Dist: click>=8.0.0
20
+ Requires-Dist: fastmcp>=0.1.0
21
+ Requires-Dist: mcp>=1.0.0
22
+ Requires-Dist: tomli>=2.0.0; python_version < '3.11'
23
+ Provides-Extra: dashboard
24
+ Requires-Dist: pandas>=2.0.0; extra == 'dashboard'
25
+ Requires-Dist: plotly>=5.18.0; extra == 'dashboard'
26
+ Requires-Dist: streamlit>=1.28.0; extra == 'dashboard'
27
+ Provides-Extra: metrics
28
+ Requires-Dist: prometheus-client>=0.17.0; extra == 'metrics'
29
+ Provides-Extra: observability
30
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20.0; extra == 'observability'
31
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == 'observability'
32
+ Requires-Dist: prometheus-client>=0.17.0; extra == 'observability'
33
+ Provides-Extra: test
34
+ Requires-Dist: hypothesis>=6.0.0; extra == 'test'
35
+ Requires-Dist: jsonschema>=4.0.0; extra == 'test'
36
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
37
+ Requires-Dist: pytest-xdist>=3.0.0; extra == 'test'
38
+ Requires-Dist: pytest>=7.0.0; extra == 'test'
39
+ Provides-Extra: tracing
40
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20.0; extra == 'tracing'
41
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == 'tracing'
42
+ Description-Content-Type: text/markdown
43
+
44
+ # foundry-mcp
45
+
46
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
47
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
48
+ [![MCP Compatible](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io/)
49
+ [![Development Status](https://img.shields.io/badge/status-alpha-orange.svg)](https://pypi.org/project/foundry-mcp/)
50
+
51
+ **An MCP server and native CLI that bring spec-driven development to your AI assistant.**
52
+
53
+ foundry-mcp packages the spec lifecycle, a single CLI/service layer, and MCP adapters described in the completed specs under `specs/completed/`. Every MCP response uses the standardized `response-v2` envelope, the CLI shares the same service layer, and feature-flagged tool suites cover environment setup, authoring, validation, LLM review, and automated testing.
54
+
55
+ ## ๐Ÿš€ Why foundry-mcp?
56
+
57
+ - **Single service layer for CLI + MCP** โ€” The completed CLI re-implementation and subprocess elimination specs ensure the CLI and MCP tools share contracts, observability, and feature flags.
58
+ - **Spec lifecycle automation** โ€” Tools manage creation, validation, lifecycle transitions, blockers, and journaling with cursor-based pagination and dependency tracking.
59
+ - **Quality gates & behavioral testing** โ€” A dedicated regression harness keeps foundry-mcp aligned with the legacy claude-sdd-toolkit CLI while integration/unit/property suites guard regressions.
60
+ - **LLM-ready workflows** โ€” Provider abstractions, prompt shielding, and graceful fallbacks power AI review, documentation, and PR creation workflows when LLM access is available.
61
+ - **Security & governance baked in** โ€” API keys, workspace scoping, rate limiting, structured logging, and audit trails are enforced before business logic as mandated by the MCP best-practices remediation spec.
62
+ - **Discovery-first design** โ€” Capabilities are declared through `mcp/capabilities_manifest.json` so clients can negotiate response contracts, feature flags, and tool availability.
63
+
64
+ ## ๐Ÿ“ฆ Installation
65
+
66
+ ### Pre-requisites
67
+
68
+ - Python 3.10 or higher
69
+ - macOS, Linux, or Windows
70
+ - MCP-compatible client (e.g., Claude Code)
71
+
72
+ ### Quick install
73
+
74
+ #### Run instantly with `uvx`
75
+
76
+ ```bash
77
+ uvx foundry-mcp
78
+ ```
79
+
80
+ #### Install from PyPI with `pip`
81
+
82
+ ```bash
83
+ pip install foundry-mcp
84
+ ```
85
+
86
+ #### Install from source (development)
87
+
88
+ ```bash
89
+ git clone https://github.com/tylerburleigh/foundry-mcp.git
90
+ cd foundry-mcp
91
+ pip install -e ".[test]"
92
+ ```
93
+
94
+ #### Launch the native SDD CLI
95
+
96
+ ```bash
97
+ python -m foundry_mcp.cli --help
98
+ ```
99
+
100
+ ## ๐Ÿ“… Release cadence & support channels
101
+
102
+ - The project currently ships **alpha** releases after each spec milestone; see [CHANGELOG.md](CHANGELOG.md) for the latest tagged version.
103
+ - PyPI publishes semantic versions that align with the spec roadmap (`response_contract_v2`, feature flags, test suites, etc.).
104
+ - MCP capabilities expose rollout state so clients can opt-in to new contracts (for example `response_contract=v2`).
105
+
106
+ ## ๐Ÿ“‹ Key features
107
+
108
+ ### Spec lifecycle & governance
109
+
110
+ ```
111
+ specs/
112
+ โ”œโ”€โ”€ pending/ # New specs awaiting activation
113
+ โ”œโ”€โ”€ active/ # Currently being worked on
114
+ โ”œโ”€โ”€ completed/ # Finished specs (automatically journaled)
115
+ โ””โ”€โ”€ archived/ # Historical reference
116
+ ```
117
+
118
+ - Discover and validate specs via `spec(action=...)`.
119
+ - Transition spec folders/states via `lifecycle(action=...)`.
120
+ - Automatically journal decisions, blockers, and dependency updates with audit metadata.
121
+
122
+ ### Task operations & execution
123
+
124
+ - `task(action=next|prepare|start|complete|...)` and blocker flows expose the full dependency graph.
125
+ - `plan(action=create|list|review)` supports lightweight planning and review flows.
126
+ - Notifications and sampling channels surface phase completions to MCP clients.
127
+
128
+ ### Code, docs, and testing intelligence
129
+
130
+ - Code navigation tools via `code(action=...)` support symbol lookup and call-graph tracing.
131
+ - Testing tools via `test(action=run|discover, preset=quick|unit|full)` run pytest presets with structured output.
132
+ - Shared adapters mirror claude-sdd-toolkit behavior and integrate with the regression testing harness.
133
+
134
+ ### LLM-powered workflows
135
+
136
+ - Configurable provider abstraction with OpenAI, Anthropic, and local backends (Ollama, etc.) plus prompt shielding and observability hooks.
137
+ - AI-enhanced review via `review(action=spec|fidelity|parse-feedback)` and PR helpers degrade gracefully when no LLM is configured.
138
+ - Timeouts, retries, and circuit breakers follow the resilience patterns from the remediation specs.
139
+
140
+ ### CLI + MCP integration
141
+
142
+ - Run `foundry-mcp` as an MCP server or `python -m foundry_mcp.cli` for the JSON-first CLI.
143
+ - Both surfaces share response helpers, validation, feature flags, and discovery metadata so you can switch between automated MCP clients and terminal workflows without drift.
144
+
145
+ ### Resources & prompts
146
+
147
+ - `foundry://specs/` resources expose full spec hierarchies, journals, and templates for AI assistants.
148
+ - Workflow prompts (`start_feature`, `debug_test`, `complete_phase`, etc.) guide SDD operations end-to-end.
149
+
150
+ ## ๐Ÿ” Access & security
151
+
152
+ - Workspace roots are scoped via configuration to prevent directory escape.
153
+ - Optional API keys (`FOUNDRY_MCP_API_KEYS`) or tenant TOML overrides enforce authentication before any tool runs.
154
+ - Rate limits and concurrency budgets are declared in the capabilities manifest and enforced server-side with structured audit logs.
155
+ - Sensitive data redaction, prompt shielding, and validation helpers protect against prompt injection or oversized payloads.
156
+
157
+ ## ๐Ÿงพ Response contract & discovery
158
+
159
+ All MCP tools emit the standardized envelope defined in `docs/codebase_standards/mcp_response_schema.md`:
160
+
161
+ ```json
162
+ {
163
+ "success": true,
164
+ "data": { ... },
165
+ "error": null,
166
+ "meta": {
167
+ "version": "response-v2",
168
+ "pagination": { ... },
169
+ "warnings": []
170
+ }
171
+ }
172
+ ```
173
+
174
+ - `success`, `data`, `error`, and `meta` are always present so clients never guess at output shape.
175
+ - `response_contract_v2` is feature-flagged; clients advertise support via capability negotiation.
176
+ - `mcp/capabilities_manifest.json` advertises the 17 unified tools (plus feature flags like `unified_manifest`).
177
+
178
+ **Legacy โ†’ unified mapping (examples)**
179
+
180
+ | Legacy tool | Unified call |
181
+ |---|---|
182
+ | Legacy Tool (Removed) | Unified Equivalent |
183
+ |----------------------|--------------------|
184
+ | `task-next` | `task(action="next")` |
185
+ | `spec-validate` | `spec(action="validate")` |
186
+ | `test-run` | `test(action="run", preset="full")` |
187
+ | `tool-list` | `server(action="tools")` |
188
+ | `get-server-context` | `server(action="context")` |
189
+
190
+ ## โš™๏ธ Configuration
191
+
192
+ ### Environment variables
193
+
194
+ | Variable | Description | Default |
195
+ |----------|-------------|---------|
196
+ | `FOUNDRY_MCP_SPECS_DIR` | Path to specs directory | Auto-detected from workspace |
197
+ | `FOUNDRY_MCP_LOG_LEVEL` | Logging level (DEBUG, INFO, etc.) | `INFO` |
198
+ | `FOUNDRY_MCP_WORKFLOW_MODE` | Execution mode: `single`, `autonomous`, `batch` | `single` |
199
+ | `FOUNDRY_MCP_API_KEYS` | Comma-separated API keys required for tool access | Disabled |
200
+ | `FOUNDRY_MCP_FEATURE_FLAGS` | Additional feature flags to enable (e.g., `planning_tools`) | Based on spec rollout |
201
+ | `FOUNDRY_MCP_RESPONSE_CONTRACT` | Force response contract version (`v2`) | Auto-negotiated |
202
+ | `OPENAI_API_KEY` / `ANTHROPIC_API_KEY` | LLM provider credentials | Not set |
203
+
204
+ ### TOML configuration
205
+
206
+ Create `foundry-mcp.toml` for shared settings:
207
+
208
+ ```toml
209
+ [workspace]
210
+ specs_dir = "/path/to/specs"
211
+
212
+ [logging]
213
+ level = "INFO"
214
+ structured = true
215
+
216
+ [workflow]
217
+ mode = "single"
218
+ auto_validate = true
219
+ journal_enabled = true
220
+
221
+ [llm]
222
+ provider = "openai" # or "anthropic", "local"
223
+ model = "gpt-4"
224
+ timeout = 30
225
+
226
+ [security]
227
+ require_api_key = true
228
+ allowed_keys = ["tenant-prod", "tenant-dev"]
229
+ workspace_roots = ["/repos/specs"]
230
+
231
+ [feature_flags]
232
+ enabled = ["environment_tools", "spec_helpers", "planning_tools", "response_contract_v2"]
233
+ ```
234
+
235
+ ## ๐Ÿš€ Getting started
236
+
237
+ ### Launch as an MCP server
238
+
239
+ ```bash
240
+ foundry-mcp
241
+ ```
242
+
243
+ The server will advertise its capabilities, feature flags, and response contract so MCP clients (Claude Code, Gemini CLI, etc.) can connect automatically.
244
+
245
+ ### Use the native SDD CLI
246
+
247
+ ```bash
248
+ python -m foundry_mcp.cli task next --specs-dir /path/to/specs
249
+ ```
250
+
251
+ All CLI commands output JSON for reliable parsing by AI coding tools and mirror the legacy `claude-sdd-toolkit` surface.
252
+
253
+ ### Claude Code setup
254
+
255
+ Add foundry-mcp through Claude Code settings (Command Palette โ†’ **Claude Code: Configure MCP Servers**) and include:
256
+
257
+ ```json
258
+ {
259
+ "mcpServers": {
260
+ "foundry-mcp": {
261
+ "command": "uvx",
262
+ "args": ["foundry-mcp"],
263
+ "env": {
264
+ "FOUNDRY_MCP_SPECS_DIR": "/path/to/specs",
265
+ "FOUNDRY_MCP_RESPONSE_CONTRACT": "v2"
266
+ }
267
+ }
268
+ }
269
+ }
270
+ ```
271
+
272
+ <details>
273
+ <summary>Using a pip installation instead?</summary>
274
+
275
+ ```json
276
+ {
277
+ "mcpServers": {
278
+ "foundry-mcp": {
279
+ "command": "foundry-mcp",
280
+ "env": {
281
+ "FOUNDRY_MCP_SPECS_DIR": "/path/to/specs"
282
+ }
283
+ }
284
+ }
285
+ }
286
+ ```
287
+ </details>
288
+
289
+ ### Quick usage examples
290
+
291
+ ```bash
292
+ # List specs via MCP tool (unified router)
293
+ echo '{"action": "list"}' | foundry-mcp --tool spec
294
+
295
+ # Validate a spec via MCP tool
296
+ echo '{"action": "validate", "spec_id": "sdd-core-operations-2025-11-27-001"}' | foundry-mcp --tool spec
297
+
298
+ # Run CLI validation without an MCP client
299
+ python -m foundry_mcp.cli --specs-dir ./specs validate check sdd-core-operations-2025-11-27-001
300
+ ```
301
+
302
+ ## ๐Ÿ“š Documentation
303
+
304
+ | Guide | Description |
305
+ |-------|-------------|
306
+ | [SDD Philosophy](docs/concepts/sdd-philosophy.md) | Why spec-driven development matters |
307
+ | [Architecture Overview](docs/architecture/adr-001-cli-architecture.md) | CLI/MCP architecture decision record |
308
+ | [Development Guide](docs/guides/development-guide.md) | Setup, architecture, contributing |
309
+ | [Testing Guide](docs/guides/testing.md) | Running and debugging tests / fixtures |
310
+ | [LLM Configuration](docs/guides/llm-configuration.md) | Provider setup & fallbacks |
311
+ | [MCP Best Practices](docs/mcp_best_practices/README.md) | Canonical implementation checklist |
312
+ | [Response Schema](docs/codebase_standards/mcp_response_schema.md) | Standardized envelope reference |
313
+ | [CLI Output Contract](docs/codebase_standards/cli-output.md) | JSON-first CLI expectations |
314
+
315
+ ## ๐Ÿงช Testing & quality gates
316
+
317
+ ```bash
318
+ pytest # Full suite
319
+ pytest tests/integration/test_mcp_smoke.py # MCP smoke tests
320
+ pytest tests/integration/test_mcp_tools.py # Tool contract coverage
321
+ ```
322
+
323
+ - Regression tests keep MCP/CLI adapters aligned with the legacy claude-sdd-toolkit contracts.
324
+ - Golden fixtures (`tests/fixtures/golden`) ensure response envelopes, error semantics, and pagination never regress.
325
+ - Freshness checks (doc generation, capability manifests) run alongside core unit and integration suites.
326
+
327
+ ## ๐Ÿค Contributing
328
+
329
+ Contributions are welcome! Please read the [MCP Best Practices](docs/mcp_best_practices/README.md) before submitting PRs. All changes should keep specs, docs, code, and fixtures in sync and follow the decision matrix in `AGENTS.md`.
330
+
331
+ ## ๐Ÿ“„ License
332
+
333
+ MIT License โ€” see [LICENSE](LICENSE) for details.
334
+
335
+ ---
336
+
337
+ **Built by [Tyler Burleigh](https://github.com/tylerburleigh)** ยท [Report an Issue](https://github.com/tylerburleigh/foundry-mcp/issues) ยท [View on GitHub](https://github.com/tylerburleigh/foundry-mcp)