MCP server for Conan package manager
Project description
Conan MCP Server
A Model Context Protocol server for Conan package manager integration.
Usage Examples
"Create a CMake library project with Conan that has the latest version of fmt and openssl as requirements, install the dependencies and verify that the libraries I depend on don't have serious vulnerabilities and have a license that allows my application to be commercial."
Installation
Requirements
- Python >= 3.10
- Conan installed
Install from PyPI
Install the package from PyPI:
pip install conan-mcp
Or using uv:
uv pip install conan-mcp
MCP Configuration
Add to your mcp.json:
Using uvx (recommended):
{
"mcpServers": {
"conan": {
"command": "uvx",
"args": ["conan-mcp"]
}
}
}
Or using uv run:
{
"mcpServers": {
"conan": {
"command": "uv",
"args": ["run", "conan-mcp"]
}
}
}
Note: Both
uvxanduv runare provided by uv. If you don't haveuvinstalled, you can install it or usepip install conan-mcpand then useconan-mcpdirectly as the command.
Configuring Conan Binary Path
By default, the server uses conan from the system PATH (or the virtual environment where the MCP server is running). If you need to use a specific Conan installation or version, you can set the CONAN_MCP_CONAN_PATH environment variable in your MCP configuration:
{
"mcpServers": {
"conan": {
"command": "uv",
"args": ["--directory", "/path/to/conan-mcp", "run", "conan-mcp"],
"env": {
"CONAN_MCP_CONAN_PATH": "/home/user/venv/bin/conan"
}
}
}
}
If CONAN_MCP_CONAN_PATH is not set, the server will use conan from PATH or
the virtual environment where the MCP server is running.
Available Tools
get_conan_profile:
Get Conan profile configuration
Parameters:
profile(optional): If provided, show that specific profile; otherwise, default
Usage examples:
- "What is my default Conan profile?"
- "Show me the linux-debug profile configuration"
list_conan_profiles
List available Conan profiles
Parameters:
- No parameters
Usage examples:
- "What Conan profiles do I have available?"
create_conan_project
Create a new Conan project with specified dependencies
Parameters:
template(required): Template type for the project.- Libraries:
cmake_lib(default),header_lib,meson_lib,msbuild_lib,bazel_lib,autotools_lib - Executables:
cmake_exe(default),meson_exe,msbuild_exe,bazel_exe,autotools_exe
- Libraries:
name(required): Name of the projectversion(optional): Version of the project (default: "0.1")requires(optional): List of dependencies with versions (e.g., ["fmt/12.0.0", "openssl/3.6.0"])tool_requires(optional): List of tool dependencies (e.g., ["cmake/4.1.2", "ninja/1.13.1", "meson/1.9.1"])work_dir(required): Working directory where the command should be executed. The project will be created directly in this directory.force(optional): Overwrite existing files if they exist (default: False)
Usage examples:
- "Create a new CMake executable project called 'myapp' with fmt and openssl dependencies"
- "Create a header-only library project called 'mylib'"
- "Create a Meson executable project with gtest and spdlog dependencies"
- "Create a CMake library project with boost dependencies and cmake tool_requires"
list_conan_packages
List recipes and packages from the local cache or configurated remotes
Parameters:
name(required): Package name.version(optional): Version or version range.user(optional): User name to search.channel(optional): Channel name to search.recipe_revision(optional): Recipe revision (rrev). Use"*"for all,"latest"for latest.package_id(optional): Package ID. Use"*"for all packages.filter_settings(optional): List of setting filters. E.g.["arch=armv8", "os=Windows"].filter_options(optional): List of option filters. E.g.["*:fPIC=True", "*:shared=False"].remote(optional): Remote name to search in. Use"*"for all.search_in_cache(optional): Whether to include the local cache in the search.
Usage examples:
- "List all available versions for fmt in conancenter"
- "List versions of zlib with architecture armv8 and shared=False"
- "Show all zlib packages for Windows armv8 in my local cache"
- "List all packages that contain boost in the name in conancenter"
- "Search for fmt versions greater than or equal to 8.0 but less than 9.0 in conancenter"
- "Search for zlib versions compatibles with 1.3.x in every remote"
- "List versions of poco provided by user barbarian and channel stable in local cache"
- "Provide all packages for zlib 1.3 that use the recipe at revision b3b71bfe8dd07abc7b82ff2bd0eac021 in conancenter"
install_conan_packages
Install all dependencies of a Conan recipe, producing a full dependency graph.
Parameters:
path(required): Path to the folder containing the recipe, or to aconanfile.txtorconanfile.py. This path is ALWAYS relative towork_dir.work_dir(required): Working directory where the command should be executed. This is the base directory from which all paths are resolved.remote(optional): Name of the remote to search for dependencies. If omitted, all remotes are searched.search_in_cache(optional): Do not use remote, resolve exclusively in the cache.settings_host(optional): List of settings (host context) to override. Example:["arch=armv8", "os=Windows", "build_type=Release"]options_host(optional): List of options (host context) to override. Example:["fPIC=True", "shared=False"]build_missing(optional): Boolean, build missing binary dependencies from source if not available (falseby default).
Usage examples:
- "Install dependencies in this project using conancenter"
- "Install dependencies from ~/project for architecture armv8, and shared=False build the missing binaries"
- "Install dependencies in this project use windows profile for host and linux profile for build"
get_conan_licenses
Collect license information for Conan package dependencies. This tool uses conan graph info to extract license information from the dependency graph for all packages.
Only packages in the "host" context are analyzed (build context packages are excluded as they are build-time tools and not included in the final product).
Parameters:
work_dir(required): Working directory where the command should be executed. This is the base directory from which all paths are resolved.path(required): Path to the folder containing the recipe, or to aconanfile.txtorconanfile.py. This path is ALWAYS relative towork_dir.remote(optional): Name of the remote to search for dependencies. If omitted, all remotes are searched.build_profile(optional): Profile to the build context.host_profile(optional): Profile to the host context.
Usage examples:
- "Collect license information for dependencies in this project"
- "Get all licenses from my project dependencies"
- "Collect license information for conanfile.py in ~/my_project using the windows profile"
scan_conan_dependencies
Scan Conan packages and dependencies for security vulnerabilities
Parameters:
work_dir(required): Working directory where the command should be executed. This is the base directory from which all paths are resolved.path(optional): Path to the folder containing the recipe or to aconanfile.txt/conanfile.py. This path is ALWAYS relative towork_dir.reference(optional): Conan reference of a specific package to audit, e.g."fmt/12.0.0". Use this instead ofpathto audit only a specific package and not its dependencies.
Note:
pathandreferenceare mutually exclusive. Only one of them should be provided at a time.
Usage examples:
- "Scan dependencies in this project for known vulnerabilities"
- "Scan the latest version of zlib for vulnerabilities"
Local Development
Clone and run
# Clone the repository
git clone https://github.com/conan-io/conan-mcp.git
cd conan-mcp
# Install dependencies
uv sync
# Run the server
uv run conan-mcp
Local MCP configuration
For local development, use the absolute path:
{
"mcpServers": {
"conan": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/conan-mcp", "run", "conan-mcp"]
}
}
}
Testing with MCP Inspector
You can test the server using the MCP Inspector to verify it's working correctly:
uv run mcp dev main.py
Running Conan MCP Server tests
See test/README.md for detailed testing instructions.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file conan_mcp-0.1.0.tar.gz.
File metadata
- Download URL: conan_mcp-0.1.0.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f7d04001b6385ad77f6186a633a8269149c685119eff5a8842e5c13b104cf4f
|
|
| MD5 |
495c454e7d0e30d6234b3ba384605256
|
|
| BLAKE2b-256 |
16cbed2c1f46b63ffe7d866a578c8e781d4f2e88c508626c2e9a78e89dcdbaf9
|
Provenance
The following attestation bundles were made for conan_mcp-0.1.0.tar.gz:
Publisher:
release.yml on conan-io/conan-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
conan_mcp-0.1.0.tar.gz -
Subject digest:
5f7d04001b6385ad77f6186a633a8269149c685119eff5a8842e5c13b104cf4f - Sigstore transparency entry: 697302145
- Sigstore integration time:
-
Permalink:
conan-io/conan-mcp@78d67f26915c7eabf9fa772f22cdc334ced28115 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/conan-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@78d67f26915c7eabf9fa772f22cdc334ced28115 -
Trigger Event:
release
-
Statement type:
File details
Details for the file conan_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: conan_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40dc29f5d6cec44da0d920f5ddff1975f0c73c2edc224a0853b34086a2637b7e
|
|
| MD5 |
6161b1882befbbeb8d4e4f72555551fe
|
|
| BLAKE2b-256 |
5e3a29b79a06d5d7d3dbc7112514f092d1970d666f75c1da2d7129ca7b127fe7
|
Provenance
The following attestation bundles were made for conan_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on conan-io/conan-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
conan_mcp-0.1.0-py3-none-any.whl -
Subject digest:
40dc29f5d6cec44da0d920f5ddff1975f0c73c2edc224a0853b34086a2637b7e - Sigstore transparency entry: 697302190
- Sigstore integration time:
-
Permalink:
conan-io/conan-mcp@78d67f26915c7eabf9fa772f22cdc334ced28115 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/conan-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@78d67f26915c7eabf9fa772f22cdc334ced28115 -
Trigger Event:
release
-
Statement type: