prettier-mcp

ncalteen/prettier-mcp

3.2

If you are the rightful owner of prettier-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This repository implements a Model Context Protocol (MCP) server that integrates with Prettier to provide code formatting capabilities.

prettier-mcp

MCP server to check and format code files using Prettier.

This repository is a simple implementation of a Model Context Protocol (MCP) server that integrates with Prettier to provide code formatting capabilities. It listens for requests to check or format code files.

Continuous Integration Continuous Delivery Coverage Linter

Usage

To install this MCP server in VS Code, follow the below instructions:

  1. Clone this repository

  2. Add the following configuration to your settings.json or .vscode/mcp.json file. Make sure to replace <PATH_TO_CLONED_REPOSITORY> with the actual path where you cloned this repository.

    {
      "mcp": {
        "servers": {
          "Prettier": {
            "type": "stdio",
            "command": "node",
            "args": ["<PATH_TO_CLONED_REPOSITORY>/dist/index.js"],
            "env": {
              "PRETTIER_CONFIG_PATH": "${input:prettier-config-path}"
            }
          }
        }
      }
    }
    

Debugging

npx @modelcontextprotocol/inspector node "<PATH_TO_CLONED_REPOSITORY>/dist/index.js"

Reference