-
Notifications
You must be signed in to change notification settings - Fork 37
feat: MCP Server #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: MCP Server #244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces Model Context Protocol (MCP) server support to the Cloudsmith CLI, enabling AI assistants to interact with Cloudsmith's API through natural language. The implementation dynamically generates MCP tools from OpenAPI specifications, optimizes responses using TOON format, and provides configurable tool exposure to manage LLM context windows.
Key changes:
- Bumped minimum Python requirement from 3.9 to 3.10 (required by MCP SDK dependencies)
- Added MCP server infrastructure with dynamic tool generation from OpenAPI specs
- Introduced new CLI commands for MCP server management (start, list_tools, list_groups, configure)
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updated minimum Python version requirement from 3.9.0 to 3.10.0 |
| requirements.txt | Added MCP SDK and related dependencies (mcp, pydantic, httpx, toon-python, etc.) |
| requirements.in | Added toon-python and mcp packages as direct dependencies |
| cloudsmith_cli/core/mcp/server.py | Implements DynamicMCPServer class that generates tools from OpenAPI specs and handles MCP requests |
| cloudsmith_cli/core/mcp/data.py | Defines data classes for OpenAPI tools and application context |
| cloudsmith_cli/core/mcp/init.py | Empty init file for MCP module |
| cloudsmith_cli/cli/decorators.py | Added initialise_mcp decorator and updated common_cli_config_options to support profile inheritance |
| cloudsmith_cli/cli/config.py | Added configuration parameters for MCP allowed tools and tool groups |
| cloudsmith_cli/cli/commands/mcp.py | Implements MCP CLI commands (start, list_tools, list_groups, configure) |
| cloudsmith_cli/cli/commands/init.py | Registered mcp module in CLI commands |
| .pylintrc | Increased max-attributes from 7 to 10 to accommodate new class structures |
| .flake8 | Increased max-complexity from 20 to 22 for new server logic |
| .circleci/config.yml | Updated base Docker image to Python 3.10 and removed redundant Python 3.10 test job |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
MrTam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome; I hope the upgrade to 3.10 is okay for everyone (it's EOL, so I think that's completely acceptable now).
Only concern I have really is with the clients, it'd be nicer to have a broader spectrum of allowed, like copilot (we use that!), and gemini (pretty damn good/common now). But for the future! This is a great first step 🙌
dkatavic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 🎉
|
Support for JSON output has been added: Configure command: List tools command: List groups command: |
This reverts commit f264ee1.
Add MCP Server Support to Cloudsmith CLI
This PR introduces Model Context Protocol (MCP) server support to the Cloudsmith CLI, enabling AI assistants and other MCP clients to interact with Cloudsmith's API programmatically.
What is MCP?
The Model Context Protocol is an open standard that enables AI assistants to securely connect to external data sources and tools. By adding MCP server support to the Cloudsmith CLI, users can now leverage AI assistants (like Claude Desktop, and others) to manage their Cloudsmith repositories, packages, and artifacts through natural language.
Key Features
x-simplifiedparameter in the OpenAPI spec) to minimize token usage and improve performanceDefault Available Tools
The MCP server dynamically generates tools from Cloudsmith's OpenAPI specification, which results in a very large number of available tools. While this provides complete API coverage, exposing all tools simultaneously would immediately fill the LLM's context windows.
To address this, the server exposes only a curated subset of commonly-used tools by default. Users can customize which tools and tool groups are available based on their specific workflows, ensuring MCP clients remain efficient and responsive while still providing access to the full API when needed.
The list of tools is filtered by disabling certain categories found here https://github.com/cloudsmith-io/cloudsmith-cli/blob/eng-9528/mcp-integration/cloudsmith_cli/core/mcp/server.py#L38
Commands Added
Configuration
Control which tools are exposed by adding configuration to
~/.cloudsmith/config.ini:This exposes the specified individual tools and all tools within the listed tool groups.
Breaking Changes
This release requires Python 3.10 or later due to MCP SDK dependencies.
Additional Notes
cloudsmith authbefore starting the MCP server as MCP clients will not trigger the SSO authentication flow automatically