local-manpage-mcp-server

A MCP server which loads the man pages of tools in $PATH as resource. The goal is to provide the LLM with context of the commands on the host machine

GitHub Stars

2

User Rating

Not Rated

Forks

0

Issues

0

Views

1

Favorites

0

README
local-manpage-mcp-server
Submission Demo Video

IMAGE ALT TEXT HERE

Summary

local-manpage-mcp-server is an MCP server that extracts and exposes the man pages of all executables in your $PATH as MCP resources. Its primary goal is to give an LLM (or any MCP client) direct access to up-to-date documentation for the commands installed on the host system. This server is intended to run on Linux distributions only (see Disclaimer below).

The create_all_manpage_files tool generates the manpages/ directory where the extracted man pages are stored. These files are then served when an MCP resource is requested. A wrapper tool is also provided in case your host application does not support MCP resources directly.

Disclaimer

Linux Only: This server is designed exclusively for Linux distributions. It relies on the man and col utilities (and a standard $PATH structure) to extract man pages. It has not been tested on macOS, BSD, or Windows, and may not function correctly on those systems.

Permissions: You must have read access to all directories in your $PATH and write permissions for a local manpages/ folder (created automatically).

Resource Limits: Generating man pages for a large number of binaries can be CPU- and disk-intensive.

Argument Safety: The arguments passed to man and col are not sanitized or validated. This could potentially allow command injection if malicious input is provided.

Setup
git clone https://github.com/yourusername/local-manpage-mcp-server.git
cd local-manpage-mcp-server

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Starting the MCP Server and Inspector
uv run mcp dev server.py
Usage

One goal of this project is to provide a self-explanatory server that exposes usage information as a prompt for your host application. This way, your LLM can describe the workflow automatically.

In addition, you must run the create_all_manpage_files tool to generate the MCP resources based on the commands available on your system. After execution, all relevant man pages should be accessible as MCP resources.

With the Inspector
Discover prompts for yourself

Available Prompts

  1. Go to Prompts
  2. Click List Prompts
  3. e.g. Select guide and click Get Prompt
Create the manpage resources

Create all manpages

  1. Go to Tools
  2. Click List Tools
  3. Select create_all_manpage_files and click Run Tool

example response: Create all manpages response

Now you can

  1. Go to Resources
  2. Click List Resources
  3. Select a man page e.g. Man page for 7z
  4. Check the response on the right side

example response: 7z manual as resource

Author Information
DomestiCode

Aspiring to be the latest but not last brain-first company, no hurry in TTM at all.. That's how you code in natural language.

0

Followers

1

Repositories

0

Gists

19

Total Contributions

Top Contributors

Threads