Apt MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Apt MCP Server list upgradable packages"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Apt MCP Server
A TypeScript-based Model Context Protocol (MCP) server for controlling the apt package manager on Linux. Designed for integration with AI agents (e.g., Cursor, Claude Desktop, Windsurf) and developer tools, it exposes tools for installing, removing, updating, and querying apt packages using the system's native apt and dpkg binaries with sudo privileges.
Features
Install, remove, update, and query apt packages via MCP tools
Secure, passwordless
sudoassumed for all operationsInput validation and robust error handling
Consistent, human-readable output for all tools
Designed for stdio transport (default for local AI agent integration)
Related MCP server: mcp-remote-agent
Setup & Installation
Clone the repository:
git clone <your-repo-url> cd popos-control-mcpInstall dependencies:
npm installBuild the project:
npm run buildRun the server (stdio transport):
npm run dev # or npm start
Note: The server assumes the user has passwordless
sudofor apt operations.
Tools & API Endpoints
All tools are exposed via MCP and can be called by AI agents or clients. Each tool returns a plain text response with a summary, stdout, stderr, and logs (if any).
1. installAptPackage
Description: Install one or more apt packages.
Parameters:
packages: array of package names (e.g.,["curl", "git"])
Example Input:
{ "packages": ["curl"] }Example Output:
Result: SUCCESS Summary: Apt install succeeded for: curl [stdout] ... [stderr] ...
2. removeAptPackage
Description: Remove one or more apt packages.
Parameters:
packages: array of package names
Example Input:
{ "packages": ["curl"] }Example Output:
Result: SUCCESS Summary: Apt remove succeeded for: curl [stdout] ... [stderr] ...
3. queryAptPackageStatus
Description: Query if a package is installed, available, or upgradable.
Parameters:
package: package name (string)
Example Input:
{ "package": "curl" }Example Output:
Result: SUCCESS Summary: Status for package curl: Installed=installed, Upgradable=false, Available=available [stdout] Package: curl Installed: installed Upgradable: no Available: available
4. updateAptPackages
Description: Update the apt package list and upgrade all packages.
Parameters: none
Example Input:
{}Example Output:
Result: SUCCESS Summary: Apt update and upgrade completed successfully. [stdout] apt update stdout: ... apt upgrade stdout: ... [stderr] ...
5. listUpgradableAptPackages
Description: List all upgradable apt packages.
Parameters: none
Example Input:
{}Example Output:
Result: SUCCESS Summary: Listed upgradable packages successfully. [stdout] ... [stderr] ...
6. upgradeSpecificAptPackage
Description: Upgrade a specific apt package.
Parameters:
package: package name (string)
Example Input:
{ "package": "curl" }Example Output:
Result: SUCCESS Summary: Apt only-upgrade succeeded for: curl [stdout] ... [stderr] ...
Example Usage
CLI (stdio transport)
You can test the server using the MCP CLI or by connecting with an AI agent (e.g., Cursor, Claude Desktop).
Node.js Example
const { Client } = require("@modelcontextprotocol/sdk/client");
const { StdioClientTransport } = require("@modelcontextprotocol/sdk/client/stdio");
const client = new Client({ name: "test-client", version: "1.0.0" });
const transport = new StdioClientTransport();
(async () => {
await client.connect(transport);
const result = await client.callTool("installAptPackage", { packages: ["curl"] });
console.log(result);
})();Error Handling & Troubleshooting
All errors are returned in a consistent format with
Result: ERRORand a summary.Common error causes:
Invalid package name: check spelling and allowed characters
Package not found: ensure the package exists in your repositories
Permission denied: ensure passwordless sudo is configured
Apt lock: the server retries once automatically, but if the error persists, wait and try again
Example error output:
Result: ERROR Summary: Apt install failed: E: Unable to locate package notarealpackage [stdout] ... [stderr] E: Unable to locate package notarealpackage
FAQ
Q: Does the server require passwordless sudo? A: Yes, all apt/dpkg commands are run with sudo and assume no password prompt.
Q: What transport does the server use? A: Stdio by default, for easy integration with local AI agents and tools.
Q: Can I use this server remotely? A: You can adapt it to use HTTP/SSE transport, but stdio is recommended for local/agent use.
Q: How do I add new tools?
A: Add a new server.addTool block in src/index.ts following the existing pattern.
License
MIT
Available Tools
10 toolsautoremoveAptPackagesA
Remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
Inputs: no named parameters.
holdAptPackageB
Hold one or more apt packages to prevent them from being upgraded.
Inputs: packages (required).
installAptPackageB
Install one or more apt packages using sudo.
Inputs: packages (required).
listUpgradableAptPackagesA
List all upgradable apt packages.
Inputs: no named parameters.
pingA
Check if the Apt MCP server is running.
Inputs: no named parameters.
queryAptPackageStatusC
Query if a package is installed, available, or upgradable.
Inputs: package (required).
removeAptPackageB
Remove one or more apt packages using sudo.
Inputs: packages (required).
unholdAptPackageB
Unhold one or more apt packages to allow them to be upgraded again.
Inputs: packages (required).
updateAptPackagesB
Update the apt package list and upgrade all packages using sudo.
Inputs: allowDowngrades.
upgradeSpecificAptPackageC
Upgrade a specific apt package using sudo.
Inputs: package (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool addresses a distinct apt operation—install, remove, update, upgrade, hold, unhold, autoremove, list upgradable, query status, and server ping—with no functional overlap.
Most tools follow a clear verb_noun pattern (e.g., installAptPackage, removeAptPackage), but 'ping' breaks the convention by lacking a noun component.
10 tools cover the essential apt lifecycle operations without superfluous extras, fitting the scope of an apt package management server perfectly.
Core operations like install, remove, upgrade, update, hold/unhold, autoremove, and status query are present; only minor gaps like 'purge' or 'search' are missing, which are not critical for typical workflows.
Maintenance
Related MCP Connectors
Package intelligence MCP for AI agents — 22 tools, 19 ecosystems, AGPL SDK, free.
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Manage Superlist tasks and lists in plain language from any MCP-compatible AI agent.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to automate local software management workflows including installation, uninstallation, updates, and environment recommendations. It provides a standardized, non-interactive interface for managing system applications and tracking software versions safely.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to remotely read/write files and execute commands on Linux servers via MCP protocol.5 npm1MIT
- AlicenseCqualityBmaintenanceEnables AI agents to manage system updates, application installations, and remote host orchestration through MCP tools.263MIT
- AlicenseAqualityCmaintenanceEnables AI agents to interact with the Linux desktop through desktop notifications, interactive dialogs, shell command execution, and privileged command execution.117 npm5MIT