home / mcp / mcp prompt server

MCP Prompt Server

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

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "gdli6177-mcp-prompt-server": {
      "command": "node",
      "args": [
        "/path/to/prompt-server/src/index.js"
      ]
    }
  }
}

You run an MCP server that serves preset prompt templates as tools for editors like Cursor and Windsurf. This lets you manage, customize, and reuse prompts to automate tasks such as code review and API documentation, improving consistency and collaboration across different AI agents.

How to use

Once your MCP client connects to the Prompt Server, you can browse and invoke the available prompt tools to perform common tasks. The server exposes prompts as tools you can call with specific arguments. For example, you can request a code review or generate API documentation by selecting the corresponding prompt tool and supplying the required inputs. The prompts support dynamic parameters so you can tailor the output to your code language, project type, or preferred format. You can also reload prompts after adding new templates to keep your toolkit up to date.

How to install

1) Prerequisites
   - Install Node.js (recommended LTS) and npm on your system.
   - Ensure you have access to the machine where you will run the MCP server.

2) Install and start the Prompt Server
   - Clone or obtain the Prompt Server source in your workspace.
   - Install dependencies

```

```
cd prompt-server
npm install
```

```
```
3) Run the server

```
npm start
```

The server will start and listen for connections from MCP clients like Cursor and Windsurf.

Configuration and usage notes

You can configure your editors to connect to the Prompt Server via standard MCP transport. The following examples illustrate how to wire the local server so your editors can access the prompt tools. You can place the configuration in your editor’s MCP settings as shown.

// Cursor MCP config example
{
  "servers": [
    {
      "name": "Prompt Server",
      "command": ["node", "/path/to/prompt-server/src/index.js"],
      "transport": "stdio",
      "initialization_options": {}
    }
  ]
}
```

```
// Windsurf MCP config example
{
  "mcpServers": {
    "prompt-server": {
      "command": "node",
      "args": [
        "/path/to/prompt-server/src/index.js"
      ],
      "transport": "stdio"
    }
  }
}

Adding new prompt templates

You can extend the available prompts by adding new YAML or JSON templates in the prompts directory. Each template should define a unique name, a description, optional arguments, and the sequence of messages that compose the prompt. After adding new files, the server will load them on startup or you can trigger a prompt reload using the provided tooling.

name: prompt_name
description: prompt description
arguments:
  - name: arg_name
    description: arg description
    required: true
messages:
  - role: user
    content:
      type: text
      text: |-
        Your prompt text here with {{arg_name}} placeholders

Available tools

code_review

Prompts for code review tasks that analyze and suggest improvements for code snippets in multiple languages.

api_documentation

Templates to generate API documentation from code or schemas, outputting in a chosen format such as Markdown.

code_refactoring

Guided prompts that propose refactorings to improve code structure, readability, and maintainability.

test_case_generator

Prompts to produce test cases based on code snippets or requirements to assist testing workflows.

project_architecture

Templates that outline or generate high-level project architecture descriptions and diagrams.