Get the FREE Ultimate OpenClaw Setup Guide →

mcp-prompt

这是一个基于Model Context Protocol (MCP)的服务器,用于根据用户任务需求提供预设的prompt模板,帮助Cline/Cursor/Windsurf...更高效地执行各种任务。服务器将预设的prompt作为工具(tools)返回,以便在Cursor和Windsurf等编辑器中更好地使用。

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gdli6177-mcp-prompt-server node /path/to/prompt-server/src/index.js

How to use

MCP Prompt Server exposes a collection of pre-defined prompt templates as MCP tools. These tools are designed to be consumed by editors like Cursor and Windsurf, enabling you to run common tasks such as code review, API documentation generation, and code refactoring directly through the MCP interface. The server loads prompts from the src/prompts directory and presents each prompt as a tool that can be invoked with a structured payload. You can also reload prompts at runtime using the provided management tools, ensuring your tooling stays up-to-date as you add or modify templates. The server’s design emphasizes dynamic parameter replacement, so you can tailor prompts with specific language, code, or formatting requirements before sending them to your editor or agent.

Available prompt tools (as defined in the repository) include code_review, api_documentation, code_refactoring, test_case_generator, and project_architecture. Each tool accepts an arguments object that encodes the necessary inputs for the task (e.g., language, code snippet, or project context) and returns a structured prompt payload ready to be consumed by your MCP-enabled editor or agent. In addition to prompts, the server offers management actions like reload_prompts and get_prompt_names to manage and inspect the available tools. For integration, configure the MCP client in your editor to point to the node-based server (e.g., via a standard stdio transport), and reference the appropriate command and path to the server entry point.

How to install

Prerequisites:

  • Node.js (v14+ recommended) and npm/yarn installed
  • Access to the repository containing the prompt-server project

Installation steps:

  1. Clone the repository
git clone https://github.com/your-org/path-to-repo.git
cd path-to-repo
  1. Install dependencies
cd prompt-server
npm install
  1. Run the server
npm start
  1. Connect clients (Cursor/Windsurf) to the MCP server using the appropriate configuration, typically pointing to the node entry at src/index.js as shown in the README examples.

Notes:

  • Ensure that the src/prompts directory contains the YAML/JSON prompt definitions you intend to expose as tools.
  • To add new prompts, drop a YAML/JSON file into src/prompts and restart or reload the prompts via the management tool (reload_prompts) if provided by the server.
  • If you modify the server code, restart the server to apply changes.

Additional notes

Tips and considerations:

  • The server exposes prompts as MCP tools rather than MCP prompts themselves; use the tool API (e.g., get_prompt_names) to enumerate available prompts.
  • When integrating with editors, ensure the transport (stdio) is correctly configured in the editor's MCP configuration file.
  • If you're deploying in a container or CI environment, consider pinning Node.js versions and scripts to ensure reproducible startup.
  • Watch for environment-specific paths (e.g., /path/to/prompt-server) and replace with your actual deployment path.
  • If prompts rely on dynamic parameters, ensure your editor or agent supplies those parameters in the arguments section to avoid runtime errors.

Related MCP Servers

Sponsor this space

Reach thousands of developers