aida-mcp 0.1.2.dev1__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 (123) hide show
  1. aida_mcp-0.1.2.dev1/.gitignore +45 -0
  2. aida_mcp-0.1.2.dev1/PKG-INFO +193 -0
  3. aida_mcp-0.1.2.dev1/README.md +174 -0
  4. aida_mcp-0.1.2.dev1/pyproject.toml +95 -0
  5. aida_mcp-0.1.2.dev1/src/aida_mcp/__init__.py +1 -0
  6. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/__init__.py +6 -0
  7. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/__init__.py +1 -0
  8. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/github/commit-and-push.mdc +49 -0
  9. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/github/git-router.mdc +21 -0
  10. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/github/pull-requests.mdc +23 -0
  11. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/github/review-and-ci.mdc +19 -0
  12. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/tools/rules-authoring.mdc +84 -0
  13. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/general/tools/validation-workflow.mdc +76 -0
  14. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/__init__.py +1 -0
  15. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/general/backend-coding-guidelines.mdc +33 -0
  16. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/technologies/gradle.mdc +27 -0
  17. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/technologies/kotlin.mdc +22 -0
  18. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/technologies/library-changes.mdc +31 -0
  19. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/technologies/python.mdc +79 -0
  20. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/technologies/spring-boot-microservices.mdc +19 -0
  21. aida_mcp-0.1.2.dev1/src/aida_mcp/embedded_rules/vendor/technologies/third-party-libraries.mdc +37 -0
  22. aida_mcp-0.1.2.dev1/src/aida_mcp/onboarding_templates/__init__.py +4 -0
  23. aida_mcp-0.1.2.dev1/src/aida_mcp/onboarding_templates/workflow_body.md +54 -0
  24. aida_mcp-0.1.2.dev1/src/aida_mcp/output/__init__.py +41 -0
  25. aida_mcp-0.1.2.dev1/src/aida_mcp/output/base.py +20 -0
  26. aida_mcp-0.1.2.dev1/src/aida_mcp/output/command_summary.py +169 -0
  27. aida_mcp-0.1.2.dev1/src/aida_mcp/output/error_excerpt.py +146 -0
  28. aida_mcp-0.1.2.dev1/src/aida_mcp/output/error_grouping.py +165 -0
  29. aida_mcp-0.1.2.dev1/src/aida_mcp/output/event_context.py +47 -0
  30. aida_mcp-0.1.2.dev1/src/aida_mcp/output/gradle_parser.py +124 -0
  31. aida_mcp-0.1.2.dev1/src/aida_mcp/output/log_utils.py +129 -0
  32. aida_mcp-0.1.2.dev1/src/aida_mcp/output/policy.py +19 -0
  33. aida_mcp-0.1.2.dev1/src/aida_mcp/output/progress_events.py +42 -0
  34. aida_mcp-0.1.2.dev1/src/aida_mcp/output/python_parser.py +37 -0
  35. aida_mcp-0.1.2.dev1/src/aida_mcp/output/response_guard.py +130 -0
  36. aida_mcp-0.1.2.dev1/src/aida_mcp/output/test_summary.py +81 -0
  37. aida_mcp-0.1.2.dev1/src/aida_mcp/server/__init__.py +11 -0
  38. aida_mcp-0.1.2.dev1/src/aida_mcp/server/__main__.py +16 -0
  39. aida_mcp-0.1.2.dev1/src/aida_mcp/server/app_instance.py +55 -0
  40. aida_mcp-0.1.2.dev1/src/aida_mcp/server/bootstrap.py +45 -0
  41. aida_mcp-0.1.2.dev1/src/aida_mcp/server/cli.py +447 -0
  42. aida_mcp-0.1.2.dev1/src/aida_mcp/server/commit_cli.py +269 -0
  43. aida_mcp-0.1.2.dev1/src/aida_mcp/server/mcp_install.py +346 -0
  44. aida_mcp-0.1.2.dev1/src/aida_mcp/server/registry.py +23 -0
  45. aida_mcp-0.1.2.dev1/src/aida_mcp/server/repo_onboarding.py +352 -0
  46. aida_mcp-0.1.2.dev1/src/aida_mcp/server/tools_github.py +159 -0
  47. aida_mcp-0.1.2.dev1/src/aida_mcp/server/tools_rules.py +438 -0
  48. aida_mcp-0.1.2.dev1/src/aida_mcp/server/tools_validation.py +18 -0
  49. aida_mcp-0.1.2.dev1/src/aida_mcp/server/validation_tools/__init__.py +1 -0
  50. aida_mcp-0.1.2.dev1/src/aida_mcp/server/validation_tools/validate.py +219 -0
  51. aida_mcp-0.1.2.dev1/src/aida_mcp/server.py +23 -0
  52. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/__init__.py +1 -0
  53. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/__init__.py +12 -0
  54. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/change_classifier.py +292 -0
  55. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/external_json_tool.py +144 -0
  56. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/git_policy_config.py +109 -0
  57. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/results/__init__.py +17 -0
  58. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/results/builders.py +42 -0
  59. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/results/models.py +62 -0
  60. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/results/types.py +11 -0
  61. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/runner.py +135 -0
  62. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/validation_finalize.py +222 -0
  63. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/core/validation_registry.py +322 -0
  64. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/docker/__init__.py +1 -0
  65. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/docker/build_testing.py +189 -0
  66. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/docker/service_detection.py +133 -0
  67. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/docker/wheel_testing.py +47 -0
  68. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/external_runners/__init__.py +8 -0
  69. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/external_runners/runner_utils.py +93 -0
  70. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/__init__.py +1 -0
  71. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/ci_errors.py +179 -0
  72. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/ci_errors_helpers.py +117 -0
  73. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/ci_errors_models.py +46 -0
  74. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/client.py +163 -0
  75. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/comments.py +36 -0
  76. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/comments_list.py +166 -0
  77. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/comments_reply.py +49 -0
  78. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/comments_resolve.py +140 -0
  79. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/comments_types.py +53 -0
  80. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/github/comments_url.py +54 -0
  81. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/__init__.py +25 -0
  82. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/config.py +26 -0
  83. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/embeddings/__init__.py +13 -0
  84. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/embeddings/chunker.py +172 -0
  85. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/embeddings/initialization.py +188 -0
  86. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/embeddings/model.py +193 -0
  87. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/embeddings/store.py +188 -0
  88. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/formatting.py +175 -0
  89. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/injection.py +79 -0
  90. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/materialize.py +130 -0
  91. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/retriever.py +262 -0
  92. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/scoring.py +15 -0
  93. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/scoring_bm25.py +149 -0
  94. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/scoring_embedding.py +45 -0
  95. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/scoring_hybrid.py +163 -0
  96. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/scoring_types.py +92 -0
  97. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/session_memory.py +89 -0
  98. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/store.py +195 -0
  99. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/utils.py +64 -0
  100. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules/vocab.py +157 -0
  101. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/rules_retrieval.py +159 -0
  102. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/__init__.py +5 -0
  103. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/command_runner.py +122 -0
  104. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/engine.py +285 -0
  105. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/models.py +53 -0
  106. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/policy_config.py +189 -0
  107. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/processors/__init__.py +4 -0
  108. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/processors/builtin.py +239 -0
  109. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/processors/runner.py +41 -0
  110. aida_mcp-0.1.2.dev1/src/aida_mcp/tools/validate/stream_progress.py +135 -0
  111. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/__init__.py +1 -0
  112. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/aida_paths.py +41 -0
  113. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/artifacts.py +36 -0
  114. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/command_runner.py +457 -0
  115. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/config_loader.py +56 -0
  116. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/git.py +208 -0
  117. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/path_resolution.py +30 -0
  118. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/progress.py +141 -0
  119. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/project_discovery.py +230 -0
  120. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/repo_readiness.py +61 -0
  121. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/stream_reader.py +131 -0
  122. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/timing.py +110 -0
  123. aida_mcp-0.1.2.dev1/src/aida_mcp/utils/workspace.py +149 -0
@@ -0,0 +1,45 @@
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
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+ env/
28
+
29
+ # IDE
30
+ .idea/
31
+ .vscode/
32
+ *.swp
33
+ *.swo
34
+ *~
35
+
36
+ # Testing
37
+ .pytest_cache/
38
+ .coverage
39
+ htmlcov/
40
+ .tox/
41
+ reports/
42
+
43
+ # Logs
44
+ *.log
45
+
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: aida-mcp
3
+ Version: 0.1.2.dev1
4
+ Summary: AIDA MCP server - Developer actions (lint, test, typecheck) for monorepos
5
+ Author-email: GoodData Corporation <support@gooddata.com>
6
+ Requires-Python: <3.14,>=3.12
7
+ Requires-Dist: httpx>=0.28.0
8
+ Requires-Dist: junitparser>=3.1.2
9
+ Requires-Dist: langchain-text-splitters>=0.2.0
10
+ Requires-Dist: mcp>=1.25.0
11
+ Requires-Dist: numpy>=1.26.0
12
+ Requires-Dist: orjson>=3.11.5
13
+ Requires-Dist: pydantic>=2.10.6
14
+ Requires-Dist: pyyaml>=6.0.1
15
+ Requires-Dist: sentence-transformers>=3.0.0
16
+ Requires-Dist: structlog>=25.3.0
17
+ Requires-Dist: torch>=2.9.0
18
+ Description-Content-Type: text/markdown
19
+
20
+ # AIDA (AI Developer Assistant)
21
+
22
+ FastMCP server (`aida-mcp`) that exposes GoodData's **unified validation** workflow (plus GitHub helpers and rules retrieval) over the MCP protocol. Use it from Cursor, Claude Code, JetBrains AI, or the CLI to run repo-configured lint/type/test/codegen pipelines without memorizing each project's workflow.
23
+
24
+ ---
25
+
26
+ ## TL;DR – Getting Started
27
+
28
+ ### Cursor / Claude Code / JetBrains AI
29
+ | Step | Command | Notes |
30
+ | --- | --- | --- |
31
+ | 1 | `cd packages/aida-mcp && make install` | Installs/updates the **packaged** MCP server (wheel) only. |
32
+ | 2 | `aida-mcp init` (run in your repo root) | Writes **repo-local** MCP config stubs (e.g. `.cursor/mcp.json`, `.mcp.json`) and onboarding files. Add `--vendor-rules` to enable vendor/example embedded rules. |
33
+ | 3 | Restart IDE / Agent | Tools appear as `aida` in the MCP panel. |
34
+ | 4 | Ask your assistant to "validate <service>" | The assistant calls the right tool automatically. |
35
+
36
+ Need the full local setup (Node, uv, multi-repo tips, troubleshooting)? See [CONTRIBUTING.md](CONTRIBUTING.md).
37
+
38
+ ---
39
+
40
+ ## Repo Config Files
41
+
42
+ AIDA reads repo-owned policy and routing from `.aida/`:
43
+ - `change_domains.yaml`
44
+ - `validation_policy.yaml`
45
+ - `validation_registry.yaml`
46
+ - `git_policy.yaml` (commit/PR/workflow knobs for git-related tools)
47
+ - `rules/**/*.mdc`
48
+
49
+ `aida-mcp init` bootstraps these files when missing.
50
+
51
+ ---
52
+
53
+ ## Tool Overview
54
+
55
+ | Tool | Highlights |
56
+ | --- | --- |
57
+ | `validate` | Unified validation tool. Computes scope (`pre_commit` / `pre_push`), routes via `.aida/*`, executes registry-defined commands with streaming progress. |
58
+ | `get_rules` | Retrieves relevant rules for the current task (hybrid lexical + embeddings), with transparent scoring/debug output. |
59
+ | `github_ci_errors` | Fetch size-capped CI failures for a PR (errors-only by default). |
60
+ | `github_comments` | List/reply/resolve PR review threads (non-interactive). |
61
+
62
+ **Progress Tracking**: `validate` streams real-time progress updates to Cursor using combined `ctx.report_progress()` + `ctx.info()` events. External validators can emit `AIDA_EVENT {json}` lines for richer progress while keeping full logs in artifacts.
63
+
64
+ Detailed behavior (step descriptions, parameters, and usage snippets) now lives in [docs/validation-tools.md](docs/validation-tools.md) to keep this README short.
65
+ If you only need the external command contract and config shape, start with [docs/external-validation-interface.md](docs/external-validation-interface.md).
66
+ Rules retrieval details live in [docs/rules-retrieval.md](docs/rules-retrieval.md).
67
+
68
+ ---
69
+
70
+ ## Architecture at a Glance
71
+
72
+ ```
73
+ packages/aida-mcp/
74
+ ├── src/
75
+ │ └── app/
76
+ │ ├── server/ # FastMCP entrypoint + tool registration
77
+ │ ├── tools/
78
+ │ │ ├── core/ # shared primitives (registry, change classifier, external tool helpers)
79
+ │ │ └── validate/ # unified validate engine (policy + external command execution)
80
+ │ └── utils/ # command runner, config loader, junit parsing, progress, timing, etc.
81
+ ├── config/ # bundled defaults (registry, tool configs)
82
+ ├── docs/ # detailed validation tool documentation
83
+ ├── tests/ # unit + integration suites
84
+ └── CONTRIBUTING.md # setup, workflows, troubleshooting
85
+ ```
86
+
87
+ Validation design:
88
+ - AIDA is language-agnostic for validation command execution.
89
+ - Validation commands are repo-owned external executables configured in `.aida/validation_registry.yaml`.
90
+ - Output processors remain built-in and reusable inside `packages/aida-mcp`.
91
+
92
+ ---
93
+
94
+ ## Using the Tools
95
+
96
+ ### From Cursor / Claude
97
+ 1. Install/update the MCP server via `cd packages/aida-mcp && make install`.
98
+ 2. Onboard the repo you want to use AIDA in via `aida-mcp init` (run in the repo root).
99
+ 2. In the editor, ask: “run validation” or “validate `microservices/gen-ai`”. The assistant calls `validate(scope=..., focus_paths=...)`.
100
+ 3. Routing and the exact commands run are repo-owned via `.aida/*`.
101
+
102
+ ### From the terminal
103
+
104
+ ```bash
105
+ cd packages/aida-mcp
106
+ aida-mcp # launches stdio server manually (once installed via uv tool)
107
+ ```
108
+
109
+ Commit helper (enforces footer policy and 70-char subject limit):
110
+
111
+ ```bash
112
+ aida-mcp commit \
113
+ --type chore \
114
+ --scope aida \
115
+ --title "add commit helper command" \
116
+ --body "Enforce risk footer ordering and metadata trailers." \
117
+ --jira DX-123 \
118
+ --risk nonprod
119
+ ```
120
+
121
+ Prefer running the command directly in this shape; do not probe with `aida-mcp commit --help` unless troubleshooting.
122
+
123
+ Optional metadata in the footer block:
124
+ - `--co-authored-by "Name <email>"` (repeatable)
125
+ - `--ai-share actor=percent` (repeatable, must sum to 100)
126
+ - `--ai-share-auto <actor>` for deterministic `<actor>=100` without guessing (policy-gated)
127
+ - multiline body support:
128
+ - `--body-file /path/to/body.txt`
129
+ - `--body-stdin` (pipe or heredoc)
130
+ - `--body-line ...` (repeatable)
131
+
132
+ `aida-mcp commit` policy values (for example title length, allowed `risk:` values, and optional required trailers) are configurable via `.aida/git_policy.yaml`.
133
+ `Co-authored-by` is explicit-only: pass `--co-authored-by` when available; if omitted, no co-author trailer is added.
134
+
135
+ Validation CLI shortcuts still live in the repo root:
136
+
137
+ ```bash
138
+ make format-fix lint-fix
139
+ make types
140
+ make test
141
+ make validate # fast default (format/lint/types + unit tests)
142
+ make validate-all # includes integration tests (slow)
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Troubleshooting & Workflow Guides
148
+
149
+ Rather than duplicating multiple pages of instructions here, refer to:
150
+ - [CONTRIBUTING.md](CONTRIBUTING.md): environment prep, Cursor integration, node/uv requirements, manual overrides, and how to add new tools/rules.
151
+ - [docs/validation-tools.md](docs/validation-tools.md): deep dive into each tool’s steps, parameters, and best practices.
152
+ - Developer onboarding docs under `docs/developer/` for broader GoodData setup.
153
+
154
+ ---
155
+
156
+ ## FAQ
157
+
158
+ **Why a single `validate` tool?**
159
+ Repo-owned routing (`.aida/*`) lets `aida-mcp` live in a separate repo while still executing GoodData-specific validations (often via external wrappers) with streaming progress.
160
+
161
+ **Can I add custom output processors as external commands?**
162
+ Not in unified validate today. Processors are built-in only; for custom behavior, either emit JSON consumed by `external_json` or add a new reusable built-in processor in `packages/aida-mcp`.
163
+
164
+ **Can I run Docker/OpenAPI without rewriting commands?**
165
+ Yes—when the repo’s `.aida/validation_policy.yaml` routes those steps. Add dedicated pipelines/commands for `docker`/`openapi` when needed.
166
+
167
+ **What happens if the MCP client disconnects during validation?**
168
+ The server gracefully handles invalid or closed MCP contexts. Progress updates are silently skipped if the context becomes unavailable, preventing server crashes. Validation continues to completion and returns results normally.
169
+
170
+ **What if Python tests fail with "duplicate file name metadata.proto"?**
171
+ The Python validator automatically detects this common issue (stale protobuf artifacts in `.venv`) and runs `make ultra-clean` + `make dev` to rebuild the environment, then retries the test step. This recovery is transparent and only triggers when needed.
172
+
173
+ **How do I extend validation routing?**
174
+ Update `.aida/change_domains.yaml` + `.aida/validation_policy.yaml`, and add commands in `.aida/validation_registry.yaml` as needed.
175
+
176
+ ---
177
+
178
+ ## Upgrading / breaking changes
179
+
180
+ When AIDA source changes in a way that affects the MCP server executable, the installed tool set, or the MCP tool schema, you must **reinstall/refresh the MCP server setup** in your client.
181
+
182
+ - **Action**: rerun `cd packages/aida-mcp && make install`, then restart/reload your client.
183
+ - **Why**: clients cache the MCP server command + environment from MCP config files. Reinstall ensures the client points at the current `aida-mcp` executable and tool definitions.
184
+
185
+ ---
186
+
187
+ ## Repository setup
188
+
189
+ This repository is AIDA-ready (repo-owned `.aida/` and repo-local MCP stubs are committed), so you can install the tool and start using it immediately.
190
+
191
+ ---
192
+
193
+ Happy validating! Let the assistants run the noisy commands so you can stay focused on the code. For contributions, open an issue or follow the checklist in [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,174 @@
1
+ # AIDA (AI Developer Assistant)
2
+
3
+ FastMCP server (`aida-mcp`) that exposes GoodData's **unified validation** workflow (plus GitHub helpers and rules retrieval) over the MCP protocol. Use it from Cursor, Claude Code, JetBrains AI, or the CLI to run repo-configured lint/type/test/codegen pipelines without memorizing each project's workflow.
4
+
5
+ ---
6
+
7
+ ## TL;DR – Getting Started
8
+
9
+ ### Cursor / Claude Code / JetBrains AI
10
+ | Step | Command | Notes |
11
+ | --- | --- | --- |
12
+ | 1 | `cd packages/aida-mcp && make install` | Installs/updates the **packaged** MCP server (wheel) only. |
13
+ | 2 | `aida-mcp init` (run in your repo root) | Writes **repo-local** MCP config stubs (e.g. `.cursor/mcp.json`, `.mcp.json`) and onboarding files. Add `--vendor-rules` to enable vendor/example embedded rules. |
14
+ | 3 | Restart IDE / Agent | Tools appear as `aida` in the MCP panel. |
15
+ | 4 | Ask your assistant to "validate <service>" | The assistant calls the right tool automatically. |
16
+
17
+ Need the full local setup (Node, uv, multi-repo tips, troubleshooting)? See [CONTRIBUTING.md](CONTRIBUTING.md).
18
+
19
+ ---
20
+
21
+ ## Repo Config Files
22
+
23
+ AIDA reads repo-owned policy and routing from `.aida/`:
24
+ - `change_domains.yaml`
25
+ - `validation_policy.yaml`
26
+ - `validation_registry.yaml`
27
+ - `git_policy.yaml` (commit/PR/workflow knobs for git-related tools)
28
+ - `rules/**/*.mdc`
29
+
30
+ `aida-mcp init` bootstraps these files when missing.
31
+
32
+ ---
33
+
34
+ ## Tool Overview
35
+
36
+ | Tool | Highlights |
37
+ | --- | --- |
38
+ | `validate` | Unified validation tool. Computes scope (`pre_commit` / `pre_push`), routes via `.aida/*`, executes registry-defined commands with streaming progress. |
39
+ | `get_rules` | Retrieves relevant rules for the current task (hybrid lexical + embeddings), with transparent scoring/debug output. |
40
+ | `github_ci_errors` | Fetch size-capped CI failures for a PR (errors-only by default). |
41
+ | `github_comments` | List/reply/resolve PR review threads (non-interactive). |
42
+
43
+ **Progress Tracking**: `validate` streams real-time progress updates to Cursor using combined `ctx.report_progress()` + `ctx.info()` events. External validators can emit `AIDA_EVENT {json}` lines for richer progress while keeping full logs in artifacts.
44
+
45
+ Detailed behavior (step descriptions, parameters, and usage snippets) now lives in [docs/validation-tools.md](docs/validation-tools.md) to keep this README short.
46
+ If you only need the external command contract and config shape, start with [docs/external-validation-interface.md](docs/external-validation-interface.md).
47
+ Rules retrieval details live in [docs/rules-retrieval.md](docs/rules-retrieval.md).
48
+
49
+ ---
50
+
51
+ ## Architecture at a Glance
52
+
53
+ ```
54
+ packages/aida-mcp/
55
+ ├── src/
56
+ │ └── app/
57
+ │ ├── server/ # FastMCP entrypoint + tool registration
58
+ │ ├── tools/
59
+ │ │ ├── core/ # shared primitives (registry, change classifier, external tool helpers)
60
+ │ │ └── validate/ # unified validate engine (policy + external command execution)
61
+ │ └── utils/ # command runner, config loader, junit parsing, progress, timing, etc.
62
+ ├── config/ # bundled defaults (registry, tool configs)
63
+ ├── docs/ # detailed validation tool documentation
64
+ ├── tests/ # unit + integration suites
65
+ └── CONTRIBUTING.md # setup, workflows, troubleshooting
66
+ ```
67
+
68
+ Validation design:
69
+ - AIDA is language-agnostic for validation command execution.
70
+ - Validation commands are repo-owned external executables configured in `.aida/validation_registry.yaml`.
71
+ - Output processors remain built-in and reusable inside `packages/aida-mcp`.
72
+
73
+ ---
74
+
75
+ ## Using the Tools
76
+
77
+ ### From Cursor / Claude
78
+ 1. Install/update the MCP server via `cd packages/aida-mcp && make install`.
79
+ 2. Onboard the repo you want to use AIDA in via `aida-mcp init` (run in the repo root).
80
+ 2. In the editor, ask: “run validation” or “validate `microservices/gen-ai`”. The assistant calls `validate(scope=..., focus_paths=...)`.
81
+ 3. Routing and the exact commands run are repo-owned via `.aida/*`.
82
+
83
+ ### From the terminal
84
+
85
+ ```bash
86
+ cd packages/aida-mcp
87
+ aida-mcp # launches stdio server manually (once installed via uv tool)
88
+ ```
89
+
90
+ Commit helper (enforces footer policy and 70-char subject limit):
91
+
92
+ ```bash
93
+ aida-mcp commit \
94
+ --type chore \
95
+ --scope aida \
96
+ --title "add commit helper command" \
97
+ --body "Enforce risk footer ordering and metadata trailers." \
98
+ --jira DX-123 \
99
+ --risk nonprod
100
+ ```
101
+
102
+ Prefer running the command directly in this shape; do not probe with `aida-mcp commit --help` unless troubleshooting.
103
+
104
+ Optional metadata in the footer block:
105
+ - `--co-authored-by "Name <email>"` (repeatable)
106
+ - `--ai-share actor=percent` (repeatable, must sum to 100)
107
+ - `--ai-share-auto <actor>` for deterministic `<actor>=100` without guessing (policy-gated)
108
+ - multiline body support:
109
+ - `--body-file /path/to/body.txt`
110
+ - `--body-stdin` (pipe or heredoc)
111
+ - `--body-line ...` (repeatable)
112
+
113
+ `aida-mcp commit` policy values (for example title length, allowed `risk:` values, and optional required trailers) are configurable via `.aida/git_policy.yaml`.
114
+ `Co-authored-by` is explicit-only: pass `--co-authored-by` when available; if omitted, no co-author trailer is added.
115
+
116
+ Validation CLI shortcuts still live in the repo root:
117
+
118
+ ```bash
119
+ make format-fix lint-fix
120
+ make types
121
+ make test
122
+ make validate # fast default (format/lint/types + unit tests)
123
+ make validate-all # includes integration tests (slow)
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Troubleshooting & Workflow Guides
129
+
130
+ Rather than duplicating multiple pages of instructions here, refer to:
131
+ - [CONTRIBUTING.md](CONTRIBUTING.md): environment prep, Cursor integration, node/uv requirements, manual overrides, and how to add new tools/rules.
132
+ - [docs/validation-tools.md](docs/validation-tools.md): deep dive into each tool’s steps, parameters, and best practices.
133
+ - Developer onboarding docs under `docs/developer/` for broader GoodData setup.
134
+
135
+ ---
136
+
137
+ ## FAQ
138
+
139
+ **Why a single `validate` tool?**
140
+ Repo-owned routing (`.aida/*`) lets `aida-mcp` live in a separate repo while still executing GoodData-specific validations (often via external wrappers) with streaming progress.
141
+
142
+ **Can I add custom output processors as external commands?**
143
+ Not in unified validate today. Processors are built-in only; for custom behavior, either emit JSON consumed by `external_json` or add a new reusable built-in processor in `packages/aida-mcp`.
144
+
145
+ **Can I run Docker/OpenAPI without rewriting commands?**
146
+ Yes—when the repo’s `.aida/validation_policy.yaml` routes those steps. Add dedicated pipelines/commands for `docker`/`openapi` when needed.
147
+
148
+ **What happens if the MCP client disconnects during validation?**
149
+ The server gracefully handles invalid or closed MCP contexts. Progress updates are silently skipped if the context becomes unavailable, preventing server crashes. Validation continues to completion and returns results normally.
150
+
151
+ **What if Python tests fail with "duplicate file name metadata.proto"?**
152
+ The Python validator automatically detects this common issue (stale protobuf artifacts in `.venv`) and runs `make ultra-clean` + `make dev` to rebuild the environment, then retries the test step. This recovery is transparent and only triggers when needed.
153
+
154
+ **How do I extend validation routing?**
155
+ Update `.aida/change_domains.yaml` + `.aida/validation_policy.yaml`, and add commands in `.aida/validation_registry.yaml` as needed.
156
+
157
+ ---
158
+
159
+ ## Upgrading / breaking changes
160
+
161
+ When AIDA source changes in a way that affects the MCP server executable, the installed tool set, or the MCP tool schema, you must **reinstall/refresh the MCP server setup** in your client.
162
+
163
+ - **Action**: rerun `cd packages/aida-mcp && make install`, then restart/reload your client.
164
+ - **Why**: clients cache the MCP server command + environment from MCP config files. Reinstall ensures the client points at the current `aida-mcp` executable and tool definitions.
165
+
166
+ ---
167
+
168
+ ## Repository setup
169
+
170
+ This repository is AIDA-ready (repo-owned `.aida/` and repo-local MCP stubs are committed), so you can install the tool and start using it immediately.
171
+
172
+ ---
173
+
174
+ Happy validating! Let the assistants run the noisy commands so you can stay focused on the code. For contributions, open an issue or follow the checklist in [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,95 @@
1
+ [project]
2
+ name = "aida-mcp"
3
+ version = "0.1.2.dev1"
4
+ description = "AIDA MCP server - Developer actions (lint, test, typecheck) for monorepos"
5
+ authors = [{name = "GoodData Corporation", email = "support@gooddata.com"}]
6
+ readme = "README.md"
7
+ requires-python = ">=3.12,<3.14"
8
+ dependencies = [
9
+ "mcp>=1.25.0",
10
+ "pydantic>=2.10.6",
11
+ "structlog>=25.3.0",
12
+ "junitparser>=3.1.2",
13
+ "orjson>=3.11.5",
14
+ "pyyaml>=6.0.1",
15
+ "httpx>=0.28.0",
16
+ # Embeddings for semantic rule retrieval
17
+ "sentence-transformers>=3.0.0",
18
+ # dependency for sentence-transformers
19
+ "torch>=2.9.0",
20
+ "numpy>=1.26.0",
21
+ "langchain-text-splitters>=0.2.0",
22
+ ]
23
+
24
+ [project.scripts]
25
+ aida-mcp = "aida_mcp.server.cli:main"
26
+
27
+ [dependency-groups]
28
+ dev = [
29
+ "ruff>=0.11.5",
30
+ "ty>=0.0.14",
31
+ "pytest>=8.3.5",
32
+ "pytest-asyncio>=0.25.3",
33
+ "pytest-cov>=6.0.0",
34
+ "coverage>=7.6.0",
35
+ ]
36
+
37
+ [build-system]
38
+ requires = ["hatchling"]
39
+ build-backend = "hatchling.build"
40
+
41
+ [tool.hatch.build]
42
+ include = ["src/aida_mcp/**/*"]
43
+ ignore-vcs = true
44
+
45
+ [tool.hatch.build.targets.wheel]
46
+ packages = ["src/aida_mcp"]
47
+
48
+ [tool.ruff]
49
+ line-length = 120
50
+ target-version = "py312"
51
+ exclude = [
52
+ ".git",
53
+ ".venv",
54
+ "venv",
55
+ "__pycache__",
56
+ "build",
57
+ "dist",
58
+ ]
59
+
60
+ [tool.ruff.lint]
61
+ select = [
62
+ "E",
63
+ "F",
64
+ "I",
65
+ "N",
66
+ "UP",
67
+ "W",
68
+ "C4",
69
+ "PIE",
70
+ "SIM",
71
+ ]
72
+ ignore = [
73
+ "E501", # Line too long (handled by formatter)
74
+ ]
75
+
76
+ [tool.ruff.lint.isort]
77
+ force-wrap-aliases = true
78
+ combine-as-imports = true
79
+
80
+ [tool.pytest.ini_options]
81
+ asyncio_default_fixture_loop_scope = "function"
82
+ testpaths = ["tests"]
83
+ pythonpath = ["src"]
84
+
85
+ [tool.ty.environment]
86
+ # Keep aligned with `gooddata-python-sdk` configuration.
87
+ extra-paths = ["src"]
88
+
89
+ [[tool.uv.index]]
90
+ name = "pytorch"
91
+ url = "https://download.pytorch.org/whl/cpu"
92
+ explicit = true
93
+
94
+ [tool.uv.sources]
95
+ torch = { index = "pytorch" }
@@ -0,0 +1 @@
1
+ """AIDA (AI Developer Assistant) - Developer action tools for GoodData monorepo."""
@@ -0,0 +1,6 @@
1
+ """Embedded rules shipped with the aida-mcp package.
2
+
3
+ This package is intentionally designed to make `get_rules` portable across repos:
4
+ - `general/`: reusable, repo-agnostic rules (always available)
5
+ - `vendor/`: vendor-specific rules (default-on, configurable via env toggle)
6
+ """
@@ -0,0 +1 @@
1
+ """General embedded rules (repo-agnostic)."""
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: Commit and push workflow - require aida-mcp commit and enforce tool co-author identity
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Commit and push workflow
7
+
8
+ ## Preferred_commit_command
9
+ - `aida-mcp commit` is mandatory for commit creation.
10
+ - Do not use raw `git commit` in normal assistant flow.
11
+ - Use the direct command template instead of probing with `aida-mcp commit --help`.
12
+ - Canonical command shape:
13
+ - `aida-mcp commit --type <type> --scope <scope> --title "<title>" --body "<body>" --risk <value> --jira <ID>`
14
+ - optional metadata: `--co-authored-by "Name <email>"`, `--ai-share-auto <actor>`, `--ai-share actor=percent`
15
+
16
+ ## Commit_message_policy
17
+ - Source of truth is repository commit policy.
18
+ - `risk:` footer is mandatory.
19
+ - `JIRA:` is optional and policy-driven.
20
+ - Keep `risk:` as the last footer line.
21
+ - On `pre_push`, validate commit messages in `upstream..HEAD` against policy (including subject length and footer rules).
22
+
23
+ ## AI_metadata_policy
24
+ - Include AI contribution metadata via `aida-mcp commit`.
25
+ - Use deterministic `--ai-share-auto <actor>` only when policy-enabled and authorship is clearly single-AI.
26
+ - Use `--ai-share actor=percent` for known mixed contribution only.
27
+ - If split is unknown, ask user instead of guessing.
28
+ - `Co-authored-by` must identify the assistant/tool identity, never a human user.
29
+ - Use canonical trailer name and casing: `Co-authored-by:`.
30
+ - Pass `--co-authored-by "Name <email>"` explicitly with a tool identity. Approved examples:
31
+ - `Co-authored-by: Cursor GPT 5.3 Codex <cursoragent@cursor.com>`
32
+ - `Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>`
33
+
34
+ ## Fixups_and_history
35
+ - Use `git commit --fixup=<sha>` for follow-up changes.
36
+ - Autosquash only for unpublished history.
37
+ - For published history, add a new commit instead of rewriting.
38
+
39
+ ## Non_interactive_git_execution
40
+ - Never run interactive Git commands in assistant flow.
41
+ - Always disable editor prompts for rebase/merge continuation:
42
+ - `GIT_EDITOR=true GIT_SEQUENCE_EDITOR=true GIT_MERGE_AUTOEDIT=no git rebase --continue`
43
+ - `GIT_EDITOR=true GIT_SEQUENCE_EDITOR=true GIT_MERGE_AUTOEDIT=no git cherry-pick --continue`
44
+ - If a commit command may open an editor, pass message arguments explicitly or set:
45
+ - `GIT_EDITOR=true` for that command invocation.
46
+ - Do not use interactive flags (for example `-i`) in automation paths.
47
+
48
+ ## Safe_push
49
+ - Prefer `git push <remote> <branch> --force-with-lease` on feature branches.
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: Git/GitHub router (entrypoint for commit, PR, and review workflows)
3
+ alwaysApply: false
4
+ required:
5
+ - github/commit-and-push.mdc
6
+ ---
7
+
8
+ # Git & GitHub (router)
9
+
10
+ ## When_to_use
11
+ - Query mentions: `git`, `github`, `commit`, `push`, `pull request`, `review comment`, `CI error`, `JIRA:`, `risk:`, `fixup`, `autosquash`
12
+
13
+ ## Owns
14
+ - Entrypoint for Git/GitHub workflows.
15
+ - Pull in detailed commit/PR/review guidance by topic.
16
+
17
+ ## How_to_query_get_rules
18
+ - Prefer concrete queries:
19
+ - `commit then push with risk footer`
20
+ - `create pull request title body`
21
+ - `reply to review comments and CI failures`
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Pull request workflow - concise outcome-focused PRs with policy footer
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Pull requests
7
+
8
+ ## Title_and_body
9
+ - Title: short, outcome-focused.
10
+ - Body: what changed, why, and how to verify.
11
+
12
+ ## Workflow
13
+ - Before PR creation/update, inspect branch state and included commits.
14
+ - Ensure branch is pushed/up-to-date before creating/updating PR.
15
+
16
+ ## Required_footer
17
+ - Include required footer lines per repository policy/rules.
18
+ - Include required footer lines at the end of PR body.
19
+
20
+ ## Assistant_response_style
21
+ - After creating/updating a PR, respond briefly.
22
+ - Do not include PR URL by default.
23
+ - Share URL only when user explicitly requests it.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: PR review and CI workflow - reply/resolve review threads and fetch CI failures
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Review comments and CI workflow
7
+
8
+ ## Review_threads
9
+ - Reply inline using `github_comments(action="reply_to_review_comment", comment_url="...#discussion_r<ID>", body="...")`.
10
+ - For code-change comments: implement -> validate -> commit -> push -> reply -> resolve.
11
+ - For rationale-only comments: reply clearly, then resolve.
12
+
13
+ ## Resolve_threads
14
+ - Resolve with `github_comments(action="resolve_review_thread", comment_url="...#discussion_r<ID>")`.
15
+ - Do not resolve code-change threads before fixes are pushed.
16
+
17
+ ## CI_failures
18
+ - Preferred: `github_ci_errors(pr_number=..., repo="owner/repo")`.
19
+ - Retry with `include_log_tails=True` only if annotations are insufficient.