What is 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.
Documentation
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 sudo assumed for all operations
Input validation and robust error handling
Consistent, human-readable output for all tools
Designed for stdio transport (default for local AI agent integration)
Setup & Installation
Clone the repository:
git clone <your-repo-url>
cd popos-control-mcp
Install dependencies:
npm install
Build the project:
npm run build
Run the server (stdio transport):
npm run dev
# or
npm start
Note: The server assumes the user has passwordless sudo for 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"])
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.