i3wm-mcp
Enables querying and controlling the i3 (or Sway) window manager through natural language, offering tools for window management, workspace operations, and session configuration.
README
i3wm-mcp
A Model Context Protocol server for the i3 window manager (and, via the shared IPC, Sway). It lets an MCP client — Claude Code, Claude Desktop, the MCP Inspector — query and drive your i3/Sway session through a small set of well-described tools.
The tool definitions are deliberately tuned for a high
Glama tool-definition-quality score:
a consolidated, non-overlapping tool set, every parameter described, typed
output schemas, and honest readOnlyHint/destructiveHint annotations.
Derived from
caninja/i3wm-mcp(MIT). See ATTRIBUTION.md. This rewrite migrates the transport from thei3-msgCLI to the asynci3ipclibrary, consolidates 43 tools into 13, and adds tests, CI, and output schemas.
Tools
| Tool | Kind | What it does |
|---|---|---|
get_tree |
read | List windows from the layout tree, with filters. |
get_focused |
read | Details of the currently focused window. |
list_workspaces |
read | All active workspaces. |
list_outputs |
read | All display outputs (monitors). |
get_config |
read | Version + config + binding modes snapshot. |
focus_window |
mutate | Focus by direction / criteria / layer / parent-child. |
move_window |
mutate | Move a container to a direction / workspace / output / scratchpad / center. |
manage_workspace |
mutate | Switch / move-to / rename / navigate workspaces. |
set_layout |
mutate | Container layout, split orientation, border style. |
toggle_window_state |
mutate | Toggle floating / fullscreen / sticky. |
exec_application |
destructive | Launch a program via i3 exec (arbitrary code). |
run_command |
destructive | Raw i3/Sway command escape hatch (marks, gaps, bar, reload/restart). |
kill_window |
destructive | Close the focused or a matched window. |
Rarely-used verbs (marks, i3-gaps, i3bar, scratchpad show/hide, reload,
restart, and deliberately exit) are reached through run_command rather
than dedicated tools, keeping the set small and distinct.
Requirements
- A running i3 (≥4.x) or Sway session.
- Python ≥ 3.10.
The server locates the i3/Sway IPC socket from the environment, so it must be
launched from within your graphical session (it needs DISPLAY, or
SWAYSOCK/I3SOCK, in its environment). Clients that spawn it from inside the
session — Claude Code, the MCP Inspector — inherit this automatically; a headless
or systemd launch would need those variables passed explicitly.
Install
git clone https://github.com/kuhyx/i3wm-mcp
cd i3wm-mcp
python -m venv .venv
./.venv/bin/python -m pip install -e ".[dev]"
Run
./.venv/bin/python -m i3wm_mcp # stdio transport
Register with Claude Code
claude mcp add i3wm -- /absolute/path/to/i3wm-mcp/.venv/bin/python -m i3wm_mcp
Inspect the tool definitions
npx @modelcontextprotocol/inspector ./.venv/bin/python -m i3wm_mcp
Develop
./.venv/bin/python -m pytest # tests + 100% coverage gate
./.venv/bin/ruff check . && ./.venv/bin/ruff format --check .
./.venv/bin/mypy src
./.venv/bin/python scripts/rubric_check.py # local TDQS proxy check
Safety
Read tools have no side effects. Mutation tools are reversible. The three
destructive tools (exec_application, run_command, kill_window) can run
arbitrary commands, close applications, or — via run_command — restart or exit
the session; treat them accordingly and never feed them untrusted input.
License
MIT — see LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.