by GdMacmillan
Apt MCP Server is a TypeScript-based server that allows AI agents and developer tools to control the `apt` package manager on Linux. It provides a programmatic interface for managing software packages and automating system administration tasks.
Apt MCP Server is a TypeScript-based server built with the FastMCP framework that allows AI agents and developer tools to control the apt
package manager on Linux. It exposes various tools to interact with apt
and dpkg
binaries using sudo
privileges.
To use Apt MCP Server, first clone the repository, install dependencies using npm install
, and then build the project with npm run build
. The server can then be run using npm run dev
or npm start
. It primarily uses stdio transport for integration with local AI agents. Example usage with Node.js and the @modelcontextprotocol/sdk
is provided in the documentation, demonstrating how to call tools like installAptPackage
.
sudo
for all operations.installAptPackage
, removeAptPackage
, queryAptPackageStatus
, updateAptPackages
, listUpgradableAptPackages
, and upgradeSpecificAptPackage
.server.addTool
block in src/index.ts
following the existing pattern.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.
sudo
assumed for all operationsgit clone <your-repo-url>
cd popos-control-mcp
npm install
npm run build
npm run dev
# or
npm start
Note: The server assumes the user has passwordless
sudo
for apt operations.
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).
installAptPackage
packages
: array of package names (e.g., ["curl", "git"]
){ "packages": ["curl"] }
Result: SUCCESS
Summary: Apt install succeeded for: curl
[stdout]
...
[stderr]
...
removeAptPackage
packages
: array of package names{ "packages": ["curl"] }
Result: SUCCESS
Summary: Apt remove succeeded for: curl
[stdout]
...
[stderr]
...
queryAptPackageStatus
package
: package name (string){ "package": "curl" }
Result: SUCCESS
Summary: Status for package curl: Installed=installed, Upgradable=false, Available=available
[stdout]
Package: curl
Installed: installed
Upgradable: no
Available: available
updateAptPackages
{}
Result: SUCCESS
Summary: Apt update and upgrade completed successfully.
[stdout]
apt update stdout:
...
apt upgrade stdout:
...
[stderr]
...
listUpgradableAptPackages
{}
Result: SUCCESS
Summary: Listed upgradable packages successfully.
[stdout]
...
[stderr]
...
upgradeSpecificAptPackage
package
: package name (string){ "package": "curl" }
Result: SUCCESS
Summary: Apt only-upgrade succeeded for: curl
[stdout]
...
[stderr]
...
You can test the server using the MCP CLI or by connecting with an AI agent (e.g., Cursor, Claude Desktop).
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);
})();
Result: ERROR
and a summary.Result: ERROR
Summary: Apt install failed: E: Unable to locate package notarealpackage
[stdout]
...
[stderr]
E: Unable to locate package notarealpackage
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.
MIT
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by Skyvern-AI
Skyvern automates browser-based workflows using LLMs and computer vision, offering a robust solution for repetitive online tasks.
by PipedreamHQ
Connect APIs quickly, run event‑driven automations, and execute custom code in Node.js, Python, Go, or Bash on a hosted platform.
by czlonkowski
Provides AI assistants with structured access to n8n node documentation, properties, and operations, enabling automated workflow creation, validation, and management.
by executeautomation
mcp-playwright is a Model Context Protocol (MCP) server that enables large language models (LLMs) to perform browser automation and web scraping tasks using Playwright.
by browserbase
Provides cloud browser automation capabilities for LLMs, enabling web navigation, interaction, screenshot capture, and data extraction through Browserbase and Stagehand.
by haris-musa
excel-mcp-server is a Python-based Model Context Protocol (MCP) server that enables AI agents to programmatically create, read, and modify Excel files without requiring Microsoft Excel to be installed.
by mobile-next
Mobile-mcp is a Model Context Protocol (MCP) server designed for scalable mobile automation, app scraping, and development across iOS and Android devices, including physical devices, simulators, and emulators.
by anaisbetts
mcp-installer is an MCP server designed to automate the installation of other MCP servers, simplifying the process for users.
by leonardsellem
An MCP server that enables AI assistants to interact with n8n workflows through natural language.