Skip to content

Conversation

joshyam-k
Copy link
Contributor

@joshyam-k joshyam-k commented Oct 14, 2025

Intent

Add a simple MCP server with the goal of improving LLM interactions with the rsconnect cli

Resolves https://github.com/posit-dev/connect/issues/33653

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

Compile structured context about each cli command by walking the click decorators at MCP server startup

  • implement simple MCP tool that returns full context (description, help, parameters) about a command
  • handles nested subcommands (deploy shiny, content build add, etc)

Automated Tests

Added unit tests for command parameter schema discovery

Directions for Reviewers

Manually inspect using

npx @modelcontextprotocol/inspector uvx --from git+https://github.com/posit-dev/rsconnect-python.git@jy/mcp-server rsconnect mcp-server

try out for yourself locally using claude:

claude mcp add rsc -- uvx --from 'git+https://github.com/posit-dev/rsconnect-python.git@jy/mcp-server[mcp]' rsconnect mcp-server

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.

Copy link

github-actions bot commented Oct 14, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://posit-dev.github.io/rsconnect-python/pr-preview/pr-712/

Built to branch gh-pages at 2025-10-17 17:07 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

github-actions bot commented Oct 14, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
5252 4001 76% 0% 🟢

New Files

File Coverage Status
rsconnect/mcp_deploy_context.py 0% 🟢
TOTAL 0% 🟢

Modified Files

File Coverage Status
rsconnect/main.py 67% 🟢
TOTAL 67% 🟢

updated for commit: fc38445 by action🐍

import pytest

# Skip entire module if fastmcp is not available (requires Python 3.10+)
pytest.importorskip("fastmcp", reason="fastmcp library not installed (requires Python 3.10+)")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need this to make sure we don't try to run this test on tests being run on python<3.10

@joshyam-k joshyam-k marked this pull request as ready for review October 15, 2025 14:49
Comment on lines +485 to +486
Available top-level commands:
{commands_list}
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ . Great stuff. Makes this evergreen

@mconflitti-pbc
Copy link
Contributor

Can you please add info about this feature in the readme, docs, etc?

Copy link
Contributor

@mconflitti-pbc mconflitti-pbc left a comment

Choose a reason for hiding this comment

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

Looks good and works! Approved but would recommend adding the necessary docs. Good work!

@joshyam-k
Copy link
Contributor Author

joshyam-k commented Oct 17, 2025

Can you please add info about this feature in the readme, docs, etc?

@mconflitti-pbc Do you think we need to list the various ways to add this to some of the popular LLM clients? (i.e claude code, vscode, cursor). While useful, I worry about this being susceptible to going stale quickly.

Here's the current state of the docs for the command: https://posit-dev.github.io/rsconnect-python/pr-preview/pr-712/commands/mcp-server/

@mconflitti-pbc
Copy link
Contributor

Can you please add info about this feature in the readme, docs, etc?

@mconflitti-pbc Do you think we need to list the various ways to add this to some of the popular LLM clients? (i.e claude code, vscode, cursor). While useful, I worry about this being susceptible to going stale quickly.

Maybe just link out to the docs on how to do that for the most popular tools: codex, claude, vs code

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.

2 participants