by GdMacmillan
Provides MCP tools to install, remove, update, and query apt packages on Linux through a TypeScript server.
Apt MCP Server exposes a set of Model Context Protocol (MCP) tools that allow AI agents or client applications to manage apt packages on a Linux system. It leverages the native apt
and dpkg
commands with password‑less sudo privileges and returns structured, human‑readable results.
npm install
.npm run build
.npm run dev
or npm start
.@modelcontextprotocol/sdk/client
) and call tools such as installAptPackage
, removeAptPackage
, queryAptPackageStatus
, etc.Q: Does the server require passwordless sudo? A: Yes, all apt/dpkg commands run with sudo and assume no password prompt.
Q: What transport does the server use? A: Stdio by default, which works well for local AI agents and tools.
Q: Can I use this server remotely? A: It can be adapted to HTTP/SSE transport, but stdio is recommended for local use.
Q: How do I add new tools?
A: Add a new 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.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.