@travisjbeck/ch-sh-mcp
v1.0.3
Published
MCP Server for cht.sh integration with Cursor
Maintainers
Readme
cht.sh MCP Server for Cursor
A Model Context Protocol (MCP) server that integrates the powerful cht.sh cheat sheet service with Cursor. This allows AI agents and users to quickly fetch programming language syntax, commands, and examples directly within the Cursor editor.
NPX Usage
The simplest way to use this MCP server is with npx:
npx @travisjbeck/ch-sh-mcpThis command will start the MCP server, making it available for Cursor to connect.
Features
- Direct
cht.shQueries: Leverages the extensivecht.shdatabase for cheat sheets. - Flexible Querying: Supports multi-word queries (e.g., "python http server") and
cht.shspecific options. - AI Agent Focused: Designed to provide concise and relevant information for AI-assisted coding.
AI Agent Tool
query_cheatsheet: Fetches a cheat sheet fromcht.sh.- Parameters:
query(string, required): The search term or topic (e.g., "javascript array methods", "git commit").options(string, optional): Optionalcht.shquery parameters (e.g., "Tq" for terse output without comments, "Q" for quiet mode). Refer tocht.sh/:helpfor all options.
- Returns: The text content of the fetched cheat sheet.
- Parameters:
Setup in Cursor
- Open Cursor and go to
Settings > Cursor Settings > MCP. - Click
+ Add new global MCP server. - Fill in the fields:
- Name:
cht.sh Server(or any preferred name) - Type:
command - Command:
npx @travisjbeck/ch-sh-mcp
- Name:
- Click
Add. - Restart Cursor to ensure the new MCP server is recognized.
Manual Installation (Optional)
If you prefer to install the package globally:
npm install -g @travisjbeck/ch-sh-mcpThen, in Cursor's MCP settings, set the command to simply @travisjbeck/ch-sh-mcp.
For Developers
Prerequisites
- Node.js (v18.0.0 or higher)
- npm
Installation from Source
git clone https://github.com/travisjbeck/ch-sh-mcp.git
cd ch-sh-mcp
npm installBuilding
npm run buildThis compiles the TypeScript source to JavaScript in the dist directory.
Running Locally for Development
npm run devThis will start the server using ts-node for live reloading.
Testing
Manual testing with Cursor is recommended. Configure Cursor to use your local development server (e.g., node dist/index.js or the npm run dev command).
The server includes basic error handling and will output logs to stderr.
Project Structure
src/index.ts: The main MCP server implementation.package.json: Project metadata, dependencies, and scripts.tsconfig.json: TypeScript compiler configuration.
License
MIT - See LICENSE for details.
