Skip to content

DEV-1259: MCP dep fix#32

Merged
AivanF merged 1 commit into
mainfrom
aivan/dev-1259-slayer-quickstart-MCP-dep-issue
Apr 16, 2026
Merged

DEV-1259: MCP dep fix#32
AivanF merged 1 commit into
mainfrom
aivan/dev-1259-slayer-quickstart-MCP-dep-issue

Conversation

@AivanF
Copy link
Copy Markdown
Collaborator

@AivanF AivanF commented Apr 16, 2026

Summary by CodeRabbit

  • Documentation

    • Updated getting-started and reference guides and examples to use the base package for SQLite/MCP (remove the previous MCP-only extra).
  • Chores

    • Made MCP a required dependency (no extra install flag).
    • Clarified the error message when the MCP package is missing to instruct reinstalling the package.

@AivanF AivanF requested a review from whimo April 16, 2026 10:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b4828f0e-e657-4118-857c-81c887d5e0cd

📥 Commits

Reviewing files that changed from the base of the PR and between bf352f5 and 4056411.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • docs/getting-started/mcp.md
  • docs/reference/mcp.md
  • pyproject.toml
  • slayer/api/server.py
  • slayer/mcp/server.py
✅ Files skipped from review due to trivial changes (3)
  • docs/getting-started/mcp.md
  • slayer/mcp/server.py
  • docs/reference/mcp.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • pyproject.toml
  • slayer/api/server.py

📝 Walkthrough

Walkthrough

Made the MCP package a required dependency (removed optional extra), updated documentation and examples to drop the [mcp] extra, adjusted pyproject metadata, and slightly refactored/import-reordered server code and an ImportError message.

Changes

Cohort / File(s) Summary
Documentation
docs/getting-started/mcp.md, docs/reference/mcp.md
Removed motley-slayer[mcp] examples, updated command and JSON examples to use motley-slayer or motley-slayer[postgres], and clarified base install includes SQLite/MCP.
Dependency metadata
pyproject.toml
Promoted mcp from an optional extra to a required dependency; removed the mcp extras entry and removed mcp from the all extra.
Server code
slayer/api/server.py, slayer/mcp/server.py
Moved/added module-level MCP import in api/server.py, refactored formatting of request/response construction, and updated an ImportError message in mcp/server.py to reference reinstalling motley-slayer (no logic changes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • DEV-1235: uv support #19 — Similar documentation and example updates switching away from the [mcp] extra and adjusting install/uvx examples.

Suggested reviewers

  • whimo

Poem

🐰 I nibbled docs and nudged the pack,

No extras dangling on my back.
MCP hops in, no brackets to see,
One tidy install — simpler and free! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'DEV-1259: MCP dep fix' is vague and uses non-descriptive terminology that doesn't clearly convey what the changeset accomplishes. Consider a more descriptive title like 'Make MCP a required dependency' or 'Move MCP from optional to required dependency' to clarify the main change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aivan/dev-1259-slayer-quickstart-MCP-dep-issue

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
slayer/mcp/server.py (1)

115-116: Preserve the original import failure context by chaining the exception.

The ImportError raised at line 116 drops the original exception cause, which loses diagnostic information. Chain it with from exc so the traceback retains the actual import error.

Proposed fix
-    except ImportError:
-        raise ImportError("MCP package not found. Reinstall SLayer: pip install motley-slayer")
+    except ImportError as exc:
+        raise ImportError(
+            "MCP package not found. Reinstall SLayer: pip install motley-slayer"
+        ) from exc
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@slayer/mcp/server.py` around lines 115 - 116, The except ImportError block in
slayer/mcp/server.py currently swallows the original import error; update the
handler to capture the exception (use "except ImportError as exc") and re-raise
the new ImportError with chaining ("raise ImportError('MCP package not found.
Reinstall SLayer: pip install motley-slayer') from exc") so the original
traceback is preserved when importing in the MCP initialization code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/getting-started/mcp.md`:
- Line 16: Several MCP documentation references still include the extra "mcp" in
the package extras list; replace every occurrence of the string
"motley-slayer[mcp,postgres]" with "motley-slayer[postgres]" in the MCP
documentation files (the getting-started and reference MCP docs). Search for the
exact token "motley-slayer[mcp,postgres]" and update it to
"motley-slayer[postgres]" in each occurrence so the extras list no longer
contains "mcp".

In `@docs/reference/mcp.md`:
- Line 28: Replace the incorrect extras specification
"motley-slayer[mcp,postgres]" with "motley-slayer[postgres]" in the command
examples so MCP isn't redundantly listed (update every occurrence of the literal
string "motley-slayer[mcp,postgres]" to "motley-slayer[postgres]" in the docs
reference for MCP); ensure the three command snippets that currently include
"mcp" in the extras are updated and leave other text unchanged.

---

Nitpick comments:
In `@slayer/mcp/server.py`:
- Around line 115-116: The except ImportError block in slayer/mcp/server.py
currently swallows the original import error; update the handler to capture the
exception (use "except ImportError as exc") and re-raise the new ImportError
with chaining ("raise ImportError('MCP package not found. Reinstall SLayer: pip
install motley-slayer') from exc") so the original traceback is preserved when
importing in the MCP initialization code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 68434329-b710-454f-be1d-a5482c415524

📥 Commits

Reviewing files that changed from the base of the PR and between 98b1da8 and bf352f5.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • docs/getting-started/mcp.md
  • docs/reference/mcp.md
  • pyproject.toml
  • slayer/api/server.py
  • slayer/mcp/server.py

Comment thread docs/getting-started/mcp.md
Comment thread docs/reference/mcp.md
@AivanF AivanF force-pushed the aivan/dev-1259-slayer-quickstart-MCP-dep-issue branch from bf352f5 to 4056411 Compare April 16, 2026 11:17
@AivanF AivanF merged commit bdce4d8 into main Apr 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant